#ifndef FTS_PARSER_H
#define FTS_PARSER_H
struct message_block;
struct mail_user;
struct fts_parser_context {
/* Can't be NULL */
/* Can't be NULL */
const char *content_type;
const char *content_disposition;
};
struct fts_parser_vfuncs {
void (*unload)(void);
};
struct fts_parser {
struct fts_parser_vfuncs v;
bool may_need_retry;
char *retriable_error_msg;
};
extern struct fts_parser_vfuncs fts_parser_html;
extern struct fts_parser_vfuncs fts_parser_script;
extern struct fts_parser_vfuncs fts_parser_tika;
struct fts_parser **parser_r);
struct fts_parser *fts_parser_text_init(void);
/* The parser is initially called with message body blocks. Once message is
finished, it's still called with incoming size=0 while the parser increases
it to non-zero. */
/* Returns 1 if ok, 0 if the parsing should be retried, -1 if error.
If 0 is returned, the retriable_err_msg_r is set, which should be logged
as error if no retrying is performed. */
void fts_parsers_unload(void);
#endif