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