# 2.11BSD#431 - /usr/src/usr.bin/tbl/ts.c

##### Functions

    digit             X
    letter            X
    match             X
    max               X
    numb              X
    prefix            X
    tcopy             X

       1: #ifndef lint
       2: static char sccsid[] = "@(#)ts.c	4.2 8/11/83";
       3: #endif
       4:
       5:  /* ts.c: minor string processing subroutines */
       6: match (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: }
      16: prefix(small, big)
      17:     char *small, *big;
      18: {
      19: int c;
      20: while ((c= *small++) == *big++)
      21:     if (c==0) return(1);
      22: return(c==0);
      23: }
      24: letter (ch)
      25:     {
      26:     if (ch >= 'a' && ch <= 'z')
      27:         return(1);
      28:     if (ch >= 'A' && ch <= 'Z')
      29:         return(1);
      30:     return(0);
      31:     }
      32: numb(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:     }
      41: digit(x)
      42:     {
      43:     return(x>= '0' && x<= '9');
      44:     }
      45: max(a,b)
      46: {
      47: return( a>b ? a : b);
      48: }
      49: tcopy (s,t)
      50:     char *s, *t;
      51: {
      52:     while (*s++ = *t++);
      53: }

#### Defined functions

digit defined in line 41; used 6 times

- in /usr/src/usr.bin/tbl/t4.c line 154, 177, 225
- in /usr/src/usr.bin/tbl/tm.c line 23-24(2), 30

letter defined in line 24; used 2 times

- in /usr/src/usr.bin/tbl/t3.c line 48, 56

match defined in line 6; used 6 times

- in /usr/src/usr.bin/tbl/t1.c line 73-83(3)
- in /usr/src/usr.bin/tbl/t5.c line 61, 171
- in /usr/src/usr.bin/tbl/tg.c line 48

max defined in line 45; used 2 times

- in /usr/src/usr.bin/tbl/t4.c line 52, 228

numb defined in line 32; used 1 times

- in /usr/src/usr.bin/tbl/t4.c line 228

prefix defined in line 16; used 6 times

- in /usr/src/usr.bin/tbl/t1.c line 51
- in /usr/src/usr.bin/tbl/t3.c line 52
- in /usr/src/usr.bin/tbl/t5.c line 15-20(3)
- in /usr/src/usr.bin/tbl/t9.c line 27

tcopy defined in line 49; used 1 times

- in /usr/src/usr.bin/tbl/tg.c line 61

#### Defined variables

sccsid defined in line 2; never used

Last modified: 1987-02-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 811 |