lrdriver.h

Go to the documentation of this file.
00001 /*  X-1
00002 **
00003 **   Copyright © Digital Equipment Corporation, 1994  All Rights Reserved.
00004 **   Unpublished rights reserved under the copyright laws of the United States.
00005 **
00006 **   The software contained on this media is proprietary to and embodies the
00007 **   confidential technology of Digital Equipment Corporation.  Possession, use,
00008 **   duplication or dissemination of the software and media is authorized only
00009 **   pursuant to a valid written license from Digital Equipment Corporation.
00010 **
00011 **   RESTRICTED RIGHTS LEGEND   Use, duplication, or disclosure by the U.S.
00012 **   Government is subject to restrictions as set forth in Subparagraph
00013 **   (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable.
00014 **
00015 **
00016 **++
00017 **  FACILITY:  DRIVER 
00018 **
00019 **  MODULE DESCRIPTION:
00020 **
00021 **      This module contains the fallback table remapping for DEC Multinational
00022 ** Character Set "MCS".
00023 **
00024 **  AUTHOR:
00025 **
00026 **      Forrest A. Kenney
00027 **
00028 **  CREATION DATE:  20-July-1994
00029 **
00030 **  MODIFICATION HISTORY:
00031 **
00032 **
00033 **--
00034 */
00035 
00036 
00037 /*
00038 *+
00039 *       Build up a table with the whole ASCII 8-Bit character set.  This table
00040 * is used to translate 8-Bit characters to 7-Bit characters if the printer is 
00041 * doing character fallback translation.  This only exists for to keep the
00042 * printer code equivalent to that in the old LP11 interface.  Any modern
00043 * printer that is likely to be controlled by LRDRIVER should be capable of
00044 * deaing with 8-Bit characters.
00045 *-
00046 */
00047 static unsigned char    TRANS_TABLE[256] =  { 
00048 '\x00',         /* NUL   */
00049 '\x01',         /* SOH   */
00050 '\x02',         /* STX   */
00051 '\x03',         /* ETX   */
00052 '\x04',         /* EOT   */
00053 '\x05',         /* ENQ   */
00054 '\x06',         /* ACK   */
00055 '\x07',         /* BEL   */
00056 '\x08',         /* BS    */
00057 '\x09',         /* HT    */
00058 '\x0A',         /* LF    */
00059 '\x0B',         /* VT    */
00060 '\x0C',         /* FF    */
00061 '\x0D',         /* CR    */
00062 '\x0E',         /* SO    */
00063 '\x0F',         /* SI    */
00064 '\x10',         /* DLE   */
00065 '\x11',         /* DC1   */
00066 '\x12',         /* DC2   */
00067 '\x13',         /* DC3   */
00068 '\x14',         /* DC4   */
00069 '\x15',         /* NAK   */
00070 '\x16',         /* SYN   */
00071 '\x17',         /* ETB   */
00072 '\x18',         /* CAN   */
00073 '\x19',         /* EM    */
00074 '\x1A',         /* SUB   */
00075 '\x1B',         /* ESC   */
00076 '\x1C',         /* FS    */
00077 '\x1D',         /* GS    */
00078 '\x1E',         /* RS    */
00079 '\x1F',         /* US    */
00080 '\x20',         /* SP    */
00081 '\x21',         /* !     */
00082 '\x22',         /* "     */
00083 '\x23',         /* #     */
00084 '\x24',         /* $     */
00085 '\x25',         /* %     */
00086 '\x26',         /* &     */
00087 '\x27',         /* '     */
00088 '\x28',         /* (     */
00089 '\x29',         /* )     */
00090 '\x2A',         /* *     */
00091 '\x2B',         /* +     */
00092 '\x2C',         /* ,     */
00093 '\x2D',         /* -     */
00094 '\x2E',         /* .     */
00095 '\x2F',         /* /     */
00096 '\x30',         /* 0     */
00097 '\x31',         /* 1     */
00098 '\x32',         /* 2     */
00099 '\x33',         /* 3     */
00100 '\x34',         /* 4     */
00101 '\x35',         /* 5     */
00102 '\x36',         /* 6     */
00103 '\x37',         /* 7     */
00104 '\x38',         /* 8     */
00105 '\x39',         /* 9     */
00106 '\x3A',         /* :     */
00107 '\x3B',         /* ;     */
00108 '\x3C',         /* <     */
00109 '\x3D',         /* =     */
00110 '\x3E',         /* >     */
00111 '\x3F',         /* ?     */
00112 '\x40',         /* @     */
00113 '\x41',         /* A     */
00114 '\x42',         /* B     */
00115 '\x43',         /* C     */
00116 '\x44',         /* D     */
00117 '\x45',         /* E     */
00118 '\x46',         /* F     */
00119 '\x47',         /* G     */
00120 '\x48',         /* H     */
00121 '\x49',         /* I     */
00122 '\x4A',         /* J     */
00123 '\x4B',         /* K     */
00124 '\x4C',         /* L     */
00125 '\x4D',         /* M     */
00126 '\x4E',         /* N     */
00127 '\x4F',         /* O     */
00128 '\x50',         /* P     */
00129 '\x51',         /* Q     */
00130 '\x52',         /* R     */
00131 '\x53',         /* S     */
00132 '\x54',         /* T     */
00133 '\x55',         /* U     */
00134 '\x56',         /* V     */
00135 '\x57',         /* W     */
00136 '\x58',         /* X     */
00137 '\x59',         /* Y     */
00138 '\x5A',         /* Z     */
00139 '\x5B',         /* [     */
00140 '\x5C',         /* \     */
00141 '\x5D',         /* ]     */
00142 '\x5E',         /* ^     */
00143 '\x5F',         /* _     */
00144 '\x60',         /* `     */
00145 '\x61',         /* a     */
00146 '\x62',         /* b     */
00147 '\x63',         /* c     */
00148 '\x64',         /* d     */
00149 '\x65',         /* e     */
00150 '\x66',         /* f     */
00151 '\x67',         /* g     */
00152 '\x68',         /* h     */
00153 '\x69',         /* i     */
00154 '\x6A',         /* j     */
00155 '\x6B',         /* k     */
00156 '\x6C',         /* l     */
00157 '\x6D',         /* m     */
00158 '\x6E',         /* n     */
00159 '\x6F',         /* o     */
00160 '\x70',         /* p     */
00161 '\x71',         /* q     */
00162 '\x72',         /* r     */
00163 '\x73',         /* s     */
00164 '\x74',         /* t     */
00165 '\x75',         /* u     */
00166 '\x76',         /* v     */
00167 '\x77',         /* w     */
00168 '\x78',         /* x     */
00169 '\x79',         /* y     */
00170 '\x7A',         /* z     */
00171 '\x7B',         /* {     */
00172 '\x7C',         /* |     */
00173 '\x7D',         /* }     */
00174 '\x7E',         /* ~     */
00175 '\x7F',         /* DEL   */
00176 '\x5F',         /*     80 */ /* Remap most of the C1/GR codes to _ */
00177 '\x5F',         /*     81 */
00178 '\x5F',         /*     82 */
00179 '\x5F',         /*     83 */
00180 '\x5F',         /* IND 84 */
00181 '\x5F',         /* NEL 85 */
00182 '\x5F',         /* SSA 86 */
00183 '\x5F',         /* ESA 87 */
00184 '\x5F',         /* HTS 88 */
00185 '\x5F',         /* HTJ 89 */
00186 '\x5F',         /* VTS 8A */
00187 '\x5F',         /* PLD 8B */
00188 '\x5F',         /* PLU 8C */
00189 '\x5F',         /* RI  8D */
00190 '\x5F',         /* SS2 8E */
00191 '\x5F',         /* SS3 8F */
00192 '\x5F',         /* DCS 90 */
00193 '\x5F',         /* PU1 91 */
00194 '\x5F',         /* PU2 92 */
00195 '\x5F',         /* STS 93 */
00196 '\x5F',         /* CCH 94 */
00197 '\x5F',         /* MW  95 */
00198 '\x5F',         /* SPA 96 */
00199 '\x5F',         /* EPA 97 */
00200 '\x5F',         /*     98 */
00201 '\x5F',         /*     99 */
00202 '\x5F',         /*     9A */
00203 '\x5F',         /* CSI 9B */
00204 '\x5F',         /* ST  9C */
00205 '\x5F',         /* OSC 9D */
00206 '\x5F',         /* PM  9E */
00207 '\x5F',         /* APC 9F */
00208 '\x5F',         /*     A0 */
00209 '\x21',         /* ¡   A1 */
00210 '\x63',         /* ¢   A2 */
00211 '\x4C',         /* £   A3 */
00212 '\x5F',         /*     A4 */
00213 '\x59',         /* ¥   A5 */
00214 '\x5F',         /*     A6 */
00215 '\x5F',         /* §   A7 */
00216 '\x4F',         /* ¨   A8 */
00217 '\x5F',         /* ©   A9 */
00218 '\x61',         /* ª   AA */
00219 '\x5F',         /* «   AB */
00220 '\x5F',         /*     AC */
00221 '\x5F',         /*     AD */
00222 '\x5F',         /*     AE */
00223 '\x5F',         /*     AF */
00224 '\x6F',         /* Ô   B0 */
00225 '\x2B',         /* ±   B1 */
00226 '\x32',         /* ²   B2 */
00227 '\x33',         /* ³   B3 */
00228 '\x5F',         /*     B4 */
00229 '\x75',         /* µ   B5 */
00230 '\x5F',         /* ¶   B6 */
00231 '\x2E',         /* ·   B7 */
00232 '\x5F',         /*     B8 */
00233 '\x31',         /* ¹   B9 */
00234 '\x6F',         /* º   BA */
00235 '\x5F',         /* »   BB */
00236 '\x5F',         /* ¼   BC */
00237 '\x5F',         /* ½   BD */
00238 '\x5F',         /*     BE */
00239 '\x3F',         /* ¿   BF */
00240 '\x41',         /* À   C0 */
00241 '\x41',         /* Á   C1 */
00242 '\x41',         /* Â   C2 */
00243 '\x41',         /* Ã   C3 */
00244 '\x41',         /* Ä   C4 */
00245 '\x41',         /* Å   C5 */
00246 '\x5F',         /* Æ   C6 */
00247 '\x43',         /* Ç   C7 */
00248 '\x45',         /* È   C8 */
00249 '\x45',         /* É   C9 */
00250 '\x45',         /* Ê   CA */
00251 '\x45',         /* Ë   CB */
00252 '\x49',         /* Ì   CC */
00253 '\x49',         /* Í   CD */
00254 '\x49',         /* Î   CE */
00255 '\x49',         /* Ï   CF */
00256 '\x5F',         /*     D0 */
00257 '\x4E',         /* Ñ   D1 */
00258 '\x4F',         /* ò   D2 */
00259 '\x4F',         /* Ó   D3 */
00260 '\x4F',         /* Ô   D4 */
00261 '\x4F',         /* Õ   D5 */
00262 '\x4F',         /* Ö   D6 */
00263 '\x5F',         /* ×   D7 */
00264 '\x4F',         /* Ø   D8 */
00265 '\x55',         /* Ù   D9 */
00266 '\x55',         /* Ú   DA */
00267 '\x55',         /* Û   DB */
00268 '\x55',         /* Ü   DC */
00269 '\x59',         /* Ý   DD */
00270 '\x5F',         /*     DE */
00271 '\x5F',         /* ß   DF */
00272 '\x61',         /* à   E0 */
00273 '\x61',         /* á   E1 */
00274 '\x61',         /* â   E2 */
00275 '\x61',         /* ã   E3 */
00276 '\x61',         /* ä   E4 */
00277 '\x61',         /* å   E5 */
00278 '\x5F',         /* æ   E6 */
00279 '\x5F',         /* ç   E7 */
00280 '\x65',         /* è   E8 */
00281 '\x65',         /* é   E9 */
00282 '\x65',         /* ê   EA */
00283 '\x65',         /* ë   EB */
00284 '\x69',         /* ì   EC */
00285 '\x69',         /* í   ED */
00286 '\x69',         /* î   EE */
00287 '\x69',         /* ï   EF */
00288 '\x5F',         /*     F0 */
00289 '\x6E',         /* ñ   F1 */
00290 '\x6F',         /* ò   F2 */
00291 '\x6F',         /* ó   F3 */
00292 '\x6F',         /* ô   F4 */
00293 '\x6F',         /* õ   F5 */
00294 '\x6F',         /* ö   F6 */
00295 '\x5F',         /* ÷   F7 */
00296 '\x6F',         /* ø   F8 */
00297 '\x75',         /* ù   F9 */
00298 '\x75',         /* ú   FA */
00299 '\x75',         /* û   FB */
00300 '\x75',         /* ü   FC */
00301 '\x79',         /* ý   FD */
00302 '\x5F',         /*     FE */
00303 '\x5F',         /*     FF */
00304 };
00305 
00306 
00307 /*
00308 *+
00309 *       Define chrarcter that can be translated to uppercase by subtracting
00310 * 32 from their value.  These are "a" through "{", "}", "à" through "ï", and 
00311 * "ñ" through "ý".
00312 *-
00313 */
00314 static unsigned int CASE_TABLE[8] = {0, 0, 0, 0x2FFFFFFE, 0, 0, 0, 0x3FFEFFFF};
00315 
00316 
00317 /*
00318 *+
00319 *       Define those characters that cannot be printed.
00320 *-
00321 */
00322 static unsigned int CTRL_TABLE[8] = {0xFFFFFFFF, 0, 0, 0x80000000, 0xFFFFFFFF, 0, 0, 0};

SourceForge.net Logo
Project space on SourceForge.net