X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5dd6771b28c257af405d7248639ed0e3bcdce38b..2f3e60ab51648c4e0cf0e686600428cd5f56aa66:/uip/rcvstore.c diff --git a/uip/rcvstore.c b/uip/rcvstore.c index 3131076f..3afe12e3 100644 --- a/uip/rcvstore.c +++ b/uip/rcvstore.c @@ -14,31 +14,26 @@ #include #include -static struct swit switches[] = { -#define CRETSW 0 - { "create", 0 }, -#define NCRETSW 1 - { "nocreate", 0 }, -#define UNSEENSW 2 - { "unseen", 0 }, -#define NUNSEENSW 3 - { "nounseen", 0 }, -#define PUBSW 4 - { "public", 0 }, -#define NPUBSW 5 - { "nopublic", 0 }, -#define ZEROSW 6 - { "zero", 0 }, -#define NZEROSW 7 - { "nozero", 0 }, -#define SEQSW 8 - { "sequence name", 0 }, -#define VERSIONSW 9 - { "version", 0 }, -#define HELPSW 10 - { "help", 0 }, - { NULL, 0 } -}; +#define RCVSTORE_SWITCHES \ + X("create", 0, CRETSW) \ + X("nocreate", 0, NCRETSW) \ + X("unseen", 0, UNSEENSW) \ + X("nounseen", 0, NUNSEENSW) \ + X("public", 0, PUBSW) \ + X("nopublic", 0, NPUBSW) \ + X("zero", 0, ZEROSW) \ + X("nozero", 0, NZEROSW) \ + X("sequence name", 0, SEQSW) \ + X("version", 0, VERSIONSW) \ + X("help", 0, HELPSW) \ + +#define X(sw, minchars, id) id, +DEFINE_SWITCH_ENUM(RCVSTORE); +#undef X + +#define X(sw, minchars, id) { sw, minchars, id }, +DEFINE_SWITCH_ARRAY(RCVSTORE, switches); +#undef X /* @@ -53,7 +48,8 @@ main (int argc, char **argv) { int publicsw = -1, zerosw = 0; int create = 1, unseensw = 1; - int fd, msgnum, seqp = 0; + int fd, msgnum; + size_t seqp = 0; char *cp, *maildir, *folder = NULL, buf[BUFSIZ]; char **argp, **arguments, *seqs[NUMATTRS+1]; struct msgs *mp; @@ -87,10 +83,10 @@ main (int argc, char **argv) snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name); print_help (buf, switches, 1); - done (1); + done (0); case VERSIONSW: print_version(invo_name); - done (1); + done (0); case SEQSW: if (!(cp = *argp++) || *cp == '-')