fixed problem with stab type for initialized static variables,
[unix-history] / usr / src / old / tbl / t9.c
CommitLineData
d883bd6f
BS
1/* t9.c 4.1 83/02/12 */
2
3 /* t9.c: write lines for tables over 200 lines */
4# include "t..c"
5static useln;
6yetmore()
7{
8for(useln=0; useln<MAXLIN && table[useln]==0; useln++);
9if (useln>=MAXLIN)
10 error("Wierd. No data in table.");
11table[0]=table[useln];
12for(useln=nlin-1; useln>=0 && (fullbot[useln] || instead[useln]); useln--);
13if (useln<0)
14 error("Wierd. No real lines in table.");
15domore(leftover);
16while (gets1(cstore=cspace) && domore(cstore))
17 ;
18last =cstore;
19return;
20}
21domore(dataln)
22 char *dataln;
23{
24 int icol, ch;
25if (prefix(".TE", dataln))
26 return(0);
27if (dataln[0] == '.' && !isdigit(dataln[1]))
28 {
29 puts(dataln);
30 return(1);
31 }
32instead[0]=fullbot[0]=0;
33if (dataln[1]==0)
34switch(dataln[0])
35 {
36 case '_': fullbot[0]= '-'; putline(useln,0); return(1);
37 case '=': fullbot[0]= '='; putline(useln, 0); return(1);
38 }
39for (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 }
60while (++icol <ncol)
61 table[0][icol].col = "";
62putline(useln,0);
63return(1);
64}