dpost.ps: increase linewidth to match groff
[troff.git] / tbl / ts.c
blob43cc84ecdf85ab5021de973c4d5e28572364d073
1 /* ts.c: minor string processing subroutines */
2 #include "t.h"
4 int
5 match (char *s1, char *s2)
7 while (*s1 == *s2)
8 if (*s1++ == '\0')
9 return(1);
10 else
11 s2++;
12 return(0);
16 int
17 prefix(char *small, char *big)
19 int c;
21 while ((c = *small++) == *big++)
22 if (c == 0)
23 return(1);
24 return(c == 0);
28 int
29 letter (int ch)
31 if (ch >= 'a' && ch <= 'z')
32 return(1);
33 if (ch >= 'A' && ch <= 'Z')
34 return(1);
35 return(0);
39 int
40 numb(char *str)
42 /* convert to integer */
43 int k;
44 for (k = 0; *str >= '0' && *str <= '9'; str++)
45 k = k * 10 + *str - '0';
46 return(k);
50 int
51 digit(int x)
53 return(x >= '0' && x <= '9');
57 int
58 max(int a, int b)
60 return( a > b ? a : b);
64 void
65 tcopy (char *s, char *t)
67 while (*s++ = *t++)