X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a3587d0ba6ff6fe2649df6aeee9841d527fec91f..c09f9e4a7f10d1272300da16cbdfbd3e98afb517:/uip/rcvdist.c diff --git a/uip/rcvdist.c b/uip/rcvdist.c index 702dc9aa..8f88639a 100644 --- a/uip/rcvdist.c +++ b/uip/rcvdist.c @@ -14,15 +14,18 @@ #include #include -static struct swit switches[] = { -#define FORMSW 0 - { "form formfile", 4 }, -#define VERSIONSW 1 - { "version", 0 }, -#define HELPSW 2 - { "help", 0 }, - { NULL, 0 } -}; +#define RCVDIST_SWITCHES \ + X("form formfile", 4, FORMSW) \ + X("version", 0, VERSIONSW) \ + X("help", 0, HELPSW) \ + +#define X(sw, minchars, id) id, +DEFINE_SWITCH_ENUM(RCVDIST); +#undef X + +#define X(sw, minchars, id) { sw, minchars, id }, +DEFINE_SWITCH_ARRAY(RCVDIST, switches); +#undef X static char backup[BUFSIZ] = ""; static char drft[BUFSIZ] = ""; @@ -171,7 +174,7 @@ rcvdistout (FILE *inb, char *form, char *addrs) register int char_read = 0, format_len, i, state; register char **ap; char *cp, *scanl, name[NAMESZ], tmpbuf[SBUFSIZ]; - register struct comp *cptr, **savecomp; + register struct comp *cptr; FILE *out; if (!(out = fopen (drft, "w"))) @@ -196,7 +199,7 @@ rcvdistout (FILE *inb, char *form, char *addrs) switch (state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb)) { case FLD: case FLDPLUS: - i = fmt_addcomp(name, tmpbuf); + i = fmt_addcomptext(name, tmpbuf); if (i != -1) { char_read += msg_count; while (state == FLDPLUS) {