dovecot-2.2: Moved mailbox_equals() to lib-storage.

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 2 17:19:04 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/e4d5c3ba305b
changeset: 15009:e4d5c3ba305b
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 02 17:15:09 2012 +0300
description:
Moved mailbox_equals() to lib-storage.

diffstat:

 src/imap/imap-commands-util.c  |  17 -----------------
 src/imap/imap-commands-util.h  |   4 ----
 src/lib-storage/mail-storage.c |  17 +++++++++++++++++
 src/lib-storage/mail-storage.h |   5 +++++
 4 files changed, 22 insertions(+), 21 deletions(-)

diffs (83 lines):

diff -r 9e4257061225 -r e4d5c3ba305b src/imap/imap-commands-util.c
--- a/src/imap/imap-commands-util.c	Sun Sep 02 16:48:25 2012 +0300
+++ b/src/imap/imap-commands-util.c	Sun Sep 02 17:15:09 2012 +0300
@@ -313,23 +313,6 @@
 	return array_idx(dest, 0);
 }
 
-bool mailbox_equals(const struct mailbox *box1,
-		    const struct mail_namespace *ns2, const char *name2)
-{
-	struct mail_namespace *ns1 = mailbox_get_namespace(box1);
-	const char *name1;
-
-	if (ns1 != ns2)
-		return FALSE;
-
-        name1 = mailbox_get_vname(box1);
-	if (strcmp(name1, name2) == 0)
-		return TRUE;
-
-	return strcasecmp(name1, "INBOX") == 0 &&
-		strcasecmp(name2, "INBOX") == 0;
-}
-
 void msgset_generator_init(struct msgset_generator_context *ctx, string_t *str)
 {
 	memset(ctx, 0, sizeof(*ctx));
diff -r 9e4257061225 -r e4d5c3ba305b src/imap/imap-commands-util.h
--- a/src/imap/imap-commands-util.h	Sun Sep 02 16:48:25 2012 +0300
+++ b/src/imap/imap-commands-util.h	Sun Sep 02 17:15:09 2012 +0300
@@ -56,10 +56,6 @@
 client_get_keyword_names(struct client *client, ARRAY_TYPE(keywords) *dest,
 			 const ARRAY_TYPE(keyword_indexes) *src);
 
-bool mailbox_equals(const struct mailbox *box1,
-		    const struct mail_namespace *ns2,
-		    const char *name2) ATTR_PURE;
-
 void msgset_generator_init(struct msgset_generator_context *ctx, string_t *str);
 void msgset_generator_next(struct msgset_generator_context *ctx, uint32_t uid);
 void msgset_generator_finish(struct msgset_generator_context *ctx);
diff -r 9e4257061225 -r e4d5c3ba305b src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Sun Sep 02 16:48:25 2012 +0300
+++ b/src/lib-storage/mail-storage.c	Sun Sep 02 17:15:09 2012 +0300
@@ -1014,6 +1014,23 @@
 	pool_unref(&box->pool);
 }
 
+bool mailbox_equals(const struct mailbox *box1,
+		    const struct mail_namespace *ns2, const char *vname2)
+{
+	struct mail_namespace *ns1 = mailbox_get_namespace(box1);
+	const char *name1;
+
+	if (ns1 != ns2)
+		return FALSE;
+
+        name1 = mailbox_get_vname(box1);
+	if (strcmp(name1, vname2) == 0)
+		return TRUE;
+
+	return strcasecmp(name1, "INBOX") == 0 &&
+		strcasecmp(vname2, "INBOX") == 0;
+}
+
 int mailbox_create(struct mailbox *box, const struct mailbox_update *update,
 		   bool directory)
 {
diff -r 9e4257061225 -r e4d5c3ba305b src/lib-storage/mail-storage.h
--- a/src/lib-storage/mail-storage.h	Sun Sep 02 16:48:25 2012 +0300
+++ b/src/lib-storage/mail-storage.h	Sun Sep 02 17:15:09 2012 +0300
@@ -412,6 +412,11 @@
 /* Close and free the mailbox. */
 void mailbox_free(struct mailbox **box);
 
+/* Returns TRUE if box1 points to the same mailbox as ns2/vname2. */
+bool mailbox_equals(const struct mailbox *box1,
+		    const struct mail_namespace *ns2,
+		    const char *vname2) ATTR_PURE;
+
 /* Create a mailbox. Returns failure if it already exists. Mailbox name is
    allowed to contain multiple new nonexistent hierarchy levels. If directory
    is TRUE, the mailbox should be created so that it can contain children. The


More information about the dovecot-cvs mailing list