123888Sjaap #ifndef lint
2*64044Sbostic /*
323910Sjaap static char sccsid[] = "@(#)nii.c	2.1 (CWI) 85/07/18";
4*64044Sbostic */
5*64044Sbostic static char sccsid[] = "@(#)nii.c	2.2 (Berkeley) 07/27/93";
623888Sjaap #endif lint
723888Sjaap #include "tdef.h"
823888Sjaap #ifdef NROFF
923888Sjaap #include "tw.h"
1023888Sjaap #endif
1123910Sjaap #include "ext.h"
1223888Sjaap #include <sgtty.h>
1323888Sjaap 
1423910Sjaap struct 	s *frame, *stk, *ejl;
1523910Sjaap struct	s *nxf;
1623888Sjaap 
1723888Sjaap int	pipeflg;
1823910Sjaap int	hflg;	/* used in nroff only */
1923910Sjaap int	eqflg;	/* used in nroff only */
2023888Sjaap 
2123888Sjaap #ifndef NROFF
2223888Sjaap int	xpts;
2323888Sjaap int	ppts;
2423888Sjaap int	pfont;
2523888Sjaap int	mpts;
2623888Sjaap int	mfont;
2723888Sjaap int	cs;
2823888Sjaap int	ccs;
2923888Sjaap int	bd;
3023888Sjaap #endif
3123888Sjaap 
3223888Sjaap int	stdi;
3323888Sjaap int	nofeed;
3423888Sjaap int	quiet;
3523888Sjaap int	stop;
3623888Sjaap char	ibuf[IBUFSZ];
3723888Sjaap char	xbuf[IBUFSZ];
3823888Sjaap char	*ibufp;
3923888Sjaap char	*xbufp;
4023888Sjaap char	*eibuf;
4123888Sjaap char	*xeibuf;
4223910Sjaap tchar	pbbuf[NC];	/* pushback buffer for arguments, \n, etc. */
4323910Sjaap tchar	*pbp = pbbuf;	/* next free slot in pbbuf */
4423910Sjaap tchar	*lastpbp = pbbuf;	/* pbp in previous stack frame */
4523888Sjaap int	nx;
4623888Sjaap int	mflg;
4723888Sjaap tchar	ch = 0;
4823888Sjaap int	ibf;
4923888Sjaap int	ttyod;
5023910Sjaap struct	sgttyb ttys;
5123888Sjaap int	iflg;
5223888Sjaap int	rargc;
5323888Sjaap char	**argp;
5423888Sjaap int	trtab[NTRTAB];
5523888Sjaap int	lgf;
5623888Sjaap int	copyf;
5723910Sjaap filep	ip;
5823888Sjaap int	nlflg;
5923888Sjaap int	donef;
6023888Sjaap int	nflush;
6123888Sjaap int	nfo;
6223888Sjaap int	ifile;
6323888Sjaap int	padc;
6423888Sjaap int	raw;
6523888Sjaap int	ifl[NSO];
6623888Sjaap int	ifi;
6723888Sjaap int	flss;
6823888Sjaap int	nonumb;
6923888Sjaap int	trap;
7023888Sjaap int	tflg;
7123888Sjaap int	ejf;
7223888Sjaap int	gflag;
7323888Sjaap int	dilev;
7423910Sjaap filep	offset;
7523888Sjaap int	em;
7623888Sjaap int	ds;
7723910Sjaap filep	woff;
7823888Sjaap int	app;
7923888Sjaap int	ndone;
8023888Sjaap int	lead;
8123888Sjaap int	ralss;
8223910Sjaap filep	nextb;
8323888Sjaap tchar	nrbits;
8423888Sjaap int	nform;
8523888Sjaap int	oldmn;
8623888Sjaap int	newmn;
8723888Sjaap int	macerr;
8823910Sjaap filep	apptr;
8923888Sjaap int	diflg;
9023910Sjaap filep	roff;
9123888Sjaap int	wbfi;
9223888Sjaap int	evi;
9323888Sjaap int	vflag;
9423888Sjaap int	noscale;
9523888Sjaap int	po1;
9623888Sjaap int	nlist[NTRAP];
9723888Sjaap int	mlist[NTRAP];
9823888Sjaap int	evlist[EVLSZ];
9923888Sjaap int	ev;
10023888Sjaap int	tty;
10123888Sjaap int	sfont	= FT;	/* appears to be "standard" font; used by .ul */
10223888Sjaap int	sv;
10323888Sjaap int	esc;
10423888Sjaap int	widthp;
10523888Sjaap int	xfont;
10623888Sjaap int	setwdf;
10723888Sjaap int	over;
10823888Sjaap int	nhyp;
10923888Sjaap tchar	**hyp;
11023910Sjaap tchar	*olinep;
11123888Sjaap int	ttysave = -1;
11223888Sjaap int	dotT;
11323888Sjaap char	*unlkp;
11423888Sjaap int	no_out;
11523910Sjaap struct	widcache widcache[NWIDCACHE];
11623910Sjaap struct	d d[NDI];
11723910Sjaap struct	d *dip;
118