allow comments in localgateways file
[unix-history] / usr / src / old / tbl / ts.c
CommitLineData
476fcd16
SL
1#ifndef lint
2static char sccsid[] = "@(#)ts.c 4.2 %G%";
3#endif
523161f1
BS
4
5 /* ts.c: minor string processing subroutines */
6match (s1, s2)
7 char *s1, *s2;
8{
9 while (*s1 == *s2)
10 if (*s1++ == '\0')
11 return(1);
12 else
13 s2++;
14 return(0);
15}
16prefix(small, big)
17 char *small, *big;
18{
19int c;
20while ((c= *small++) == *big++)
21 if (c==0) return(1);
22return(c==0);
23}
24letter (ch)
25 {
26 if (ch >= 'a' && ch <= 'z')
27 return(1);
28 if (ch >= 'A' && ch <= 'Z')
29 return(1);
30 return(0);
31 }
32numb(str)
33 char *str;
34 {
35 /* convert to integer */
36 int k;
37 for (k=0; *str >= '0' && *str <= '9'; str++)
38 k = k*10 + *str - '0';
39 return(k);
40 }
41digit(x)
42 {
43 return(x>= '0' && x<= '9');
44 }
45max(a,b)
46{
47return( a>b ? a : b);
48}
49tcopy (s,t)
50 char *s, *t;
51{
52 while (*s++ = *t++);
53}