dovecot-2.2: lib-storage API change to allow using it from C++ code
dovecot at dovecot.org
dovecot at dovecot.org
Thu Sep 13 10:53:57 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/7c6d30280cff
changeset: 15041:7c6d30280cff
user: Timo Sirainen <tss at iki.fi>
date: Thu Sep 13 10:53:38 2012 +0300
description:
lib-storage API change to allow using it from C++ code
diffstat:
src/lib-storage/mail-storage-private.h | 11 ++++++-----
src/lib-storage/mail-storage.c | 8 ++++----
src/plugins/acl/acl-mailbox.c | 16 ++++++++--------
src/plugins/lazy-expunge/lazy-expunge-plugin.c | 6 +++---
src/plugins/notify/notify-storage.c | 16 ++++++++--------
5 files changed, 29 insertions(+), 28 deletions(-)
diffs (192 lines):
diff -r d7dd5cdf1ba7 -r 7c6d30280cff src/lib-storage/mail-storage-private.h
--- 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);
diff -r d7dd5cdf1ba7 -r 7c6d30280cff src/lib-storage/mail-storage.c
--- 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)
diff -r d7dd5cdf1ba7 -r 7c6d30280cff src/plugins/acl/acl-mailbox.c
--- 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;
diff -r d7dd5cdf1ba7 -r 7c6d30280cff src/plugins/lazy-expunge/lazy-expunge-plugin.c
--- 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;
}
}
diff -r d7dd5cdf1ba7 -r 7c6d30280cff src/plugins/notify/notify-storage.c
--- 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);
}
More information about the dovecot-cvs
mailing list