Mercurial > dovecot > core-2.2
changeset 15041:7c6d30280cff
lib-storage API change to allow using it from C++ code
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 13 Sep 2012 10:53:38 +0300 |
parents | d7dd5cdf1ba7 |
children | b5bf7bcd43ae |
files | src/lib-storage/mail-storage-private.h src/lib-storage/mail-storage.c src/plugins/acl/acl-mailbox.c src/plugins/lazy-expunge/lazy-expunge-plugin.c src/plugins/notify/notify-storage.c |
diffstat | 5 files changed, 29 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/mail-storage-private.h Thu Sep 13 10:52:52 2012 +0300 +++ b/src/lib-storage/mail-storage-private.h Thu Sep 13 10:53:38 2012 +0300 @@ -127,11 +127,12 @@ void (*close)(struct mailbox *box); void (*free)(struct mailbox *box); - int (*create)(struct mailbox *box, const struct mailbox_update *update, - bool directory); - int (*update)(struct mailbox *box, const struct mailbox_update *update); - int (*delete)(struct mailbox *box); - int (*rename)(struct mailbox *src, struct mailbox *dest); + int (*create_box)(struct mailbox *box, + const struct mailbox_update *update, bool directory); + int (*update_box)(struct mailbox *box, + const struct mailbox_update *update); + int (*delete_box)(struct mailbox *box); + int (*rename_box)(struct mailbox *src, struct mailbox *dest); int (*get_status)(struct mailbox *box, enum mailbox_status_items items, struct mailbox_status *status_r);
--- a/src/lib-storage/mail-storage.c Thu Sep 13 10:52:52 2012 +0300 +++ b/src/lib-storage/mail-storage.c Thu Sep 13 10:53:38 2012 +0300 @@ -1056,7 +1056,7 @@ mailbox_refresh_permissions(box); box->creating = TRUE; - ret = box->v.create(box, update, directory); + ret = box->v.create_box(box, update, directory); box->creating = FALSE; return ret; } @@ -1067,7 +1067,7 @@ update->min_first_recent_uid == 0 || update->min_first_recent_uid <= update->min_next_uid); - return box->v.update(box, update); + return box->v.update_box(box, update); } int mailbox_mark_index_deleted(struct mailbox *box, bool del) @@ -1133,7 +1133,7 @@ /* \noselect mailbox */ } - ret = box->v.delete(box); + ret = box->v.delete_box(box); if (ret < 0 && box->marked_deleted) { /* deletion failed. revert the mark so it can maybe be tried again later. */ @@ -1237,7 +1237,7 @@ return -1; } - return src->v.rename(src, dest); + return src->v.rename_box(src, dest); } int mailbox_set_subscribed(struct mailbox *box, bool set)
--- a/src/plugins/acl/acl-mailbox.c Thu Sep 13 10:52:52 2012 +0300 +++ b/src/plugins/acl/acl-mailbox.c Thu Sep 13 10:53:38 2012 +0300 @@ -129,7 +129,7 @@ super.create() may call e.g. mailbox_open() which will fail since we haven't yet copied ACLs to this mailbox. */ abox->skip_acl_checks = TRUE; - ret = abox->module_ctx.super.create(box, update, directory); + ret = abox->module_ctx.super.create_box(box, update, directory); abox->skip_acl_checks = FALSE; if (ret == 0) acl_mailbox_copy_acls_from_parent(box); @@ -145,7 +145,7 @@ ret = acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_ADMIN); if (ret <= 0) return -1; - return abox->module_ctx.super.update(box, update); + return abox->module_ctx.super.update_box(box, update); } static void acl_mailbox_fail_not_found(struct mailbox *box) @@ -178,7 +178,7 @@ /* deletion might internally open the mailbox. let it succeed even if we don't have READ permission. */ abox->skip_acl_checks = TRUE; - ret = abox->module_ctx.super.delete(box); + ret = abox->module_ctx.super.delete_box(box); abox->skip_acl_checks = FALSE; return ret; } @@ -216,7 +216,7 @@ return -1; } - return abox->module_ctx.super.rename(src, dest); + return abox->module_ctx.super.rename_box(src, dest); } static int @@ -540,10 +540,10 @@ v->exists = acl_mailbox_exists; v->open = acl_mailbox_open; v->get_status = acl_mailbox_get_status; - v->create = acl_mailbox_create; - v->update = acl_mailbox_update; - v->delete = acl_mailbox_delete; - v->rename = acl_mailbox_rename; + v->create_box = acl_mailbox_create; + v->update_box = acl_mailbox_update; + v->delete_box = acl_mailbox_delete; + v->rename_box = acl_mailbox_rename; v->save_begin = acl_save_begin; v->copy = acl_copy; v->transaction_commit = acl_transaction_commit;
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c Thu Sep 13 10:52:52 2012 +0300 +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c Thu Sep 13 10:53:38 2012 +0300 @@ -246,7 +246,7 @@ "Can't rename mailboxes to/from expunge namespace."); return -1; } - return lbox->super.rename(src, dest); + return lbox->super.rename_box(src, dest); } static void lazy_expunge_mailbox_allocated(struct mailbox *box) @@ -268,9 +268,9 @@ v->transaction_begin = lazy_expunge_transaction_begin; v->transaction_commit = lazy_expunge_transaction_commit; v->transaction_rollback = lazy_expunge_transaction_rollback; - v->rename = lazy_expunge_mailbox_rename; + v->rename_box = lazy_expunge_mailbox_rename; } else { - v->rename = lazy_expunge_mailbox_rename; + v->rename_box = lazy_expunge_mailbox_rename; } }
--- a/src/plugins/notify/notify-storage.c Thu Sep 13 10:52:52 2012 +0300 +++ b/src/plugins/notify/notify-storage.c Thu Sep 13 10:53:38 2012 +0300 @@ -201,7 +201,7 @@ { union mailbox_module_context *lbox = NOTIFY_CONTEXT(box); - if (lbox->super.create(box, update, directory) < 0) + if (lbox->super.create_box(box, update, directory) < 0) return -1; notify_contexts_mailbox_create(box); @@ -213,7 +213,7 @@ { union mailbox_module_context *lbox = NOTIFY_CONTEXT(box); - if (lbox->super.update(box, update) < 0) + if (lbox->super.update_box(box, update) < 0) return -1; notify_contexts_mailbox_update(box); @@ -226,7 +226,7 @@ union mailbox_module_context *lbox = NOTIFY_CONTEXT(box); notify_contexts_mailbox_delete_begin(box); - if (lbox->super.delete(box) < 0) { + if (lbox->super.delete_box(box) < 0) { notify_contexts_mailbox_delete_rollback(); return -1; } @@ -239,7 +239,7 @@ { union mailbox_module_context *lbox = NOTIFY_CONTEXT(src); - if (lbox->super.rename(src, dest) < 0) + if (lbox->super.rename_box(src, dest) < 0) return -1; notify_contexts_mailbox_rename(src, dest); @@ -273,10 +273,10 @@ v->transaction_begin = notify_transaction_begin; v->transaction_commit = notify_transaction_commit; v->transaction_rollback = notify_transaction_rollback; - v->create = notify_mailbox_create; - v->update = notify_mailbox_update; - v->delete = notify_mailbox_delete; - v->rename = notify_mailbox_rename; + v->create_box = notify_mailbox_create; + v->update_box = notify_mailbox_update; + v->delete_box = notify_mailbox_delete; + v->rename_box = notify_mailbox_rename; v->set_subscribed = notify_mailbox_set_subscribed; MODULE_CONTEXT_SET_SELF(box, notify_storage_module, lbox); }