Research V7 development
[unix-history] / usr / src / cmd / troff / ni.c
CommitLineData
f10d52e6
JO
1#include "tdef.h"
2char obuf[OBUFSZ];
3char *obufp = obuf;
4int r[NN] = {
5 PAIR('%',0),
6 PAIR('n','l'),
7 PAIR('y','r'),
8 PAIR('h','p'),
9 PAIR('c','t'),
10 PAIR('d','n'),
11 PAIR('m','o'),
12 PAIR('d','y'),
13 PAIR('d','w'),
14 PAIR('l','n'),
15 PAIR('d','l'),
16 PAIR('s','t'),
17 PAIR('s','b'),
18 PAIR('c','.')};
19int pto = 10000;
20int pfrom = 1;
21int print = 1;
22char nextf[NS] = "/usr/lib/tmac/tmac.xxxxx";
23int nfi = 19;
24#ifdef NROFF
25char termtab[NS] = "/usr/lib/term/tab37";
26int tti = 17;
27#endif
28#ifndef NROFF
29int oldbits = -1;
30#endif
31int init = 1;
32int fc = IMP;
33int eschar = '\\';
34int pl = 11*INCH;
35int po = PO;
36int dfact = 1;
37int dfactd = 1;
38int res = 1;
39int smnt = 4;
40int ascii = ASCII;
41int ptid = PTID;
42char ptname[] = "/dev/cat";
43int lg = LG;
44int pnlist[NPN] = {-1};
45int *pnp = pnlist;
46int npn = 1;
47int npnflg = 1;
48int xflg = 1;
49int dpn = -1;
50int totout = 1;
51int ulfont = 1;
52int ulbit = 1<<9;
53int tabch = TAB;
54int ldrch = LEADER;
55int xxx;
56extern caseds(), caseas(), casesp(), caseft(), caseps(), casevs(),
57casenr(), caseif(), casepo(), casetl(), casetm(), casebp(), casech(),
58casepn(), tbreak(), caseti(), casene(), casenf(), casece(), casefi(),
59casein(), caseli(), casell(), casens(), casemk(), casert(), caseam(),
60casede(), casedi(), caseda(), casewh(), casedt(), caseit(), caserm(),
61casern(), casead(), casers(), casena(), casepl(), caseta(), casetr(),
62caseul(), caselt(), casenx(), caseso(), caseig(), casetc(), casefc(),
63caseec(), caseeo(), caselc(), caseev(), caserd(), caseab(), casefl(),
64done(), casess(), casefp(), casecs(), casebd(), caselg(), casehc(),
65casehy(), casenh(), casenm(), casenn(), casesv(), caseos(), casels(),
66casecc(), casec2(), caseem(), caseaf(), casehw(), casemc(), casepm(),
67casecu(), casepi(), caserr(), caseuf(), caseie(), caseel(), casepc(),
68caseht();
69#ifndef NROFF
70extern casefz();
71#endif
72extern casecf();
73struct contab {
74 int rq;
75/*
76 union {
77 */
78 int (*f)();
79/*
80 unsigned mx;
81 }x;
82 */
83}contab[NM]= {
84 PAIR('d','s'),caseds,
85 PAIR('a','s'),caseas,
86 PAIR('s','p'),casesp,
87 PAIR('f','t'),caseft,
88 PAIR('p','s'),caseps,
89 PAIR('v','s'),casevs,
90 PAIR('n','r'),casenr,
91 PAIR('i','f'),caseif,
92 PAIR('i','e'),caseie,
93 PAIR('e','l'),caseel,
94 PAIR('p','o'),casepo,
95 PAIR('t','l'),casetl,
96 PAIR('t','m'),casetm,
97 PAIR('b','p'),casebp,
98 PAIR('c','h'),casech,
99 PAIR('p','n'),casepn,
100 PAIR('b','r'),tbreak,
101 PAIR('t','i'),caseti,
102 PAIR('n','e'),casene,
103 PAIR('n','f'),casenf,
104 PAIR('c','e'),casece,
105 PAIR('f','i'),casefi,
106 PAIR('i','n'),casein,
107 PAIR('l','i'),caseli,
108 PAIR('l','l'),casell,
109 PAIR('n','s'),casens,
110 PAIR('m','k'),casemk,
111 PAIR('r','t'),casert,
112 PAIR('a','m'),caseam,
113 PAIR('d','e'),casede,
114 PAIR('d','i'),casedi,
115 PAIR('d','a'),caseda,
116 PAIR('w','h'),casewh,
117 PAIR('d','t'),casedt,
118 PAIR('i','t'),caseit,
119 PAIR('r','m'),caserm,
120 PAIR('r','r'),caserr,
121 PAIR('r','n'),casern,
122 PAIR('a','d'),casead,
123 PAIR('r','s'),casers,
124 PAIR('n','a'),casena,
125 PAIR('p','l'),casepl,
126 PAIR('t','a'),caseta,
127 PAIR('t','r'),casetr,
128 PAIR('u','l'),caseul,
129 PAIR('c','u'),casecu,
130 PAIR('l','t'),caselt,
131 PAIR('n','x'),casenx,
132 PAIR('s','o'),caseso,
133 PAIR('i','g'),caseig,
134 PAIR('t','c'),casetc,
135 PAIR('f','c'),casefc,
136 PAIR('e','c'),caseec,
137 PAIR('e','o'),caseeo,
138 PAIR('l','c'),caselc,
139 PAIR('e','v'),caseev,
140 PAIR('r','d'),caserd,
141 PAIR('a','b'),caseab,
142 PAIR('f','l'),casefl,
143 PAIR('e','x'),done,
144 PAIR('s','s'),casess,
145 PAIR('f','p'),casefp,
146 PAIR('c','s'),casecs,
147 PAIR('b','d'),casebd,
148 PAIR('l','g'),caselg,
149 PAIR('h','c'),casehc,
150 PAIR('h','y'),casehy,
151 PAIR('n','h'),casenh,
152 PAIR('n','m'),casenm,
153 PAIR('n','n'),casenn,
154 PAIR('s','v'),casesv,
155 PAIR('o','s'),caseos,
156 PAIR('l','s'),casels,
157 PAIR('c','c'),casecc,
158 PAIR('c','2'),casec2,
159 PAIR('e','m'),caseem,
160 PAIR('a','f'),caseaf,
161 PAIR('h','w'),casehw,
162 PAIR('m','c'),casemc,
163 PAIR('p','m'),casepm,
164#ifdef NROFF
165 PAIR('p','i'),casepi,
166#endif
167 PAIR('u','f'),caseuf,
168 PAIR('p','c'),casepc,
169 PAIR('h','t'),caseht,
170#ifndef NROFF
171 PAIR('f','z'),casefz,
172#endif
173 PAIR('c', 'f'),casecf,
174};
175
176/*
177troff environment block
178*/
179
180int block = 0;
181int ics = ICS;
182int ic = 0;
183int icf = 0;
184int chbits = 0;
185int spbits = 0;
186int nmbits = 0;
187int apts = PS;
188int apts1 = PS;
189int pts = PS;
190int pts1 = PS;
191int font = FT;
192int font1 = FT;
193int sps = SPS;
194int spacesz = SS;
195int lss = VS;
196int lss1 = VS;
197int ls = 1;
198int ls1 = 1;
199int ll = LL;
200int ll1 = LL;
201int lt = LL;
202int lt1 = LL;
203int ad = 1;
204int nms = 1;
205int ndf = 1;
206int fi = 1;
207int cc = '.';
208int c2 = '\'';
209int ohc = OHC;
210int tdelim = IMP;
211int hyf = 1;
212int hyoff = 0;
213int un1 = -1;
214int tabc = 0;
215int dotc = '.';
216int adsp = 0;
217int adrem = 0;
218int lastl = 0;
219int nel = 0;
220int admod = 0;
221int *wordp = 0;
222int spflg = 0;
223int *linep = 0;
224int *wdend = 0;
225int *wdstart = 0;
226int wne = 0;
227int ne = 0;
228int nc = 0;
229int nb = 0;
230int lnmod = 0;
231int nwd = 0;
232int nn = 0;
233int ni = 0;
234int ul = 0;
235int cu = 0;
236int ce = 0;
237int in = 0;
238int in1 = 0;
239int un = 0;
240int wch = 0;
241int pendt = 0;
242int *pendw = 0;
243int pendnf = 0;
244int spread = 0;
245int it = 0;
246int itmac = 0;
247int lnsize = LNSIZE;
248int *hyptr[NHYP] = {0};
249int tabtab[NTAB] = {DTAB,DTAB*2,DTAB*3,DTAB*4,DTAB*5,DTAB*6,DTAB*7,DTAB*8,
250 DTAB*9,DTAB*10,DTAB*11,DTAB*12,DTAB*13,DTAB*14,DTAB*15,0};
251int line[LNSIZE] = {0};
252int word[WDSIZE] = {0};
253int blockxxx[EVS-68-NHYP-NTAB-WDSIZE-LNSIZE] = {0};
254/*spare 5 words*/
255int oline[LNSIZE+1];