]>
diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/sbr/smatch.c
1 /* smatch.c - match a switch */
3 static char ident
[] = "@(#)$Id: smatch.c,v 1.5 1992/12/15 00:20:22 jromine Exp $";
9 #define abs(i) (i < 0 ? -i : i)
13 register char *string
;
14 register struct swit
*swp
;
27 for (stringlen
= strlen (string
), tp
= swp
; tcp
= tp
-> sw
; tp
++) {
28 if (stringlen
< abs (tp
-> minchars
))
29 continue; /* no match */
30 for (sp
= string
; *sp
== *tcp
++;) {
32 return (tp
- swp
);/* exact match */
36 continue; /* no match */
38 return (tp
- swp
);/* exact match */
40 if (firstone
== UNKWNSW
)