5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen/* Build a parser parsing the given imap args. NOTE: args must not be freed
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen until this parser is destroyed. */
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainenmail_search_parser_init_imap(const struct imap_arg *args);
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen/* Build a parser parsing the given command line args. */
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainenmail_search_parser_init_cmdline(const char *const args[]);
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainenvoid mail_search_parser_deinit(struct mail_search_parser **parser);
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen/* Key is set to the next search key, or MAIL_SEARCH_PARSER_KEY_LIST for
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen beginning of a list. Returns 1 if ok, 0 if no more keys in this
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen list/query, -1 if parsing error. */
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainenint mail_search_parse_key(struct mail_search_parser *parser,
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen const char **key_r);
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen/* Get the next string. Returns 0 if ok, -1 if parsing error. */
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainenint mail_search_parse_string(struct mail_search_parser *parser,
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen const char **value_r);
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen/* If next parameter equals to the given string case-insensitively, skip over
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen it and return TRUE. Otherwise do nothing and return FALSE. */
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainenbool mail_search_parse_skip_next(struct mail_search_parser *parser,
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen const char *str);
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen/* Returns the reason string for parsing error. */