doveadm-mail.h revision a9efdb661eb7a8a33aacfdcc3486dcc675a21543
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen#ifndef DOVEADM_MAIL_H
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen#define DOVEADM_MAIL_H
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenstruct mail_user;
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainentypedef void doveadm_mail_command_t(struct mail_user *mail_user,
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen const char *args[]);
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenstruct doveadm_mail_cmd {
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen doveadm_mail_command_t *cmd;
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen const char *name;
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen const char *usage_args;
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen};
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo SirainenARRAY_DEFINE_TYPE(doveadm_mail_cmd, struct doveadm_mail_cmd);
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenextern ARRAY_TYPE(doveadm_mail_cmd) doveadm_mail_cmds;
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenbool doveadm_mail_try_run(const char *cmd_name, int argc, char *argv[]);
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenvoid doveadm_mail_register_cmd(const struct doveadm_mail_cmd *cmd);
0f9a8663b0ff6fe30389d02284a2b002c40914ebTimo Sirainen
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenvoid doveadm_mail_usage(void);
a9efdb661eb7a8a33aacfdcc3486dcc675a21543Timo Sirainenvoid doveadm_mail_help(const struct doveadm_mail_cmd *cmd) ATTR_NORETURN;
a9efdb661eb7a8a33aacfdcc3486dcc675a21543Timo Sirainenvoid doveadm_mail_help_name(const char *cmd_name) ATTR_NORETURN;
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenvoid doveadm_mail_init(void);
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenvoid doveadm_mail_deinit(void);
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen#endif