static char sccsid
[] = "@(#)t5.c 4.3 %G%";
/* t5.c: read data for table */
cstore
=cspace
= chspace();
for (nlin
=nslin
=0; gets1(cstore
); nlin
++)
if (prefix(".TE", cstore
))
if (prefix(".TC", cstore
) || prefix(".T&", cstore
))
if (cstore
[0] == '.' && !isdigit(cstore
[1]))
table
[nlin
] = (struct colstr
*)alocv((ncol
+2)*sizeof(table
[0][0]));
case '_': fullbot
[nlin
]= '-'; continue;
case '=': fullbot
[nlin
]= '='; continue;
nslin
= min(nslin
+1, nclin
-1);
for (icol
= 0; icol
<ncol
; icol
++)
table
[nlin
][icol
].col
= cstore
;
table
[nlin
][icol
].rcol
=0;
if (match(cstore
, "T{")) /* text follows */
(char *)gettext(cstore
, nlin
, icol
,
font
[stynum
[nlin
]][icol
],
csize
[stynum
[nlin
]][icol
]);
for(; (ch
= *cstore
) != '\0' && ch
!= tab
; cstore
++)
switch(ctype(nlin
,icol
)) /* numerical or alpha, subcol */
(char *)maknew(table
[nlin
][icol
].col
);
table
[nlin
][icol
].rcol
= table
[nlin
][icol
].col
;
table
[nlin
][icol
].col
= "";
while (ctype(nlin
,icol
+1)== 's') /* spanning */
table
[nlin
][++icol
].col
= "";
table
[nlin
][icol
].col
= "";
table
[nlin
][icol
].rcol
=0;
if (cstore
-cspace
> MAXCHS
)
cstore
= cspace
= chspace();
case 'c': case 'n': case 'r': case 'l': case 's': case 'a':
for(icol
=1; icol
<ncol
; icol
++)
if (k
!= ctype(lin
,icol
))
for(jcol
=0; jcol
<ncol
; jcol
++)
for(irow
=1; irow
<nlin
; irow
++)
error("Vertical spanning in first row not allowed");
start
= table
[is
][jcol
].col
;
strig
= table
[is
][jcol
].rcol
;
while (irow
<nlin
&&vspand(irow
,jcol
,0))
table
[--irow
][jcol
].col
= start
;
table
[irow
][jcol
].rcol
= strig
;
table
[is
][jcol
].col
= SPAN
;
if (instead
[ir
]) return(0);
if (ifform
==0 && ctype(ir
,ij
)=='^') return(1);
if (table
[ir
][ij
].rcol
!=0) return(0);
if (fullbot
[ir
]) return(0);
return(vspen(table
[ir
][ij
].col
));
if (!point(s
)) return(0);