43f4e550efe7afa72aab3a7ded7ad7ce606526fbSergey Kitov /* Can't be NULL */
43f4e550efe7afa72aab3a7ded7ad7ce606526fbSergey Kitov /* Can't be NULL */
43f4e550efe7afa72aab3a7ded7ad7ce606526fbSergey Kitov struct fts_parser *(*try_init)(struct fts_parser_context *parser_context);
772120713c176bde8c932b3fb4c413d223741fcdTimo Sirainen void (*more)(struct fts_parser *parser, struct message_block *block);
72d301f5751986396533088b769a9e74735a467cSergey Kitov int (*deinit)(struct fts_parser *parser, const char **retriable_err_msg_r);
ecc5a1a440799a0966c26da956f5d6e2d8073e03Timo Sirainenextern struct fts_parser_vfuncs fts_parser_html;
ecc5a1a440799a0966c26da956f5d6e2d8073e03Timo Sirainenextern struct fts_parser_vfuncs fts_parser_script;
ce87b647a0418ec4a6f4e860a9c918b2331ab353Timo Sirainenextern struct fts_parser_vfuncs fts_parser_tika;
43f4e550efe7afa72aab3a7ded7ad7ce606526fbSergey Kitovbool fts_parser_init(struct fts_parser_context *parser_context,
ecc5a1a440799a0966c26da956f5d6e2d8073e03Timo Sirainen/* The parser is initially called with message body blocks. Once message is
ecc5a1a440799a0966c26da956f5d6e2d8073e03Timo Sirainen finished, it's still called with incoming size=0 while the parser increases
ecc5a1a440799a0966c26da956f5d6e2d8073e03Timo Sirainen it to non-zero. */
772120713c176bde8c932b3fb4c413d223741fcdTimo Sirainenvoid fts_parser_more(struct fts_parser *parser, struct message_block *block);
8c93c82c97d7c125838344df7fdcb9df1b77f9a3Timo Sirainen/* Returns 1 if ok, 0 if the parsing should be retried, -1 if error.
8c93c82c97d7c125838344df7fdcb9df1b77f9a3Timo Sirainen If 0 is returned, the retriable_err_msg_r is set, which should be logged
8c93c82c97d7c125838344df7fdcb9df1b77f9a3Timo Sirainen as error if no retrying is performed. */
72d301f5751986396533088b769a9e74735a467cSergey Kitovint fts_parser_deinit(struct fts_parser **parser, const char **retriable_err_msg_r);