xref: /titanic_41/usr/src/cmd/troff/nii.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
32 
33 /*
34  * University Copyright- Copyright (c) 1982, 1986, 1988
35  * The Regents of the University of California
36  * All Rights Reserved
37  *
38  * University Acknowledgment- Portions of this document are derived from
39  * software developed by the University of California, Berkeley, and its
40  * contributors.
41  */
42 
43 #include "tdef.h"
44 #ifdef NROFF
45 #include "tw.h"
46 #endif
47 #include "ext.h"
48 
49 struct 	s *frame, *stk, *ejl;
50 struct	s *nxf;
51 
52 int	pipeflg;
53 int	hflg;	/* used in nroff only */
54 int	eqflg;	/* used in nroff only */
55 
56 #ifndef NROFF
57 int	xpts;
58 int	ppts;
59 int	pfont;
60 int	mpts;
61 int	mfont;
62 int	cs;
63 int	ccs;
64 int	bd;
65 #endif
66 
67 int	stdi;
68 int	nofeed;
69 int	quiet;
70 int	stop;
71 char	ibuf[IBUFSZ];
72 char	xbuf[IBUFSZ];
73 char	*ibufp;
74 char	*xbufp;
75 char	*eibuf;
76 char	*xeibuf;
77 tchar	pbbuf[NC];	/* pushback buffer for arguments, \n, etc. */
78 tchar	*pbp = pbbuf;	/* next free slot in pbbuf */
79 tchar	*lastpbp = pbbuf;	/* pbp in previous stack frame */
80 int	nx;
81 int	mflg;
82 tchar	ch = 0;
83 int	ibf;
84 int	ttyod;
85 int	iflg;
86 char	*enda;
87 int	rargc;
88 char	**argp;
89 int	trtab[NTRTAB];
90 int	lgf;
91 int	copyf;
92 filep	ip;
93 int	nlflg;
94 int	donef;
95 int	nflush;
96 int	nfo;
97 int	ifile;
98 int	padc;
99 int	raw;
100 int	ifl[NSO];
101 int	ifi;
102 int	flss;
103 int	nonumb;
104 int	trap;
105 int	tflg;
106 int	ejf;
107 int	gflag;
108 int	dilev;
109 filep	offset;
110 int	em;
111 int	ds;
112 filep	woff;
113 int	app;
114 int	ndone;
115 int	lead;
116 int	ralss;
117 filep	nextb;
118 tchar	nrbits;
119 int	nform;
120 int	oldmn;
121 int	newmn;
122 int	macerr;
123 filep	apptr;
124 int	diflg;
125 filep	roff;
126 int	wbfi;
127 int	evi;
128 int	vflag;
129 int	noscale;
130 int	po1;
131 int	nlist[NTRAP];
132 int	mlist[NTRAP];
133 int	evlist[EVLSZ];
134 int	ev;
135 int	tty;
136 int	sfont	= FT;	/* appears to be "standard" font; used by .ul */
137 int	sv;
138 int	esc;
139 int	widthp;
140 int	xfont;
141 int	setwdf;
142 int	over;
143 int	nhyp;
144 tchar	**hyp;
145 tchar	*olinep;
146 int	dotT;
147 char	*unlkp;
148 int	no_out;
149 struct	widcache widcache[NWIDCACHE];
150 struct	d d[NDI];
151 struct	d *dip;
152