doveadm-mail.h revision 97afa073e3e1e0301dc41173ec34beb08edcce50
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen#ifndef DOVEADM_MAIL_H
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen#define DOVEADM_MAIL_H
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen
cfdaa223525f87c9c980a25cc7bb6770a248d76aTimo Sirainen#include "doveadm.h"
cfdaa223525f87c9c980a25cc7bb6770a248d76aTimo Sirainen
cfdaa223525f87c9c980a25cc7bb6770a248d76aTimo Sirainenstruct mail_user;
cfdaa223525f87c9c980a25cc7bb6770a248d76aTimo Sirainen
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainentypedef void doveadm_mail_command_t(struct mail_user *mail_user,
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen const char *const args[]);
3c9783956dea385b322cd7fa6bf8c98c17a907a0Timo Sirainen
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainenstruct doveadm_mail_cmd {
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen doveadm_mail_command_t *cmd;
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen const char *name;
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen const char *usage_args;
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen};
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo SirainenARRAY_DEFINE_TYPE(doveadm_mail_cmd, struct doveadm_mail_cmd);
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainenextern ARRAY_TYPE(doveadm_mail_cmd) doveadm_mail_cmds;
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen
e65cc79f80577e83c706f0678c78e2c0bd91434fTimo Sirainenbool doveadm_mail_try_run(const char *cmd_name, int argc, char *argv[]);
7d6389e4053c2dac1fb37180b5756b00785983dcTimo Sirainenvoid doveadm_mail_register_cmd(const struct doveadm_mail_cmd *cmd);
7d6389e4053c2dac1fb37180b5756b00785983dcTimo Sirainen
6ef7e31619edfaa17ed044b45861d106a86191efTimo Sirainenvoid doveadm_mail_usage(void);
f1ddb98e6b639394ae205b305be1ddcfab102578Timo Sirainenvoid doveadm_mail_help(const struct doveadm_mail_cmd *cmd) ATTR_NORETURN;
a399486f2d8d5bed51bc6344baba61a7f2b0dcdbTimo Sirainenvoid doveadm_mail_help_name(const char *cmd_name) ATTR_NORETURN;
40992309053d51192ae1b36d1dd6c057f2d37257Timo Sirainen
a399486f2d8d5bed51bc6344baba61a7f2b0dcdbTimo Sirainenvoid doveadm_mail_init(void);
a399486f2d8d5bed51bc6344baba61a7f2b0dcdbTimo Sirainenvoid doveadm_mail_deinit(void);
a399486f2d8d5bed51bc6344baba61a7f2b0dcdbTimo Sirainen
a399486f2d8d5bed51bc6344baba61a7f2b0dcdbTimo Sirainenstruct mailbox *
a399486f2d8d5bed51bc6344baba61a7f2b0dcdbTimo Sirainendoveadm_mailbox_find_and_sync(struct mail_user *user, const char *mailbox);
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainenstruct mail_search_args *
e82af44fe25ca9b88210f313548dc08538e4a677Timo Sirainendoveadm_mail_build_search_args(const char *const args[]);
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen
b567e0172c73dcf7642462e86962060358dd5f28Timo Sirainenvoid cmd_fetch(struct mail_user *user, const char *const args[]);
b567e0172c73dcf7642462e86962060358dd5f28Timo Sirainenvoid cmd_altmove(struct mail_user *user, const char *const args[]);
10c5fd417af4ee30b68c967f5e7d5a49f4f149b5Timo Sirainenvoid cmd_list(struct mail_user *user, const char *const args[]);
10c5fd417af4ee30b68c967f5e7d5a49f4f149b5Timo Sirainen
10c5fd417af4ee30b68c967f5e7d5a49f4f149b5Timo Sirainen#endif
10c5fd417af4ee30b68c967f5e7d5a49f4f149b5Timo Sirainen