HEX
Server: Apache/2
System: Linux jingle.dotvndns.vn 2.6.32-754.17.1.el6.x86_64 #1 SMP Tue Jul 2 12:42:48 UTC 2019 x86_64
User: chuahuehuong (1863)
PHP: 7.3.16
Disabled: apache_note,apache_setenv,proc_get_status,exec,passthru,proc_nice,proc_terminate,shell_exec,system,ini_restore,syslog,define_syslog_variables,symlink,link,error_log,leak,dbmopen,closelog,stream_socket_server,execl,escapeshellcmd,ini_alter,dl,show_source,posix_getpwuid,posix_geteuid,posix_getegid,posix_getgrgid,open_basedir,safe_mode_include_dir,pcntl_exec,pcntl_fork,pclose,virtual,openlog,popen,escapeshellarg,eval,calo,posix_getpwuid,symlinks,symlink,getpwuid,mail
Upload Files
File: //usr/include/dovecot/fts-parser.h
#ifndef FTS_PARSER_H
#define FTS_PARSER_H

struct message_block;
struct mail_user;

struct fts_parser_context {
	/* Can't be NULL */
	struct mail_user *user;
	/* Can't be NULL */
	const char *content_type;
	const char *content_disposition;
};

struct fts_parser_vfuncs {
	struct fts_parser *(*try_init)(struct fts_parser_context *parser_context);
	void (*more)(struct fts_parser *parser, struct message_block *block);
	int (*deinit)(struct fts_parser *parser, const char **retriable_err_msg_r);
	void (*unload)(void);
};

struct fts_parser {
	struct fts_parser_vfuncs v;
	buffer_t *utf8_output;
	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;

bool fts_parser_init(struct fts_parser_context *parser_context,
		     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. */
void fts_parser_more(struct fts_parser *parser, struct message_block *block);
/* 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. */
int fts_parser_deinit(struct fts_parser **parser, const char **retriable_err_msg_r);

void fts_parsers_unload(void);

#endif