-#ifndef APOP
-# define APOPminc(a) (a)
-#else
-# define APOPminc(a) 0
-#endif
-
-#ifndef KPOP
-# define KPOPminc(a) (a)
-#else
-# define KPOPminc(a) 0
-#endif
-
-static struct swit switches[] = {
-#define DATESW 0
- { "date", 0 },
-#define NDATESW 1
- { "nodate", 0 },
-#define NOTESW 2
- { "notify type", 0 },
-#define NNOTESW 3
- { "nonotify type", 0 },
-#define HOSTSW 4
- { "host hostname", POPminc (-4) },
-#define USERSW 5
- { "user username", POPminc (-4) },
-#define APOPSW 6
- { "apop", APOPminc (-4) },
-#define NAPOPSW 7
- { "noapop", APOPminc (-6) },
-#define RPOPSW 8
- { "rpop", RPOPminc (-4) },
-#define NRPOPSW 9
- { "norpop", RPOPminc (-6) },
-#define VERSIONSW 10
- { "version", 0 },
-#define HELPSW 11
- { "help", 0 },
-#define SNOOPSW 12
- { "snoop", -5 },
-#define KPOPSW 13
- { "kpop", KPOPminc (-4) },
- { NULL, 0 }
-};
+#define MSGCHK_SWITCHES \
+ X("date", 0, DATESW) \
+ X("nodate", 0, NDATESW) \
+ X("notify type", 0, NOTESW) \
+ X("nonotify type", 0, NNOTESW) \
+ X("host hostname", 0, HOSTSW) \
+ X("user username", 0, USERSW) \
+ X("port name/number", 0, PORTSW) \
+ X("version", 0, VERSIONSW) \
+ X("help", 0, HELPSW) \
+ X("snoop", -5, SNOOPSW) \
+ X("sasl", SASLminc(-4), SASLSW) \
+ X("saslmech", SASLminc(-5), SASLMECHSW) \
+ X("proxy command", 0, PROXYSW) \
+
+#define X(sw, minchars, id) id,
+DEFINE_SWITCH_ENUM(MSGCHK);
+#undef X
+
+#define X(sw, minchars, id) { sw, minchars, id },
+DEFINE_SWITCH_ARRAY(MSGCHK, switches);
+#undef X