]> diplodocus.org Git - nmh/blob - docs/historical/SRI-NOSC/subs.dir/printsw.c
Remove the #ifdef UK for the default scan format
[nmh] / docs / historical / SRI-NOSC / subs.dir / printsw.c
1 #include "mh.h"
2
3 printsw(substr, swp)
4 char *substr;
5 struct swit *swp;
6 {
7 char buf[128];
8 register char *cp, *cp1;
9 register int i;
10 int len;
11
12 len = length(substr);
13 for(; swp->sw; swp++)
14 if(!*substr || /* null matches all strings */
15 (ssequal(substr, swp->sw) && len >= swp->minchars))
16 if(swp->minchars > 0) {
17 cp = buf;
18 *cp++ = '(';
19 for(cp1 = swp->sw, i = 0; i < swp->minchars; i++)
20 *cp++ = *cp1++;
21 *cp++ = ')';
22 while(*cp++ = *cp1++);
23 printf(" -%s\n", buf);
24 } else if(swp->minchars == 0)
25 printf(" -%s\n", swp->sw);
26 }