| 1 | /* t9.c 4.1 83/02/12 */ |
| 2 | |
| 3 | /* t9.c: write lines for tables over 200 lines */ |
| 4 | # include "t..c" |
| 5 | static useln; |
| 6 | yetmore() |
| 7 | { |
| 8 | for(useln=0; useln<MAXLIN && table[useln]==0; useln++); |
| 9 | if (useln>=MAXLIN) |
| 10 | error("Wierd. No data in table."); |
| 11 | table[0]=table[useln]; |
| 12 | for(useln=nlin-1; useln>=0 && (fullbot[useln] || instead[useln]); useln--); |
| 13 | if (useln<0) |
| 14 | error("Wierd. No real lines in table."); |
| 15 | domore(leftover); |
| 16 | while (gets1(cstore=cspace) && domore(cstore)) |
| 17 | ; |
| 18 | last =cstore; |
| 19 | return; |
| 20 | } |
| 21 | domore(dataln) |
| 22 | char *dataln; |
| 23 | { |
| 24 | int icol, ch; |
| 25 | if (prefix(".TE", dataln)) |
| 26 | return(0); |
| 27 | if (dataln[0] == '.' && !isdigit(dataln[1])) |
| 28 | { |
| 29 | puts(dataln); |
| 30 | return(1); |
| 31 | } |
| 32 | instead[0]=fullbot[0]=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 | return(1); |
| 64 | } |