mail-search-register.c revision 4fc52b7b25c3d3f42348903e0154840f8761f306
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainen/* Copyright (c) 2010 Dovecot authors, see the included COPYING file */
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainen ARRAY_DEFINE(args, struct mail_search_register_arg);
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainenstruct mail_search_register *mail_search_register_init(void)
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainenvoid mail_search_register_deinit(struct mail_search_register **_reg)
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainenvoid mail_search_register_add(struct mail_search_register *reg,
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainen unsigned int count)
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainenvoid mail_search_register_fallback(struct mail_search_register *reg,
4fc52b7b25c3d3f42348903e0154840f8761f306Timo Sirainenmail_search_register_arg_cmp(const struct mail_search_register_arg *arg1,
4fc52b7b25c3d3f42348903e0154840f8761f306Timo Sirainenmail_search_register_get(struct mail_search_register *reg,
4fc52b7b25c3d3f42348903e0154840f8761f306Timo Sirainen unsigned int *count_r)
4fc52b7b25c3d3f42348903e0154840f8761f306Timo Sirainen array_sort(®->args, mail_search_register_arg_cmp);
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainenmail_search_register_find(struct mail_search_register *reg, const char *key)
464bb87a4678ef3f37a15d14621e6b4a427b14d2Timo Sirainen array_sort(®->args, mail_search_register_arg_cmp);
20b2d47ed762ca2c009aa37e360af6f223ac71bdTimo Sirainen return array_bsearch(®->args, &arg, mail_search_register_arg_cmp);