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