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

##### Functions

    alocv             X
    checkuse          X
    chspace           X
    real              X
    release           X

##### Variables

    spcount           X
    spvecs            X
    thisvec           X
    tpcount           X
    tpvecs            X

##### Macros

    MAXPC             X
    MAXVEC            X

       1: #ifndef lint
       2: static char sccsid[] = "@(#)tb.c	4.3 9/14/85";
       3: #endif
       4:
       5:  /* tb.c: check which entries exist, also storage allocation */
       6: # include "t..c"
       7: checkuse()
       8: {
       9: int i,c, k;
      10: for(c=0; c<ncol; c++)
      11:     {
      12:     used[c]=lused[c]=rused[c]=0;
      13:     for(i=0; i<nlin; i++)
      14:         {
      15:         if (instead[i] || fullbot[i]) continue;
      16:         k = ctype(i,c);
      17:         if (k== '-' || k == '=') continue;
      18:         if ((k=='n'||k=='a'))
      19:             {
      20:             rused[c]|= real(table[i][c].rcol);
      21:             if( !real(table[i][c].rcol))
      22:             used[c] |= real(table[i][c].col);
      23:             if (table[i][c].rcol)
      24:             lused[c] |= real(table[i][c].col);
      25:             }
      26:         else
      27:             used[c] |= real(table[i][c].col);
      28:         }
      29:     }
      30: }
      31: real(s)
      32:     char *s;
      33: {
      34: if (s==0) return(0);
      35: if (!point(s)) return(1);
      36: if (*s==0) return(0);
      37: return(1);
      38: }
      39: int spcount = 0;
      40: extern char * calloc();
      41: # define MAXVEC 20
      42: char *spvecs[MAXVEC];
      43:
      44: char *
      45: chspace()
      46: {
      47: char *pp;
      48: if (spvecs[spcount])
      49:     return(spvecs[spcount++]);
      50: if (spcount>=MAXVEC)
      51:     error("Too many characters in table");
      52: spvecs[spcount++]= pp = calloc(MAXCHS+200,1);
      53: if (pp== -1 || pp == 0)
      54:     error("no space for characters");
      55: return(pp);
      56: }
      57: # define MAXPC 50
      58: char *thisvec;
      59: int tpcount = -1;
      60: char *tpvecs[MAXPC];
      61:
      62: int *
      63: alocv(n)
      64: {
      65: int *tp, *q;
      66: if (tpcount<0 || thisvec+n > tpvecs[tpcount]+MAXCHS)
      67:     {
      68:     tpcount++;
      69:     if (tpvecs[tpcount]==0)
      70:         {
      71:         tpvecs[tpcount] = calloc(MAXCHS,1);
      72:         }
      73:     thisvec = tpvecs[tpcount];
      74:     if (thisvec == -1)
      75:         error("no space for vectors");
      76:     }
      77: tp=(int *)thisvec;
      78: thisvec+=n;
      79: for(q=tp; q<thisvec; q++)
      80:     *q=0;
      81: return(tp);
      82: }
      83: release()
      84: {
      85: extern char *exstore;
      86: /* give back unwanted space in some vectors */
      87: spcount=0;
      88: tpcount= -1;
      89: exstore=0;
      90: }

#### Defined functions

alocv defined in line 62; used 1 times

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

checkuse defined in line 7; used 1 times

- in /usr/src/usr.bin/tbl/t2.c line 17

chspace defined in line 44; used 4 times

- in /usr/src/usr.bin/tbl/t..c line 48
- in /usr/src/usr.bin/tbl/t5.c line 10, 95
- in /usr/src/usr.bin/tbl/tm.c line 42

real defined in line 31; used 10 times

- in line 20-27(5)
- in /usr/src/usr.bin/tbl/t6.c line 50, 57, 67, 97
- in /usr/src/usr.bin/tbl/t8.c line 159

release defined in line 83; used 1 times

- in /usr/src/usr.bin/tbl/t2.c line 21

#### Defined variables

sccsid defined in line 2; never used
spcount defined in line 39; used 5 times

- in line 48-52(4), 87

spvecs defined in line 42; used 3 times

- in line 48-52(3)

thisvec defined in line 58; used 6 times

- in line 66, 73-79(5)

tpcount defined in line 59; used 7 times

- in line 66-73(6), 88

tpvecs defined in line 60; used 4 times

- in line 66-73(4)

#### Defined macros

MAXPC defined in line 57; used 1 times

- in line 60

MAXVEC defined in line 41; used 2 times

- in line 42, 50

Last modified: 1993-01-18 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 987 |