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

unix.superglobalmegacorp.com

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