xref: /illumos-gate/usr/src/cmd/troff/nii.c (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*
31  * University Copyright- Copyright (c) 1982, 1986, 1988
32  * The Regents of the University of California
33  * All Rights Reserved
34  *
35  * University Acknowledgment- Portions of this document are derived from
36  * software developed by the University of California, Berkeley, and its
37  * contributors.
38  */
39 
40 #include "tdef.h"
41 #ifdef NROFF
42 #include "tw.h"
43 #endif
44 #include "ext.h"
45 
46 struct 	s *frame, *stk, *ejl;
47 struct	s *nxf;
48 
49 int	pipeflg;
50 int	hflg;	/* used in nroff only */
51 int	eqflg;	/* used in nroff only */
52 
53 #ifndef NROFF
54 int	xpts;
55 int	ppts;
56 int	pfont;
57 int	mpts;
58 int	mfont;
59 int	cs;
60 int	ccs;
61 int	bd;
62 #endif
63 
64 int	stdi;
65 int	nofeed;
66 int	quiet;
67 int	stop;
68 char	ibuf[IBUFSZ];
69 char	xbuf[IBUFSZ];
70 char	*ibufp;
71 char	*xbufp;
72 char	*eibuf;
73 char	*xeibuf;
74 tchar	pbbuf[NC];	/* pushback buffer for arguments, \n, etc. */
75 tchar	*pbp = pbbuf;	/* next free slot in pbbuf */
76 tchar	*lastpbp = pbbuf;	/* pbp in previous stack frame */
77 int	nx;
78 int	mflg;
79 tchar	ch = 0;
80 int	ibf;
81 int	ttyod;
82 int	iflg;
83 char	*enda;
84 int	rargc;
85 char	**argp;
86 int	trtab[NTRTAB];
87 int	lgf;
88 int	copyf;
89 filep	ip;
90 int	nlflg;
91 int	donef;
92 int	nflush;
93 int	nfo;
94 int	ifile;
95 int	padc;
96 int	raw;
97 int	ifl[NSO];
98 int	ifi;
99 int	flss;
100 int	nonumb;
101 int	trap;
102 int	tflg;
103 int	ejf;
104 int	gflag;
105 int	dilev;
106 filep	offset;
107 int	em;
108 int	ds;
109 filep	woff;
110 int	app;
111 int	ndone;
112 int	lead;
113 int	ralss;
114 filep	nextb;
115 tchar	nrbits;
116 int	nform;
117 int	oldmn;
118 int	newmn;
119 int	macerr;
120 filep	apptr;
121 int	diflg;
122 filep	roff;
123 int	wbfi;
124 int	evi;
125 int	vflag;
126 int	noscale;
127 int	po1;
128 int	nlist[NTRAP];
129 int	mlist[NTRAP];
130 int	evlist[EVLSZ];
131 int	ev;
132 int	tty;
133 int	sfont	= FT;	/* appears to be "standard" font; used by .ul */
134 int	sv;
135 int	esc;
136 int	widthp;
137 int	xfont;
138 int	setwdf;
139 int	over;
140 int	nhyp;
141 tchar	**hyp;
142 tchar	*olinep;
143 int	dotT;
144 char	*unlkp;
145 int	no_out;
146 struct	widcache widcache[NWIDCACHE];
147 struct	d d[NDI];
148 struct	d *dip;
149