]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added mailbox_keywords_create_from_indexes().
authorTimo Sirainen <tss@iki.fi>
Fri, 5 Jun 2009 00:13:40 +0000 (20:13 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 5 Jun 2009 00:13:40 +0000 (20:13 -0400)
--HG--
branch : HEAD

src/lib-storage/index/cydir/cydir-storage.c
src/lib-storage/index/dbox/dbox-storage.c
src/lib-storage/index/index-storage.c
src/lib-storage/index/index-storage.h
src/lib-storage/index/maildir/maildir-storage.c
src/lib-storage/index/mbox/mbox-storage.c
src/lib-storage/index/raw/raw-storage.c
src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage.c
src/lib-storage/mail-storage.h

index 36adc08a075cf29ed5fe773a9b1dda553c889e1c..a5e0266add6abf4f3597a9c59dbec272009ed04b 100644 (file)
@@ -385,6 +385,7 @@ struct mailbox cydir_mailbox = {
                index_transaction_rollback,
                index_transaction_set_max_modseq,
                index_keywords_create,
+               index_keywords_create_from_indexes,
                index_keywords_free,
                index_keyword_is_valid,
                index_storage_get_seq_range,
index b042495c109225deb55477bc8b848e4676f33c57..0004d82ba4c2f6b407fc108f4d3c1e835a8f61dc 100644 (file)
@@ -786,6 +786,7 @@ struct mailbox dbox_mailbox = {
                index_transaction_rollback,
                index_transaction_set_max_modseq,
                index_keywords_create,
+               index_keywords_create_from_indexes,
                index_keywords_free,
                index_keyword_is_valid,
                index_storage_get_seq_range,
index 1bc71a1820c911f1437ecc013313df7188c2892e..77f15051edb89389cc59090d8d39af5444ac789c 100644 (file)
@@ -598,6 +598,15 @@ int index_keywords_create(struct mailbox *_box, const char *const keywords[],
        return 0;
 }
 
+struct mail_keywords *
+index_keywords_create_from_indexes(struct mailbox *_box,
+                                  const ARRAY_TYPE(keyword_indexes) *idx)
+{
+       struct index_mailbox *ibox = (struct index_mailbox *)_box;
+
+       return mail_index_keywords_create_from_indexes(ibox->index, idx);
+}
+
 void index_keywords_free(struct mail_keywords *keywords)
 {
        mail_index_keywords_free(&keywords);
index 4d88d788b17555100c69f9546954f96eb177de42..0807ecff43b3e35dd66f2f45126a74db434e7641 100644 (file)
@@ -106,6 +106,9 @@ bool index_storage_is_inconsistent(struct mailbox *box);
 
 int index_keywords_create(struct mailbox *box, const char *const keywords[],
                          struct mail_keywords **keywords_r, bool skip_invalid);
+struct mail_keywords *
+index_keywords_create_from_indexes(struct mailbox *box,
+                                  const ARRAY_TYPE(keyword_indexes) *idx);
 void index_keywords_free(struct mail_keywords *keywords);
 bool index_keyword_is_valid(struct mailbox *box, const char *keyword,
                            const char **error_r);
index 3eb5d7657b4217d45d77f409a320f686b9d5ab6c..e703204b4dc6a3ae26f4a62c4807e5147b217f2e 100644 (file)
@@ -1069,6 +1069,7 @@ struct mailbox maildir_mailbox = {
                index_transaction_rollback,
                index_transaction_set_max_modseq,
                index_keywords_create,
+               index_keywords_create_from_indexes,
                index_keywords_free,
                index_keyword_is_valid,
                index_storage_get_seq_range,
index ea59c7d197e6cb73054778f62d9e5a2f6f0a0bd3..af7a37e7ee9bd3394bdda59e11a666722c201cee 100644 (file)
@@ -902,6 +902,7 @@ struct mailbox mbox_mailbox = {
                index_transaction_rollback,
                index_transaction_set_max_modseq,
                index_keywords_create,
+               index_keywords_create_from_indexes,
                index_keywords_free,
                index_keyword_is_valid,
                index_storage_get_seq_range,
index d1964954ec738537d32a3f5c9288dedb8bf843a5..8f8f4d44fc69895b7ed6e4eedcd6787448eb89c5 100644 (file)
@@ -236,6 +236,7 @@ struct mailbox raw_mailbox = {
                index_transaction_rollback,
                index_transaction_set_max_modseq,
                index_keywords_create,
+               index_keywords_create_from_indexes,
                index_keywords_free,
                index_keyword_is_valid,
                index_storage_get_seq_range,
index 58822905b067a3ad8cb789ae2fd4a6b1ff54bb3b..b74602d9471de1e759b51b659404b4a58c849f48 100644 (file)
@@ -149,6 +149,9 @@ struct mailbox_vfuncs {
                               const char *const keywords[],
                               struct mail_keywords **keywords_r,
                               bool skip_invalid);
+       struct mail_keywords *
+               (*keywords_create_from_indexes)(struct mailbox *box,
+                                               const ARRAY_TYPE(keyword_indexes) *idx);
        void (*keywords_free)(struct mail_keywords *keywords);
        bool (*keyword_is_valid)(struct mailbox *box, const char *keyword,
                                 const char **error_r);
index fdefc3c3ca1cad950395a2d350ebfc1c3eb1bd9e..3ac994181020712b2fa442ef1fa8b941a9189097 100644 (file)
@@ -66,7 +66,8 @@ void mail_storage_class_unregister(struct mail_storage *storage_class)
                }
        }
 
-       storage_class->v.class_deinit();
+       if (storage_class->v.class_deinit != NULL)
+               storage_class->v.class_deinit();
 }
 
 struct mail_storage *mail_storage_find_class(const char *name)
@@ -322,7 +323,8 @@ void mail_storage_unref(struct mail_storage **_storage)
 
        DLLIST_REMOVE(&storage->user->storages, storage);
 
-       storage->v.destroy(storage);
+       if (storage->v.destroy != NULL)
+               storage->v.destroy(storage);
        i_free(storage->error_string);
        pool_unref(&storage->pool);
 }
@@ -642,6 +644,13 @@ mailbox_keywords_create_valid(struct mailbox *box,
        return kw;
 }
 
+struct mail_keywords *
+mailbox_keywords_create_from_indexes(struct mailbox *box,
+                                    const ARRAY_TYPE(keyword_indexes) *idx)
+{
+       return box->v.keywords_create_from_indexes(box, idx);
+}
+
 void mailbox_keywords_free(struct mailbox *box,
                           struct mail_keywords **_keywords)
 {
index 5ef20a63bd78ec6c868f7fbc4f63cb5fb5699726..190b39373e3fa585d3fa32a5404f4295d33049a0 100644 (file)
@@ -390,6 +390,9 @@ int mailbox_keywords_create(struct mailbox *box, const char *const keywords[],
 struct mail_keywords *
 mailbox_keywords_create_valid(struct mailbox *box,
                              const char *const keywords[]);
+struct mail_keywords *
+mailbox_keywords_create_from_indexes(struct mailbox *box,
+                                    const ARRAY_TYPE(keyword_indexes) *idx);
 void mailbox_keywords_free(struct mailbox *box,
                           struct mail_keywords **keywords);
 /* Returns TRUE if keyword is valid, FALSE and error if not. */