make font directory changeable from makefile
[unix-history] / usr / src / local / ditroff / ditroff.old.okeeffe / troff / ni.c
CommitLineData
b23405f0
DS
1#include "tdef.h"
2
3/* You may want to change these names */
4
a4391633
DS
5#ifndef FONTDIR
6#define FONTDIR "/usr/lib/font"
7#endif
8
b23405f0 9#ifndef NROFF
a4391633
DS
10char termtab[NS] = FONTDIR; /* rest added in ptinit() */
11char fontfile[NS] = FONTDIR; /* rest added in casefp() */
b23405f0
DS
12char devname[10] = "va"; /* default typesetter */
13#endif
14char obuf[OBUFSZ]; /* characters collected here for actual typesetter output */
15char *obufp = obuf;
16int r[NN] = { /* read-only number registers at beginning */
17 PAIR('%', 0),
18 PAIR('n', 'l'),
19 PAIR('y', 'r'),
20 PAIR('h', 'p'),
21 PAIR('c', 't'),
22 PAIR('d', 'n'),
23 PAIR('m', 'o'),
24 PAIR('d', 'y'),
25 PAIR('d', 'w'),
26 PAIR('l', 'n'),
27 PAIR('d', 'l'),
28 PAIR('s', 't'),
29 PAIR('s', 'b'),
30 PAIR('c', '.'),
31 PAIR('$', '$'),
32};
33
34
35int pto = 10000;
36int pfrom = 1;
37int print = 1;
38char nextf[NS] = "/usr/lib/ditmac/tmac.xxxxx";
39int nfi = 21;
40#ifdef NROFF
41char termtab[NS] = "/usr/lib/term/tab37";
42#endif
43#ifndef NROFF
44int oldbits = -1;
45#endif
46int init = 1;
47int fc = IMP; /* field character */
48int eschar = '\\';
49#ifdef NROFF
50int pl = 11*INCH;
51int po = PO;
52#else
53int pl;
54int po;
55#endif
56int dfact = 1;
57int dfactd = 1;
58int res = 1;
b23405f0
DS
59int ascii = ASCII;
60int ptid = PTID;
61int lg = LG;
62int pnlist[NPN] = {
63 -1};
64
65
66int *pnp = pnlist;
67int npn = 1;
68int npnflg = 1;
69int xflg = 1;
70int dpn = -1;
71int totout = 1;
72int ulfont = FT + 1;
73int ulbit = 1 << 9;
74int tabch = TAB;
75int ldrch = LEADER;
76int xxx;
77extern caseds(), caseas(), casesp(), caseft(), caseps(), casevs(),
78casenr(), caseif(), casepo(), casetl(), casetm(), casebp(), casech(),
79casepn(), tbreak(), caseti(), casene(), casenf(), casece(), casefi(),
80casein(), casell(), casens(), casemk(), casert(), caseam(),
81casede(), casedi(), caseda(), casewh(), casedt(), caseit(), caserm(),
82casern(), casead(), casers(), casena(), casepl(), caseta(), casetr(),
83caseul(), caselt(), casenx(), caseso(), caseig(), casetc(), casefc(),
84caseec(), caseeo(), caselc(), caseev(), caserd(), caseab(), casefl(),
85done(), casess(), casefp(), casecs(), casebd(), caselg(), casehc(),
86casehy(), casenh(), casenm(), casenn(), casesv(), caseos(), casels(),
87casecc(), casec2(), caseem(), caseaf(), casehw(), casemc(), casepm(),
88casecu(), casepi(), caserr(), caseuf(), caseie(), caseel(), casepc(),
89caseht(), casecf(), casesy();
90
91struct contab {
92 int rq;
93 /*
94 union {
95 */
96 int (*f)();
97 /*
98 unsigned mx;
99 }x;
100 */
101} contab[NM] = {
102 PAIR('d', 's'), caseds,
103 PAIR('a', 's'), caseas,
104 PAIR('s', 'p'), casesp,
105 PAIR('f', 't'), caseft,
106 PAIR('p', 's'), caseps,
107 PAIR('v', 's'), casevs,
108 PAIR('n', 'r'), casenr,
109 PAIR('i', 'f'), caseif,
110 PAIR('i', 'e'), caseie,
111 PAIR('e', 'l'), caseel,
112 PAIR('p', 'o'), casepo,
113 PAIR('t', 'l'), casetl,
114 PAIR('t', 'm'), casetm,
115 PAIR('b', 'p'), casebp,
116 PAIR('c', 'h'), casech,
117 PAIR('p', 'n'), casepn,
118 PAIR('b', 'r'), tbreak,
119 PAIR('t', 'i'), caseti,
120 PAIR('n', 'e'), casene,
121 PAIR('n', 'f'), casenf,
122 PAIR('c', 'e'), casece,
123 PAIR('f', 'i'), casefi,
124 PAIR('i', 'n'), casein,
125 PAIR('l', 'l'), casell,
126 PAIR('n', 's'), casens,
127 PAIR('m', 'k'), casemk,
128 PAIR('r', 't'), casert,
129 PAIR('a', 'm'), caseam,
130 PAIR('d', 'e'), casede,
131 PAIR('d', 'i'), casedi,
132 PAIR('d', 'a'), caseda,
133 PAIR('w', 'h'), casewh,
134 PAIR('d', 't'), casedt,
135 PAIR('i', 't'), caseit,
136 PAIR('r', 'm'), caserm,
137 PAIR('r', 'r'), caserr,
138 PAIR('r', 'n'), casern,
139 PAIR('a', 'd'), casead,
140 PAIR('r', 's'), casers,
141 PAIR('n', 'a'), casena,
142 PAIR('p', 'l'), casepl,
143 PAIR('t', 'a'), caseta,
144 PAIR('t', 'r'), casetr,
145 PAIR('u', 'l'), caseul,
146 PAIR('c', 'u'), casecu,
147 PAIR('l', 't'), caselt,
148 PAIR('n', 'x'), casenx,
149 PAIR('s', 'o'), caseso,
150 PAIR('i', 'g'), caseig,
151 PAIR('t', 'c'), casetc,
152 PAIR('f', 'c'), casefc,
153 PAIR('e', 'c'), caseec,
154 PAIR('e', 'o'), caseeo,
155 PAIR('l', 'c'), caselc,
156 PAIR('e', 'v'), caseev,
157 PAIR('r', 'd'), caserd,
158 PAIR('a', 'b'), caseab,
159 PAIR('f', 'l'), casefl,
160 PAIR('e', 'x'), done,
161 PAIR('s', 's'), casess,
162 PAIR('f', 'p'), casefp,
163 PAIR('c', 's'), casecs,
164 PAIR('b', 'd'), casebd,
165 PAIR('l', 'g'), caselg,
166 PAIR('h', 'c'), casehc,
167 PAIR('h', 'y'), casehy,
168 PAIR('n', 'h'), casenh,
169 PAIR('n', 'm'), casenm,
170 PAIR('n', 'n'), casenn,
171 PAIR('s', 'v'), casesv,
172 PAIR('o', 's'), caseos,
173 PAIR('l', 's'), casels,
174 PAIR('c', 'c'), casecc,
175 PAIR('c', '2'), casec2,
176 PAIR('e', 'm'), caseem,
177 PAIR('a', 'f'), caseaf,
178 PAIR('h', 'w'), casehw,
179 PAIR('m', 'c'), casemc,
180 PAIR('p', 'm'), casepm,
181 PAIR('p', 'i'), casepi,
182 PAIR('u', 'f'), caseuf,
183 PAIR('p', 'c'), casepc,
184 PAIR('h', 't'), caseht,
185 PAIR('c', 'f'), casecf,
186 PAIR('s', 'y'), casesy,
187 PAIR('!', 0), casesy, /* synonym for .sy */
188};
189
190
191tchar oline[LNSIZE+1];
192
193/*
194troff environment block
195*/
196
197int block = 0;
198#ifdef NROFF
199/* these are initialized statically in nroff (so far)
200 /* and dynamically in ptinit() in troff beacuse INCH
201 /* is a variable
202 */
203int ics = ICS; /* space for insertion character */
204int sps = SPS;
205int spacesz = SS;
206int lss = VS;
207int lss1 = VS;
208int ll = LL;
209int ll1 = LL;
210int lt = LL;
211int lt1 = LL;
212#else
213int ics = 0;
214int sps = 0;
215int spacesz = 0;
216int lss = 0;
217int lss1 = 0;
218int ll = 0;
219int ll1 = 0;
220int lt = 0;
221int lt1 = 0;
222#endif
223tchar ic = 0; /* insertion character (= margin character) */
224int icf = 0;
225tchar chbits = 0; /* size+font bits for current character */
226tchar spbits = 0; /* ditto for special font */
227tchar nmbits = 0;
228int apts = PS; /* actual point size -- as requested by user */
229int apts1 = PS; /* need not match an existent size */
230int pts = PS; /* hence, this is the size that really exists */
231int pts1 = PS;
232int font = FT;
233int font1 = FT;
234int ls = 1;
235int ls1 = 1;
236int ad = 1;
237int nms = 1;
238int ndf = 1;
239int fi = 1;
240int cc = '.';
241int c2 = '\'';
242int ohc = OHC;
243int tdelim = IMP;
244int hyf = 1;
245int hyoff = 0;
246int un1 = -1;
247int tabc = 0;
248int dotc = '.';
249int adsp = 0;
250int adrem = 0;
251int lastl = 0;
252int nel = 0;
253int admod = 0;
254tchar *wordp = 0;
255int spflg = 0; /* probably to indicate space after punctuation needed */
256tchar *linep = 0;
257tchar *wdend = 0;
258tchar *wdstart = 0;
259int wne = 0;
260int ne = 0;
261int nc = 0;
262int nb = 0;
263int lnmod = 0;
264int nwd = 0;
265int nn = 0;
266int ni = 0;
267int ul = 0;
268int cu = 0;
269int ce = 0;
270int in = 0;
271int in1 = 0;
272int un = 0;
273int wch = 0;
274int pendt = 0;
275tchar *pendw = 0;
276int pendnf = 0;
277int spread = 0;
278int it = 0;
279int itmac = 0;
280int lnsize = LNSIZE;
281tchar *hyptr[NHYP] = {
282 0};
283
284
285int tabtab[NTAB] = {
286 0};
287
288
289tchar line[LNSIZE] = {
290 0};
291
292
293tchar word[WDSIZE] = {
294 0};
295
296
297char blockxxx[EVSPARE] = {
298 0};
299
300