#ifndef MAIL_SEARCH_BUILD_H
#define MAIL_SEARCH_BUILD_H
#include "mail-search.h"
#include "mail-search-register.h"
struct mailbox;
struct mail_search_build_context {
const char *charset;
/* error is either here or in parser */
const char *_error;
bool charset_checked;
bool unknown_charset;
};
/* Start building a new search query. Use mail_search_args_unref() to
free it. */
struct mail_search_args *mail_search_build_init(void);
/* Convert IMAP SEARCH command compatible parameters to mail_search_args.
If charset is unknown, it's changed to NULL. */
/* Add new search arg with given type. */
struct mail_search_arg *
enum mail_search_arg_type type);
/* Add SEARCH_ALL to search args. */
/* Add a sequence set to search args. */
/* Convert input string into UTF-8 */
struct mail_search_arg *
enum mail_search_arg_type type);
struct mail_search_arg *
enum mail_search_arg_type type);
/* Returns 0 if arg is returned, -1 if error. */
struct mail_search_arg *parent,
struct mail_search_arg **arg_r);
#endif