/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* t4.c: read table specification */
# include "t..c"
int oncol;
void readspec(void);
void
getspec(void)
{
int icol, i;
{
for(i=0; i<MAXHEAD; i++)
{
}
}
oncol =0;
readspec();
for(i=0; i<ncol; i++)
}
void
readspec(void)
{
while (c=get1char())
{
switch(c)
{
default:
if (c != tab)
case ' ': /* note this is also case tab */
continue;
case '\n':
if(sawchar==0) continue;
case ',':
case '.': /* end of table specification */
if(sawchar)
nclin++;
icol=0;
if (c== '.')
{
while ((c=get1char()) && c != '\n')
if (c != ' ' && c != '\t')
/* fix up sep - default is 3 except at edge */
if (oncol == 0)
return;
}
sawchar=0;
continue;
case 'C': case 'S': case 'R': case 'N': case 'L': case 'A':
c += ('a'-'A');
case '_': if (c=='_') c= '-';
case '=': case '-':
case '^':
case 'c': case 's': case 'n': case 'r': case 'l': case 'a':
if (c== 's' && icol<=0)
{
}
{
}
icol++;
if (c=='^' && nclin<=0)
sawchar=1;
continue;
case 'b': case 'i':
c += 'A'-'a';
/* FALLTHRU */
case 'B': case 'I':
if (sawchar == 0)
continue;
if (icol==0) continue;
snp[1]=0;
continue;
case 't': case 'T':
if (sawchar == 0) {
continue;
}
if (icol>0)
continue;
case 'd': case 'D':
if (sawchar == 0)
continue;
if (icol>0)
continue;
case 'f': case 'F':
if (sawchar == 0)
continue;
if (icol==0) continue;
for(i=0; i<2; i++)
{
c = get1char();
if (i==0 && c=='(')
{
stopc=')';
c = get1char();
}
if (c==0) break;
if (c=='\n'){un1getc(c); break;}
snp[i] = c;
if (c>= '0' && c<= '9') break;
}
continue;
case 'P': case 'p':
if (sawchar == 0)
continue;
if (icol<=0) continue;
while (c = get1char())
{
if (c=='-' || c == '+')
break;
else
*snp++=c;
else
if (digit(c))
*snp++ = c;
else break;
}
*snp = 0;
un1getc (c);
continue;
case 'V': case 'v':
if (sawchar == 0)
continue;
if (icol<=0) continue;
while (c = get1char())
{
if (c=='-' || c == '+')
break;
else
*snp++=c;
else
if (digit(c))
*snp++ = c;
else break;
gettext("vertical spacing value too large")
);
}
*snp=0;
un1getc(c);
continue;
case 'w': case 'W':
if (sawchar == 0) {
/*
* This should be an error case.
* However, for the backward-compatibility,
* treat as if 'c' was specified.
*/
icol++;
"too many columns in table"));
}
sawchar = 1;
}
/* Dale Smith didn't like this check
* possible to have two text blocks
* of different widths now ....
if (*snp)
{
fprintf(tabout,
gettext("Ignored second width specification"));
continue;
}
* end commented out code ... */
stopc=0;
while (c = get1char())
{
{
stopc = ')';
continue;
}
break;
break;
*snp++ =c;
}
*snp=0;
if (!stopc)
un1getc(c);
continue;
case 'e': case 'E':
if (sawchar == 0)
continue;
if (icol<1) continue;
evenflg=1;
continue;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
sn[0] = c;
;
un1getc(c);
continue;
case '|':
continue;
}
}
}