index_transaction_set_max_modseq,
index_keywords_create,
index_keywords_free,
+ index_keyword_is_valid,
index_storage_get_seq_range,
index_storage_get_uid_range,
index_storage_get_expunged_uids,
index_transaction_set_max_modseq,
index_keywords_create,
index_keywords_free,
+ index_keyword_is_valid,
index_storage_get_seq_range,
index_storage_get_uid_range,
index_storage_get_expunged_uids,
mail_index_reset_error(ibox->index);
}
-int index_mailbox_keyword_is_valid(struct index_mailbox *ibox,
- const char *keyword, const char **error_r)
+bool index_keyword_is_valid(struct mailbox *box, const char *keyword,
+ const char **error_r)
{
+ struct index_mailbox *ibox = (struct index_mailbox *)box;
unsigned int i, idx;
/* if it already exists, skip validity checks */
t_array_init(&valid_keywords, 32);
for (; *keywords != NULL; keywords++) {
- if (index_mailbox_keyword_is_valid(ibox, *keywords, &error))
+ if (mailbox_keyword_is_valid(&ibox->box, *keywords, &error))
array_append(&valid_keywords, keywords, 1);
}
(void)array_append_space(&valid_keywords); /* NULL-terminate */
unsigned int i;
for (i = 0; keywords[i] != NULL; i++) {
- if (index_mailbox_keyword_is_valid(ibox, keywords[i], &error))
+ if (mailbox_keyword_is_valid(_box, keywords[i], &error))
continue;
if (!skip_invalid) {
int index_keywords_create(struct mailbox *box, const char *const keywords[],
struct mail_keywords **keywords_r, bool skip_invalid);
void index_keywords_free(struct mail_keywords *keywords);
+bool index_keyword_is_valid(struct mailbox *box, const char *keyword,
+ const char **error_r);
void index_mailbox_set_recent_uid(struct index_mailbox *ibox, uint32_t uid);
void index_mailbox_set_recent_seq(struct index_mailbox *ibox,
index_transaction_set_max_modseq,
index_keywords_create,
index_keywords_free,
+ index_keyword_is_valid,
index_storage_get_seq_range,
index_storage_get_uid_range,
index_storage_get_expunged_uids,
index_transaction_set_max_modseq,
index_keywords_create,
index_keywords_free,
+ index_keyword_is_valid,
index_storage_get_seq_range,
index_storage_get_uid_range,
index_storage_get_expunged_uids,
index_transaction_set_max_modseq,
index_keywords_create,
index_keywords_free,
+ index_keyword_is_valid,
index_storage_get_seq_range,
index_storage_get_uid_range,
index_storage_get_expunged_uids,
struct mail_keywords **keywords_r,
bool skip_invalid);
void (*keywords_free)(struct mail_keywords *keywords);
+ bool (*keyword_is_valid)(struct mailbox *box, const char *keyword,
+ const char **error_r);
void (*get_seq_range)(struct mailbox *box, uint32_t uid1, uint32_t uid2,
uint32_t *seq1_r, uint32_t *seq2_r);
box->v.keywords_free(keywords);
}
+bool mailbox_keyword_is_valid(struct mailbox *box, const char *keyword,
+ const char **error_r)
+{
+ return box->v.keyword_is_valid(box, keyword, error_r);
+}
+
void mailbox_get_seq_range(struct mailbox *box, uint32_t uid1, uint32_t uid2,
uint32_t *seq1_r, uint32_t *seq2_r)
{
const char *const keywords[]);
void mailbox_keywords_free(struct mailbox *box,
struct mail_keywords **keywords);
+/* Returns TRUE if keyword is valid, FALSE and error if not. */
+bool mailbox_keyword_is_valid(struct mailbox *box, const char *keyword,
+ const char **error_r);
/* Convert uid range to sequence range. */
void mailbox_get_seq_range(struct mailbox *box, uint32_t uid1, uint32_t uid2,