Bell 32V development
[unix-history] / usr / src / cmd / tbl / ts.c
CommitLineData
6554f91c
TL
1 /* ts.c: minor string processing subroutines */
2match (s1, s2)
3 char *s1, *s2;
4{
5 while (*s1 == *s2)
6 if (*s1++ == '\0')
7 return(1);
8 else
9 s2++;
10 return(0);
11}
12prefix(small, big)
13 char *small, *big;
14{
15int c;
16while ((c= *small++) == *big++)
17 if (c==0) return(1);
18return(c==0);
19}
20letter (ch)
21 {
22 if (ch >= 'a' && ch <= 'z')
23 return(1);
24 if (ch >= 'A' && ch <= 'Z')
25 return(1);
26 return(0);
27 }
28numb(str)
29 char *str;
30 {
31 /* convert to integer */
32 int k;
33 for (k=0; *str >= '0' && *str <= '9'; str++)
34 k = k*10 + *str - '0';
35 return(k);
36 }
37digit(x)
38 {
39 return(x>= '0' && x<= '9');
40 }
41max(a,b)
42{
43return( a>b ? a : b);
44}
45tcopy (s,t)
46 char *s, *t;
47{
48 while (*s++ = *t++);
49}