static char sccsid
[] = "@(#)t4.c 4.2 %G%";
/* t4.c: read table specification */
for(icol
=0; icol
<MAXCOL
; icol
++)
font
[i
][icol
][0] = lefline
[i
][icol
] = 0;
fprintf(tabout
, " %02d", 80+i
);
int icol
, c
, sawchar
, stopc
, i
;
char sn
[10], *snp
, *temp
;
error("bad table specification character");
case ' ': /* note this is also case tab */
case '.': /* end of table specification */
if (lefline
[nclin
][ncol
]>0) {ncol
++; rightl
++;};
error("too many lines in specification");
error("no specification");
while ((c
=get1char()) && c
!= '\n')
if (c
!= ' ' && c
!= '\t')
error("dot not last character on format line");
/* fix up sep - default is 3 except at edge */
for(icol
=0; icol
<ncol
; icol
++)
sep
[icol
] = icol
+1<ncol
? 3 : 1;
error("tried to widen table in T&, not allowed");
case 'C': case 'S': case 'R': case 'N': case 'L': case 'A':
case '_': if (c
=='_') c
= '-';
case 'c': case 's': case 'n': case 'r': case 'l': case 'a':
error("first column can not be S-type");
if (c
=='s' && style
[nclin
][icol
-1] == 'a')
fprintf(tabout
, ".tm warning: can't span a-type cols, changed to l\n");
style
[nclin
][icol
-1] = 'l';
if (c
=='s' && style
[nclin
][icol
-1] == 'n')
fprintf(tabout
, ".tm warning: can't span n-type cols, changed to c\n");
style
[nclin
][icol
-1] = 'c';
error("first row can not contain vertical span");
error("too many columns in table");
snp
[0]= (c
=='I' ? '2' : '3');
ctop
[nclin
][icol
-1] = -1;
if (c
==stopc
) {stopc
=0; break;}
if (stopc
==0) if (c
==' ' || c
== tab
) break;
if (c
=='\n'){un1getc(c
); break;}
if (c
>= '0' && c
<= '9') break;
if (stopc
) if (get1char()!=stopc
)
error("Nonterminated font name");
temp
= snp
= csize
[nclin
][icol
-1];
if (c
== ' ' || c
== tab
|| c
=='\n') break;
error("point size too large");
error("point size unreasonable");
temp
= snp
= vsize
[nclin
][icol
-1];
if (c
== ' ' || c
== tab
|| c
=='\n') break;
error("vertical spacing value too large");
/* Dale Smith didn't like this check - possible to have two text blocks
of different widths now ....
fprintf(tabout, "Ignored second width specification");
/* end commented out code ... */
if (snp
==cll
[icol
-1] && c
=='(')
if ( !stopc
&& (c
>'9' || c
< '0'))
if (snp
-cll
[icol
-1]>CLLEN
)
error ("column width too long");
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
while (digit(*snp
++ = c
= get1char()))
sep
[icol
-1] = max(sep
[icol
-1], numb(sn
));
error("EOF reading table specification");