2 * Copyright 1991 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
17 /* t3.c: interpret commands affecting whole table */
21 struct optstr
{char *optnam
; int *optadd
;} options
[] = {
30 "doublebox", &dboxflg
,
31 "DOUBLEBOX", &dboxflg
,
34 "doubleframe", &dboxflg
,
35 "DOUBLEFRAME", &dboxflg
,
44 void backrest(char *);
49 char line
[200], *cp
, nb
[25], *t
;
52 for(lp
= options
; lp
->optnam
; lp
++)
54 texname
= texstr
[texct
=0];
56 printf(".nr %d \\n(.s\n", LSIZE
);
57 gets1(line
, sizeof line
);
58 /* see if this is a command line */
59 if (strchr(line
,';') == NULL
)
64 for(cp
=line
; (c
= *cp
) != ';'; cp
++)
66 if (!letter(c
)) continue;
68 for(lp
= options
; lp
->optadd
; lp
++)
70 if (prefix(lp
->optnam
, cp
))
73 cp
+= strlen(lp
->optnam
);
75 error(gettext("Misspelled global option"));
79 while ((ci
= *++cp
) != ')')
83 if (lp
->optadd
== &tab
)
86 *(lp
->optadd
) = nb
[0];
88 if (lp
->optadd
== &linsize
)
89 printf(".nr %d %s\n", LSIZE
, nb
);
90 if (lp
->optadd
== &delim1
)
100 error(gettext("Illegal option"));