1 #ifndef lint
2 static char sccsid[] = "@(#)over200.c	1.2 (CWI) 85/10/02";
3 #endif lint
4 
5  /*
6   * write lines for tables over 200 lines (actually MAXLIN lines)
7   *
8   * Note that there is aserious bug here:
9   *	The T{ ... T} doesn't work after MAXLIN entries.
10   */
11 #include "defs.h"
12 #include "ext.h"
13 
14 static int useln;
15 
16 extern char *maknew();
17 
yetmore()18 yetmore()
19 {
20 	dprint(".\\\" -- yetmore\n");
21 	for(useln = 0; useln < MAXLIN && table[useln] == 0; useln++)
22 		;
23 	if(useln >= MAXLIN)
24 		error("Wierd.  No data in table.");
25 	table[0] = table[useln];
26 	for(useln = nlin - 1; useln >= 0 && (fullbot[useln] || instead[useln]);
27 								useln--)
28 		;
29 	if(useln < 0)
30 		error("Wierd.  No real lines in table.");
31 	domore(leftover);
32 	while(gets1(cstore = cspace) && domore(cstore))
33 		;
34 	last = cstore;
35 	return;
36 }
37 
domore(dataln)38 domore(dataln)
39 char *dataln;
40 {
41 	register int icol, ch;
42 
43 	dprint(".\\\" -- domore\n");
44 
45 	if(prefix(".TE", dataln))
46 		return(0);
47 	if(dataln[0] == '.' && !isdigit(dataln[1])){
48 		puts(dataln);
49 		return(1);
50 	}
51 	instead[0] = (char *) 0;
52 	fullbot[0] = 0;
53 	if(dataln[1] == 0){
54 		switch(dataln[0]){
55 
56 		case '_':
57 			fullbot[0] = '-';
58 			putline(useln, 0);
59 			return(1);
60 		case '=':
61 			fullbot[0] = '=';
62 			putline(useln, 0);
63 			return(1);
64 		}
65 	}
66 	for(icol = 0; icol < ncol; icol++){
67 		table[0][icol].col = dataln;
68 		table[0][icol].rcol = 0;
69 		for(; (ch = *dataln) != '\0' && ch != tab; dataln++)
70 			;
71 		*dataln++ = '\0';
72 		switch(ctype(useln, icol)){
73 
74 		case 'n':
75 			table[0][icol].rcol = maknew(table[0][icol].col);
76 			break;
77 		case 'a':
78 			table[0][icol].rcol = table[0][icol].col;
79 			table[0][icol].col = "";
80 			break;
81 		}
82 		while(ctype(useln, icol + 1) == 's'){
83 			/*
84 			 * spanning
85 			 */
86 			table[0][++icol].col = "";
87 		}
88 		if(ch == '\0')
89 			break;
90 	}
91 	while(++icol < ncol)
92 		table[0][icol].col = "";
93 	putline(useln, 0);
94 	/*
95 	 * Reuse space for numerical items (bwk)
96 	 * exstore = exspace;
97 	 */
98 	return(1);
99 }
100