1 /* $MirOS: src/share/tmac/tab/tablpr.c,v 1.3 2012/05/22 00:06:47 tg Exp $ */ 2 3 /*- 4 * Copyright (c) 1979, 1980, 1981, 1986, 1988, 1990, 1991, 1992 5 * The Regents of the University of California. 6 * Copyright (C) Caldera International Inc. 2001-2002. 7 * Copyright (c) 2003, 2004, 2012 8 * Thorsten "mirabilos" Glaser <tg@mirbsd.org> 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, 12 * with or without modification, are permitted provided 13 * that the following conditions are met: 14 * 15 * Redistributions of source code and documentation must retain 16 * the above copyright notice, this list of conditions and the 17 * following disclaimer. Redistributions in binary form must 18 * reproduce the above copyright notice, this list of conditions 19 * and the following disclaimer in the documentation and/or other 20 * materials provided with the distribution. 21 * 22 * All advertising materials mentioning features or use of this 23 * software must display the following acknowledgement: 24 * This product includes software developed or owned by 25 * Caldera International, Inc. 26 * 27 * Neither the name of Caldera International, Inc. nor the names 28 * of other contributors may be used to endorse or promote products 29 * derived from this software without specific prior written permission. 30 * 31 * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 32 * INTERNATIONAL, INC. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 33 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 34 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 35 * ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE 36 * LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR 37 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 38 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 39 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 40 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 41 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 42 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 * 44 * @(#)tablpr.c 4.2 (Berkeley) 4/18/91 45 */ 46 47 #define INCH 240 48 /* 49 * LPR or CRT 10 Pitch 50 * nroff driving table 51 * no reverse or half line feeds 52 * by UCB Computer Center 53 */ 54 struct { 55 int bset; 56 int breset; 57 int Hor; 58 int Vert; 59 int Newline; 60 int Char; 61 int Em; 62 int Halfline; 63 int Adj; 64 const char *twinit; 65 const char *twrest; 66 const char *twnl; 67 const char *hlr; 68 const char *hlf; 69 const char *flr; 70 const char *bdon; 71 const char *bdoff; 72 const char *ploton; 73 const char *plotoff; 74 const char *up; 75 const char *down; 76 const char *right; 77 const char *left; 78 const char *codetab[256-32]; 79 int zzz; 80 } t = { 81 /*bset*/ 0, 82 /*breset*/ 0, 83 /*Hor*/ INCH/10, 84 /*Vert*/ INCH/6, 85 /*Newline*/ INCH/6, 86 /*Char*/ INCH/10, 87 /*Em*/ INCH/10, 88 /*Halfline*/ INCH/12, 89 /*Adj*/ INCH/10, 90 /*twinit*/ "", 91 /*twrest*/ "", 92 /*twnl*/ "\n", 93 /*hlr*/ "", 94 /*hlf*/ "", 95 /*flr*/ "", 96 /*bdon*/ "", 97 /*bdoff*/ "", 98 /*ploton*/ "", 99 /*plotoff*/ "", 100 /*up*/ "", 101 /*down*/ "", 102 /*right*/ "", 103 /*left*/ "", 104 /*codetab*/ { 105 "\001 ", /*space*/ 106 "\001!", /*!*/ 107 "\001\"", /*"*/ 108 "\001#", /*#*/ 109 "\001$", /*$*/ 110 "\001%", /*%*/ 111 "\001&", /*&*/ 112 "\001'", /*' close*/ 113 "\001(", /*(*/ 114 "\001)", /*)*/ 115 "\001*", /***/ 116 "\001+", /*+*/ 117 "\001,", /*,*/ 118 "\001-", /*-*/ 119 "\001.", /*.*/ 120 "\001/", /*/*/ 121 "\2010", /*0*/ 122 "\2011", /*1*/ 123 "\2012", /*2*/ 124 "\2013", /*3*/ 125 "\2014", /*4*/ 126 "\2015", /*5*/ 127 "\2016", /*6*/ 128 "\2017", /*7*/ 129 "\2018", /*8*/ 130 "\2019", /*9*/ 131 "\001:", /*:*/ 132 "\001;", /*;*/ 133 "\001<", /*<*/ 134 "\001=", /*=*/ 135 "\001>", /*>*/ 136 "\001?", /*?*/ 137 "\001@", /*@*/ 138 "\201A", /*A*/ 139 "\201B", /*B*/ 140 "\201C", /*C*/ 141 "\201D", /*D*/ 142 "\201E", /*E*/ 143 "\201F", /*F*/ 144 "\201G", /*G*/ 145 "\201H", /*H*/ 146 "\201I", /*I*/ 147 "\201J", /*J*/ 148 "\201K", /*K*/ 149 "\201L", /*L*/ 150 "\201M", /*M*/ 151 "\201N", /*N*/ 152 "\201O", /*O*/ 153 "\201P", /*P*/ 154 "\201Q", /*Q*/ 155 "\201R", /*R*/ 156 "\201S", /*S*/ 157 "\201T", /*T*/ 158 "\201U", /*U*/ 159 "\201V", /*V*/ 160 "\201W", /*W*/ 161 "\201X", /*X*/ 162 "\201Y", /*Y*/ 163 "\201Z", /*Z*/ 164 "\001[", /*[*/ 165 "\001\\", /*\*/ 166 "\001]", /*]*/ 167 "\001^", /*^*/ 168 "\001_", /*_*/ 169 "\001`", /*` open*/ 170 "\201a", /*a*/ 171 "\201b", /*b*/ 172 "\201c", /*c*/ 173 "\201d", /*d*/ 174 "\201e", /*e*/ 175 "\201f", /*f*/ 176 "\201g", /*g*/ 177 "\201h", /*h*/ 178 "\201i", /*i*/ 179 "\201j", /*j*/ 180 "\201k", /*k*/ 181 "\201l", /*l*/ 182 "\201m", /*m*/ 183 "\201n", /*n*/ 184 "\201o", /*o*/ 185 "\201p", /*p*/ 186 "\201q", /*q*/ 187 "\201r", /*r*/ 188 "\201s", /*s*/ 189 "\201t", /*t*/ 190 "\201u", /*u*/ 191 "\201v", /*v*/ 192 "\201w", /*w*/ 193 "\201x", /*x*/ 194 "\201y", /*y*/ 195 "\201z", /*z*/ 196 "\001{", /*{*/ 197 "\001|", /*|*/ 198 "\001}", /*}*/ 199 "\001~", /*~*/ 200 "\000", /*nar sp*/ 201 "\001-", /*hyphen*/ 202 "\001o\b+", /*bullet*/ 203 "\002[]", /*square*/ 204 "\001-", /*3/4 em*/ 205 "\001_", /*rule*/ 206 "\0031/4", /*1/4*/ 207 "\0031/2", /*1/2*/ 208 "\0033/4", /*3/4*/ 209 "\001-", /*minus*/ 210 "\202fi", /*fi*/ 211 "\202fl", /*fl*/ 212 "\202ff", /*ff*/ 213 "\203ffi", /*ffi*/ 214 "\203ffl", /*ffl*/ 215 "\000\0", /*degree*/ 216 "\001|\b-", /*dagger*/ 217 "\001s\bS", /*section*/ 218 "\001'", /*foot mark*/ 219 "\001'", /*acute accent*/ 220 "\001`", /*grave accent*/ 221 "\001_", /*underrule*/ 222 "\001/", /*slash (longer)*/ 223 "\000", /*half narrow space*/ 224 "\001 ", /*unpaddable space*/ 225 "\201o\b(", /*alpha*/ 226 "\2018\b|", /*beta*/ 227 "\201>\b/", /*gamma*/ 228 "\201d\b`", /*delta*/ 229 "\201C\b-", /*epsilon*/ 230 "\000\0", /*zeta*/ 231 "\201n", /*eta*/ 232 "\201o\b-", /*theta*/ 233 "\201i", /*iota*/ 234 "\201k", /*kappa*/ 235 "\201,\b\\", /*lambda*/ 236 "\201u", /*mu*/ 237 "\201v", /*nu*/ 238 "\000\0", /*xi*/ 239 "\201o", /*omicron*/ 240 "\202i\b~i\b~", /*pi*/ 241 "\201p", /*rho*/ 242 "\201o\b~", /*sigma*/ 243 "\201i\b~", /*tau*/ 244 "\201u", /*upsilon*/ 245 "\201o\b|", /*phi*/ 246 "\201x", /*chi*/ 247 "\201u\b|", /*psi*/ 248 "\201w", /*omega*/ 249 "\201I\b~", /*Gamma*/ 250 "\202/\b_\\\b_", /*Delta*/ 251 "\201O\b-", /*Theta*/ 252 "\202/\\", /*Lambda*/ 253 "\201=\b_", /*Xi*/ 254 "\202TT", /*Pi*/ 255 "\201>\b_\b~", /*Sigma*/ 256 "\000", /**/ 257 "\201Y", /*Upsilon*/ 258 "\201O\b|", /*Phi*/ 259 "\201U\b|", /*Psi*/ 260 "\201O\b_", /*Omega*/ 261 "\001v\b/", /*square root*/ 262 "\000\0", /*terminal sigma*/ 263 "\001~", /*root en*/ 264 "\001>\b_", /*>=*/ 265 "\001<\b_", /*<=*/ 266 "\001=\b_", /*identically equal*/ 267 "\001-", /*equation minus*/ 268 "\001~\b_", /*approx =*/ 269 "\001~", /*approximates*/ 270 "\001=\b/", /*not equal*/ 271 "\002->", /*right arrow*/ 272 "\002<-", /*left arrow*/ 273 "\001|\b^", /*up arrow*/ 274 "\001|\bv", /*down arrow*/ 275 "\001=", /*equation equal*/ 276 "\001x", /*multiply*/ 277 "\001:\b-", /*divide*/ 278 "\001+\b_", /*plus-minus*/ 279 "\002(\b~)\b~", /*cup (union)*/ 280 "\002(\b_)\b_", /*cap (intersection)*/ 281 "\002(=", /*subset of*/ 282 "\002=)", /*superset of*/ 283 "\002(=\b_", /*improper subset*/ 284 "\002=\b_)", /*improper superset*/ 285 "\002oo", /*infinity*/ 286 "\001o\b`", /*partial derivative*/ 287 "\002\\\b~/\b~", /*gradient*/ 288 "\000\0", /*not*/ 289 "\000\0", /*integral sign*/ 290 "\002oc", /*proportional to*/ 291 "\001O\b/", /*empty set*/ 292 "\001<\b-", /*member of*/ 293 "\001+", /*equation plus*/ 294 "\003(R)", /*registered*/ 295 "\003(C)", /*copyright*/ 296 "\001|", /*box rule */ 297 "\001c\b/", /*cent sign*/ 298 "\001|\b=", /*dbl dagger*/ 299 "\002=>", /*right hand*/ 300 "\002<=", /*left hand*/ 301 "\001*", /*math * */ 302 "\000\0", /*bell system sign*/ 303 "\001|", /*or (was star)*/ 304 "\001O", /*circle*/ 305 "\001|", /*left top of big brace*/ 306 "\001|", /*left bot of big brace*/ 307 "\001|", /*right top of big brace*/ 308 "\001|", /*right bot of big brace*/ 309 "\001|", /*left center of big brace*/ 310 "\001|", /*right center of big brace*/ 311 "\001|", /*bold vertical*/ 312 "\001|", /*left floor (lb of big bracket)*/ 313 "\001|", /*right floor (rb of big bracket)*/ 314 "\001|", /*left ceiling (lt of big bracket)*/ 315 "\001|", /*right ceiling (rt of big bracket)*/ 316 }, 317 0 318 }; 319