** .pp
** Also see the $$move variable.
*/
- { "mbox_type", DT_MAGIC, &C_MboxType, MUTT_MBOX },
+ { "mbox_type", DT_ENUM, &C_MboxType, MUTT_MBOX, IP &MagicDef },
/*
** .pp
** The default mailbox type used when creating new folders. May be any of
/* These Config Variables are only used in mx.c */
unsigned char C_CatchupNewsgroup; ///< Config: (nntp) Mark all articles as read when leaving a newsgroup
bool C_KeepFlagged; ///< Config: Don't move flagged messages from #C_Spoolfile to #C_Mbox
-short C_MboxType; ///< Config: Default type for creating new mailboxes
+unsigned char C_MboxType; ///< Config: Default type for creating new mailboxes
unsigned char C_Move; ///< Config: Move emails from #C_Spoolfile to #C_Mbox when read
char *C_Trash; ///< Config: Folder to put deleted emails
+// clang-format off
+static struct Mapping MagicMap[] = {
+ { "mbox", MUTT_MBOX, },
+ { "MMDF", MUTT_MMDF, },
+ { "MH", MUTT_MH, },
+ { "Maildir", MUTT_MAILDIR, },
+ { NULL, 0, },
+};
+// clang-format on
+
+struct EnumDef MagicDef = {
+ "mbox_type",
+ 4,
+ (struct Mapping *) &MagicMap,
+};
+
/**
* mx_ops - All the Mailbox backends
*/
/* These Config Variables are only used in mx.c */
extern unsigned char C_CatchupNewsgroup;
extern bool C_KeepFlagged;
-extern short C_MboxType;
+extern unsigned char C_MboxType;
extern unsigned char C_Move;
extern char * C_Trash;
+struct EnumDef MagicDef;
+
/* flags for mutt_open_mailbox() */
typedef uint8_t OpenMailboxFlags; ///< Flags for mutt_open_mailbox(), e.g. #MUTT_NOSORT
#define MUTT_OPEN_NO_FLAGS 0 ///< No flags are set