1 /* $MirOS: src/share/tmac/tab/tabcol.c,v 1.5 2012/05/22 00:06:46 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, 2006, 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 * reverse line feeds by means of col(1) 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*/ "", /* invoke elite */ 91 /*twrest*/ "", /* reset printer to defaults */ 92 /*twnl*/ "\n", 93 #if 0 94 /*hlr*/ "\033\012", /* half line forward (???) */ 95 /*hlf*/ "\033\013", /* half line reverse (???) */ 96 #else 97 /*hlr*/ "", 98 /*hlf*/ "", 99 #endif 100 /*flr*/ "\013", /* full line reverse (???) */ 101 #if 0 102 /*bdon*/ "\016", /* Alternate chars. '\fB' to invoke */ 103 /*bdoff*/ "\017", /* Standard chars. '\fP' to invoke */ 104 #else 105 /*bdon*/ "", 106 /*bdoff*/ "", 107 #endif 108 /*ploton*/ "", 109 /*plotoff*/ "", 110 /*up*/ "", 111 /*down*/ "", 112 /*right*/ "", 113 /*left*/ "", 114 /*codetab*/ { 115 "\001 ", /*space*/ 116 "\001!", /*!*/ 117 "\001\"", /*"*/ 118 "\001#", /*#*/ 119 "\001$", /*$*/ 120 "\001%", /*%*/ 121 "\001&", /*&*/ 122 "\001'", /*' close*/ 123 "\001(", /*(*/ 124 "\001)", /*)*/ 125 "\001*", /***/ 126 "\001+", /*+*/ 127 "\001,", /*,*/ 128 "\001-", /*-*/ 129 "\001.", /*.*/ 130 "\001/", /*/*/ 131 "\2010", /*0*/ 132 "\2011", /*1*/ 133 "\2012", /*2*/ 134 "\2013", /*3*/ 135 "\2014", /*4*/ 136 "\2015", /*5*/ 137 "\2016", /*6*/ 138 "\2017", /*7*/ 139 "\2018", /*8*/ 140 "\2019", /*9*/ 141 "\001:", /*:*/ 142 "\001;", /*;*/ 143 "\001<", /*<*/ 144 "\001=", /*=*/ 145 "\001>", /*>*/ 146 "\001?", /*?*/ 147 "\001@", /*@*/ 148 "\201A", /*A*/ 149 "\201B", /*B*/ 150 "\201C", /*C*/ 151 "\201D", /*D*/ 152 "\201E", /*E*/ 153 "\201F", /*F*/ 154 "\201G", /*G*/ 155 "\201H", /*H*/ 156 "\201I", /*I*/ 157 "\201J", /*J*/ 158 "\201K", /*K*/ 159 "\201L", /*L*/ 160 "\201M", /*M*/ 161 "\201N", /*N*/ 162 "\201O", /*O*/ 163 "\201P", /*P*/ 164 "\201Q", /*Q*/ 165 "\201R", /*R*/ 166 "\201S", /*S*/ 167 "\201T", /*T*/ 168 "\201U", /*U*/ 169 "\201V", /*V*/ 170 "\201W", /*W*/ 171 "\201X", /*X*/ 172 "\201Y", /*Y*/ 173 "\201Z", /*Z*/ 174 "\001[", /*[*/ 175 "\001\\", /*\*/ 176 "\001]", /*]*/ 177 "\001^", /*^*/ 178 "\001_", /*_*/ 179 "\001`", /*` open*/ 180 "\201a", /*a*/ 181 "\201b", /*b*/ 182 "\201c", /*c*/ 183 "\201d", /*d*/ 184 "\201e", /*e*/ 185 "\201f", /*f*/ 186 "\201g", /*g*/ 187 "\201h", /*h*/ 188 "\201i", /*i*/ 189 "\201j", /*j*/ 190 "\201k", /*k*/ 191 "\201l", /*l*/ 192 "\201m", /*m*/ 193 "\201n", /*n*/ 194 "\201o", /*o*/ 195 "\201p", /*p*/ 196 "\201q", /*q*/ 197 "\201r", /*r*/ 198 "\201s", /*s*/ 199 "\201t", /*t*/ 200 "\201u", /*u*/ 201 "\201v", /*v*/ 202 "\201w", /*w*/ 203 "\201x", /*x*/ 204 "\201y", /*y*/ 205 "\201z", /*z*/ 206 "\001{", /*{*/ 207 "\001|", /*|*/ 208 "\001}", /*}*/ 209 "\001~", /*~*/ 210 "\000", /*nar sp*/ 211 "\001-", /*hyphen*/ 212 "\001o\b+", /*bullet*/ 213 "\002[]", /*square*/ 214 "\001-", /*3/4 em*/ 215 "\001_", /*rule*/ 216 "\0031/4", /*1/4*/ 217 "\0031/2", /*1/2*/ 218 "\0033/4", /*3/4*/ 219 "\001-", /*minus*/ 220 "\202fi", /*fi*/ 221 "\202fl", /*fl*/ 222 "\202ff", /*ff*/ 223 "\203ffi", /*ffi*/ 224 "\203ffl", /*ffl*/ 225 "\000\0", /*degree*/ 226 "\001|\b-", /*dagger*/ 227 "\001s\bS", /*section*/ 228 "\001'", /*foot mark*/ 229 "\001'", /*acute accent*/ 230 "\001`", /*grave accent*/ 231 "\001_", /*underrule*/ 232 "\001/", /*slash (longer)*/ 233 "\000", /*half narrow space*/ 234 "\001 ", /*unpaddable space*/ 235 "\201o\b(", /*alpha*/ 236 "\2018\b|", /*beta*/ 237 "\201>\b/", /*gamma*/ 238 "\201d\b`", /*delta*/ 239 "\201C\b-", /*epsilon*/ 240 "\000\0", /*zeta*/ 241 "\201n", /*eta*/ 242 "\201o\b-", /*theta*/ 243 "\201i", /*iota*/ 244 "\201k", /*kappa*/ 245 "\201,\b\\", /*lambda*/ 246 "\201u", /*mu*/ 247 "\201v", /*nu*/ 248 "\000\0", /*xi*/ 249 "\201o", /*omicron*/ 250 "\202i\b~i\b~", /*pi*/ 251 "\201p", /*rho*/ 252 "\201o\b~", /*sigma*/ 253 "\201i\b~", /*tau*/ 254 "\201u", /*upsilon*/ 255 "\201o\b|", /*phi*/ 256 "\201x", /*chi*/ 257 "\201u\b|", /*psi*/ 258 "\201w", /*omega*/ 259 "\201I\b~", /*Gamma*/ 260 "\202/\b_\\\b_", /*Delta*/ 261 "\201O\b-", /*Theta*/ 262 "\202/\\", /*Lambda*/ 263 "\201=\b_", /*Xi*/ 264 "\202TT", /*Pi*/ 265 "\201>\b_\b~", /*Sigma*/ 266 "\000", /**/ 267 "\201Y", /*Upsilon*/ 268 "\201O\b|", /*Phi*/ 269 "\201U\b|", /*Psi*/ 270 "\201O\b_", /*Omega*/ 271 "\001v\b/", /*square root*/ 272 "\000\0", /*terminal sigma*/ 273 "\001~", /*root en*/ 274 "\001>\b_", /*>=*/ 275 "\001<\b_", /*<=*/ 276 "\001=\b_", /*identically equal*/ 277 "\001-", /*equation minus*/ 278 "\001~\b_", /*approx =*/ 279 "\001~", /*approximates*/ 280 "\001=\b/", /*not equal*/ 281 "\002->", /*right arrow*/ 282 "\002<-", /*left arrow*/ 283 "\001|\b^", /*up arrow*/ 284 "\001|\bv", /*down arrow*/ 285 "\001=", /*equation equal*/ 286 "\001x", /*multiply*/ 287 "\001:\b-", /*divide*/ 288 "\001+\b_", /*plus-minus*/ 289 "\002(\b~)\b~", /*cup (union)*/ 290 "\002(\b_)\b_", /*cap (intersection)*/ 291 "\002(=", /*subset of*/ 292 "\002=)", /*superset of*/ 293 "\002(=\b_", /*improper subset*/ 294 "\002=\b_)", /*improper superset*/ 295 "\002oo", /*infinity*/ 296 "\001o\b`", /*partial derivative*/ 297 "\002\\\b~/\b~", /*gradient*/ 298 "\000\0", /*not*/ 299 "\000\0", /*integral sign*/ 300 "\002oc", /*proportional to*/ 301 "\001O\b/", /*empty set*/ 302 "\001<\b-", /*member of*/ 303 "\001+", /*equation plus*/ 304 "\003(R)", /*registered*/ 305 "\003(C)", /*copyright*/ 306 "\001|", /*box rule */ 307 "\001c\b/", /*cent sign*/ 308 "\001|\b=", /*dbl dagger*/ 309 "\002=>", /*right hand*/ 310 "\002<=", /*left hand*/ 311 "\001*", /*math * */ 312 "\000\0", /*bell system sign*/ 313 "\001|", /*or (was star)*/ 314 "\001O", /*circle*/ 315 "\001|", /*left top of big brace*/ 316 "\001|", /*left bot of big brace*/ 317 "\001|", /*right top of big brace*/ 318 "\001|", /*right bot of big brace*/ 319 "\001|", /*left center of big brace*/ 320 "\001|", /*right center of big brace*/ 321 "\001|", /*bold vertical*/ 322 "\001|", /*left floor (lb of big bracket)*/ 323 "\001|", /*right floor (rb of big bracket)*/ 324 "\001|", /*left ceiling (lt of big bracket)*/ 325 "\001|", /*right ceiling (rt of big bracket)*/ 326 "\201\241", /*(a1) activate 8 bit passing*/ 327 "\000\253", /*(ab) 8bit: bit is 0*/ 328 "\000\273", /*(bb) 8bit: bit is 1*/ 329 }, 330 0 331 }; 332