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