|
|
1.1 ! root 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=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: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.