]>
diplodocus.org Git - nmh/blob - docs/historical/mh-nov-1983/subs/crpbrkstring.c
4 * Parse the given string into a number of sub strings separated
5 * by characters in brksep. Terminate on brkterm or 0.
9 brkstring(strg
, brksep
, brkterm
)
11 char *brksep
, *brkterm
;
14 register char *cp
, **ap
;
15 static char *broken
[NSTR
+1];
20 if (ap
-broken
> NSTR
) {
24 while (brkany(*cp
, brksep
))
26 if (*cp
== 0 || *cp
== brkterm
) {
32 while (!brkany(*cp
, brksep
) && *cp
&& *cp
!= brkterm
)
34 if (*cp
== 0 || *cp
== brkterm
) {
42 brkany (chr
,strg
) /* returns 1 if chr in strg, 0 otherwise */
47 for (sp
=strg
; *sp
; sp
++)
48 if (chr
== *sp
) return (1);