Annotation of 40BSD/cmd/tbl/t9.c, revision 1.1.1.1

1.1       root        1:  /* t9.c: write lines for tables over 200 lines */
                      2: # include "t..c"
                      3: static useln;
                      4: yetmore()
                      5: {
                      6: for(useln=0; useln<MAXLIN && table[useln]==0; useln++);
                      7: if (useln>=MAXLIN)
                      8:        error("Wierd.  No data in table.");
                      9: table[0]=table[useln];
                     10: for(useln=nlin-1; useln>=0 && (fullbot[useln] || instead[useln]); useln--);
                     11: if (useln<0)
                     12:        error("Wierd.  No real lines in table.");
                     13: domore(leftover);
                     14: while (gets1(cstore=cspace) && domore(cstore))
                     15:        ;
                     16: last =cstore;
                     17: return;
                     18: }
                     19: domore(dataln)
                     20:        char *dataln;
                     21: {
                     22:        int icol, ch;
                     23: if (prefix(".TE", dataln))
                     24:        return(0);
                     25: if (dataln[0] == '.' && !isdigit(dataln[1]))
                     26:        {
                     27:        puts(dataln);
                     28:        return(1);
                     29:        }
                     30: instead[0]=fullbot[0]=0;
                     31: if (dataln[1]==0)
                     32: switch(dataln[0])
                     33:        {
                     34:        case '_': fullbot[0]= '-'; putline(useln,0);  return(1);
                     35:        case '=': fullbot[0]= '='; putline(useln, 0); return(1);
                     36:        }
                     37: for (icol = 0; icol <ncol; icol++)
                     38:        {
                     39:        table[0][icol].col = dataln;
                     40:        table[0][icol].rcol=0;
                     41:        for(; (ch= *dataln) != '\0' && ch != tab; dataln++)
                     42:                        ;
                     43:        *dataln++ = '\0';
                     44:        switch(ctype(useln,icol))
                     45:                {
                     46:                case 'n':
                     47:                        table[0][icol].rcol = maknew(table[0][icol].col);
                     48:                        break;
                     49:                case 'a':
                     50:                        table[0][icol].rcol = table[0][icol].col;
                     51:                        table[0][icol].col= "";
                     52:                        break;
                     53:                }
                     54:        while (ctype(useln,icol+1)== 's') /* spanning */
                     55:                table[0][++icol].col = "";
                     56:        if (ch == '\0') break;
                     57:        }
                     58: while (++icol <ncol)
                     59:        table[0][icol].col = "";
                     60: putline(useln,0);
                     61: return(1);
                     62: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.