Mercurial > dovecot > core-2.2
changeset 9455:374d29a1905e HEAD
Added mailbox_keywords_create_from_indexes().
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 04 Jun 2009 20:13:40 -0400 |
parents | 87e533f1127d |
children | 63f4a2825bbe |
files | 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 |
diffstat | 10 files changed, 34 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/cydir/cydir-storage.c Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/index/cydir/cydir-storage.c Thu Jun 04 20:13:40 2009 -0400 @@ -385,6 +385,7 @@ 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,
--- a/src/lib-storage/index/dbox/dbox-storage.c Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/index/dbox/dbox-storage.c Thu Jun 04 20:13:40 2009 -0400 @@ -786,6 +786,7 @@ 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,
--- a/src/lib-storage/index/index-storage.c Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/index/index-storage.c Thu Jun 04 20:13:40 2009 -0400 @@ -598,6 +598,15 @@ 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);
--- a/src/lib-storage/index/index-storage.h Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/index/index-storage.h Thu Jun 04 20:13:40 2009 -0400 @@ -106,6 +106,9 @@ 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);
--- a/src/lib-storage/index/maildir/maildir-storage.c Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/index/maildir/maildir-storage.c Thu Jun 04 20:13:40 2009 -0400 @@ -1069,6 +1069,7 @@ 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,
--- a/src/lib-storage/index/mbox/mbox-storage.c Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/index/mbox/mbox-storage.c Thu Jun 04 20:13:40 2009 -0400 @@ -902,6 +902,7 @@ 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,
--- a/src/lib-storage/index/raw/raw-storage.c Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/index/raw/raw-storage.c Thu Jun 04 20:13:40 2009 -0400 @@ -236,6 +236,7 @@ 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,
--- a/src/lib-storage/mail-storage-private.h Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/mail-storage-private.h Thu Jun 04 20:13:40 2009 -0400 @@ -149,6 +149,9 @@ 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);
--- a/src/lib-storage/mail-storage.c Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/mail-storage.c Thu Jun 04 20:13:40 2009 -0400 @@ -66,7 +66,8 @@ } } - 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 @@ 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 @@ 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) {
--- a/src/lib-storage/mail-storage.h Thu Jun 04 19:30:46 2009 -0400 +++ b/src/lib-storage/mail-storage.h Thu Jun 04 20:13:40 2009 -0400 @@ -390,6 +390,9 @@ 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. */