From: Richard Russon Date: Tue, 26 Feb 2019 23:33:59 +0000 (+0000) Subject: add typedef for ImapCmdFlags X-Git-Tag: 2019-10-25~347^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed827272e01a4b3452b26ff363e675910e62eb7e;p=neomutt add typedef for ImapCmdFlags --- diff --git a/imap/command.c b/imap/command.c index 980f52a31..3ea9e847f 100644 --- a/imap/command.c +++ b/imap/command.c @@ -119,13 +119,13 @@ static struct ImapCommand *cmd_new(struct ImapAccountData *adata) * cmd_queue - Add a IMAP command to the queue * @param adata Imap Account data * @param cmdstr Command string - * @param flags Server flags, e.g. #IMAP_CMD_POLL + * @param flags Server flags, see #ImapCmdFlags * @retval 0 Success * @retval <0 Failure, e.g. #IMAP_CMD_BAD * * If the queue is full, attempts to drain it. */ -static int cmd_queue(struct ImapAccountData *adata, const char *cmdstr, int flags) +static int cmd_queue(struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags) { if (cmd_queue_full(adata)) { @@ -183,11 +183,11 @@ static void cmd_handle_fatal(struct ImapAccountData *adata) * cmd_start - Start a new IMAP command * @param adata Imap Account data * @param cmdstr Command string - * @param flags Command flags, e.g. #IMAP_CMD_QUEUE + * @param flags Command flags, see #ImapCmdFlags * @retval 0 Success * @retval <0 Failure, e.g. #IMAP_CMD_BAD */ -static int cmd_start(struct ImapAccountData *adata, const char *cmdstr, int flags) +static int cmd_start(struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags) { int rc; @@ -1215,14 +1215,14 @@ const char *imap_cmd_trailer(struct ImapAccountData *adata) * imap_exec - Execute a command and wait for the response from the server * @param adata Imap Account data * @param cmdstr Command to execute - * @param flags Flags, e.g. #IMAP_CMD_PASS + * @param flags Flags, see #ImapCmdFlags * @retval #IMAP_EXEC_SUCCESS Command successful or queued * @retval #IMAP_EXEC_ERROR Command returned an error * @retval #IMAP_EXEC_FATAL Imap connection failure * * Also, handle untagged responses. */ -int imap_exec(struct ImapAccountData *adata, const char *cmdstr, int flags) +int imap_exec(struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags) { int rc; diff --git a/imap/imap_private.h b/imap/imap_private.h index 5ce49345b..7f1c08c74 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -69,7 +69,8 @@ typedef uint8_t ImapOpenFlags; ///< Flags, e.g. #MUTT_THREAD_COLLAPSE #define IMAP_NEWMAIL_PENDING (1 << 3) ///< New mail is waiting on the server #define IMAP_FLAGS_PENDING (1 << 4) ///< Flags have changed on the server -/* imap_exec flags (see imap_exec) */ +typedef uint8_t ImapCmdFlags; ///< Flags for imap_exec(), e.g. #IMAP_CMD_PASS +#define IMAP_CMD_NO_FLAGS 0 ///< No flags are set #define IMAP_CMD_PASS (1 << 0) ///< Command contains a password. Suppress logging #define IMAP_CMD_QUEUE (1 << 1) ///< Queue a command, do not execute #define IMAP_CMD_POLL (1 << 2) ///< Poll the tcp connection before running the imap command @@ -279,7 +280,7 @@ int imap_cmd_step(struct ImapAccountData *adata); void imap_cmd_finish(struct ImapAccountData *adata); bool imap_code(const char *s); const char *imap_cmd_trailer(struct ImapAccountData *adata); -int imap_exec(struct ImapAccountData *adata, const char *cmdstr, int flags); +int imap_exec(struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags); int imap_cmd_idle(struct ImapAccountData *adata); /* message.c */