]> granicus.if.org Git - neomutt/commitdiff
add typedef for ImapCmdFlags
authorRichard Russon <rich@flatcap.org>
Tue, 26 Feb 2019 23:33:59 +0000 (23:33 +0000)
committerRichard Russon <rich@flatcap.org>
Fri, 1 Mar 2019 13:09:43 +0000 (13:09 +0000)
imap/command.c
imap/imap_private.h

index 980f52a31a0214ca240a5844f8f9b387b16f4faa..3ea9e847f1eab7378c948578226fdd982d2d36cb 100644 (file)
@@ -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;
 
index 5ce49345b0ca806750111307766e59014518d0ba..7f1c08c743cef10459b3851c152ca24bd195e599 100644 (file)
@@ -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 */