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

##### Functions

    allh              X
    ctspan            X
    ctype             X
    fspan             X
    lspan             X
    min               X
    thish             X
    tohcol            X

       1: #ifndef lint
       2: static char sccsid[] = "@(#)tt.c	4.2 8/11/83";
       3: #endif
       4:
       5:  /* tt.c: subroutines for drawing horizontal lines */
       6: # include "t..c"
       7: ctype(il, ic)
       8: {
       9: if (instead[il])
      10:     return(0);
      11: if (fullbot[il])
      12:     return(0);
      13: il = stynum[il];
      14: return(style[il][ic]);
      15: }
      16: min(a,b)
      17: {
      18: return(a<b ? a : b);
      19: }
      20: fspan(i,c)
      21: {
      22: c++;
      23: return(c<ncol && ctype(i,c)=='s');
      24: }
      25: lspan(i,c)
      26: {
      27: int k;
      28: if (ctype(i,c) != 's') return(0);
      29: c++;
      30: if (c < ncol && ctype(i,c)== 's')
      31:     return(0);
      32: for(k=0; ctype(i,--c) == 's'; k++);
      33: return(k);
      34: }
      35: ctspan(i,c)
      36: {
      37: int k;
      38: c++;
      39: for(k=1; c<ncol && ctype(i,c)=='s'; k++)
      40:     c++;
      41: return(k);
      42: }
      43: tohcol(ic)
      44: {
      45:             if (ic==0)
      46:                 fprintf(tabout, "\\h'|0'");
      47:             else
      48:                 fprintf(tabout, "\\h'(|\\n(%du+|\\n(%du)/2u'", ic+CLEFT, ic+CRIGHT-1);
      49: }
      50: allh(i)
      51: {
      52: /* return true if every element in line i is horizontal */
      53: /* also at least one must be horizontl */
      54: int c, one, k;
      55: if (fullbot[i]) return(1);
      56: for(one=c=0; c<ncol; c++)
      57:     {
      58:     k = thish(i,c);
      59:     if (k==0) return(0);
      60:     if (k==1) continue;
      61:     one=1;
      62:     }
      63: return(one);
      64: }
      65: thish(i,c)
      66: {
      67:     int t;
      68:     char *s;
      69:     struct colstr *pc;
      70:     if (c<0)return(0);
      71:     if (i<0) return(0);
      72:     t = ctype(i,c);
      73:     if (t=='_' || t == '-')
      74:         return('-');
      75:     if (t=='=')return('=');
      76:     if (t=='^') return(1);
      77:     if (fullbot[i] )
      78:         return(fullbot[i]);
      79:     if (t=='s') return(thish(i,c-1));
      80:     if (t==0) return(1);
      81:     pc = &table[i][c];
      82:     s = (t=='a' ? pc->rcol : pc->col);
      83:     if (s==0 || (point(s) && *s==0))
      84:         return(1);
      85:     if (vspen(s)) return(1);
      86:     if (t=barent( s))
      87:         return(t);
      88:     return(0);
      89: }

#### Defined functions

allh defined in line 50; used 9 times

- in /usr/src/usr.bin/tbl/t8.c line 87, 229
- in /usr/src/usr.bin/tbl/ti.c line 26, 45-48(2)
- in /usr/src/usr.bin/tbl/tu.c line 56
- in /usr/src/usr.bin/tbl/tv.c line 23, 52, 68

ctspan defined in line 35; used 2 times

- in /usr/src/usr.bin/tbl/t8.c line 274
- in /usr/src/usr.bin/tbl/tg.c line 40

ctype defined in line 7; used 27 times

- in line 23-32(4), 39, 72
- in /usr/src/usr.bin/tbl/t5.c line 71, 83, 107, 118-121(2), 161
- in /usr/src/usr.bin/tbl/t6.c line 32
- in /usr/src/usr.bin/tbl/t7.c line 41
- in /usr/src/usr.bin/tbl/t8.c line 109, 121, 268
- in /usr/src/usr.bin/tbl/t9.c line 49, 59
- in /usr/src/usr.bin/tbl/tb.c line 16
- in /usr/src/usr.bin/tbl/tc.c line 21
- in /usr/src/usr.bin/tbl/tg.c line 42
- in /usr/src/usr.bin/tbl/tu.c line 16-18(2), 178-180(2)
- in /usr/src/usr.bin/tbl/tv.c line 127

fspan defined in line 20; used 2 times

- in /usr/src/usr.bin/tbl/t6.c line 30
- in /usr/src/usr.bin/tbl/t7.c line 39

lspan defined in line 25; used 2 times

- in /usr/src/usr.bin/tbl/t6.c line 94
- in /usr/src/usr.bin/tbl/t7.c line 55

min defined in line 16; used 1 times

- in /usr/src/usr.bin/tbl/t5.c line 55

thish defined in line 65; used 10 times

- in line 58, 79
- in /usr/src/usr.bin/tbl/ti.c line 44-49(4)
- in /usr/src/usr.bin/tbl/tu.c line 10-16(3), 181

tohcol defined in line 43; used 4 times

- in /usr/src/usr.bin/tbl/t7.c line 121
- in /usr/src/usr.bin/tbl/t8.c line 101, 312
- in /usr/src/usr.bin/tbl/tu.c line 67

#### 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: 1155 |