home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / ldterm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  16.7 KB  |  413 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_LDTERM_H
  11. #define _SYS_LDTERM_H
  12.  
  13. #ident    "@(#)/usr/include/sys/ldterm.h.sl 1.1 4.0 12/08/90 56242 AT&T-USL"
  14.  
  15. #include <sys/emap.h>
  16. #define    IBSIZE    16        /* "standard" input data block size */
  17. #define    OBSIZE    64        /* "standard" output data block size */
  18. #define    EBSIZE    16        /* "standard" echo data block size */
  19.  
  20. #ifndef MIN
  21. #define    MIN(a,b) (((a)<(b))?(a):(b))
  22. #endif
  23.  
  24. #define V_MIN         (char) tp->t_modes.c_cc[VMIN]
  25. #define V_TIME        (char) tp->t_modes.c_cc[VTIME]
  26. #define RAW_MODE    !(tp->t_modes.c_lflag & ICANON)
  27. #define CANON_MODE    (tp->t_modes.c_lflag & ICANON)
  28.  
  29. /*
  30.  * The following for EUC.
  31.  */
  32.  
  33. #define EUCSIZE    sizeof(struct eucioc)
  34. #define EUCIN    0    /* copying eucioc_t IN from ioctl */
  35. #define EUCOUT    1    /* copying it OUT to user format */
  36.  
  37. /*
  38.  * One assumption made throughout this module is:  EUC characters have
  39.  * a display width less than 255.  Also, assumed around, is that they
  40.  * consist of < 256 bytes, but we don't worry much about that.
  41.  */
  42.  
  43. #define EUC_TWIDTH    255    /* Width of a TAB, as returned by "ldterm_dispwidth" */
  44. #define EUC_BSWIDTH    254    /* Width of a backspace as returned */
  45. #define EUC_NLWIDTH    253    /* newline & cr */
  46. #define EUC_CRWIDTH    252
  47. #define EUC_MAXW    4    /* max display width and memory width, both */
  48. #define EUC_WARNCNT    20    /* # bad EUC erase attempts before hollering */
  49.  
  50. typedef struct ldterm_mod {
  51.     mblk_t    *t_savbp;    /* saved mblk that holds ld struct */
  52.     struct termios t_modes;    /* Effective modes set by the provider below */
  53.     struct termios t_amodes;/* Apparent modes for user programs */
  54.     struct termios t_dmodes;/* Modes that driver wishes to process */
  55.     unsigned long t_state;    /* internal state of ldterm module */
  56.     int    t_line;        /* output line of tty */
  57.     int    t_col;        /* output column of tty */
  58.     int    t_rocount;    /* number of chars echoed since last output */
  59.     int    t_rocol;    /* column in which first such char appeared */
  60.     mblk_t    *t_message;    /* pointer to first mblk in message being built */
  61.     mblk_t    *t_endmsg;    /* pointer to last mblk in that message */
  62.     int    t_msglen;    /* number of characters in that message */
  63.     mblk_t    *t_echomp;    /* echoed output being assembled */
  64.     int    t_rd_request;   /* Number of bytes requested by M_READ during
  65.                  * vmin/vtime read
  66.                  */
  67.     int    t_tid;        /* vtime timer id */
  68.     /*
  69.      * The following are for EUC processing. 
  70.      */
  71.     unchar    t_codeset;    /* current code set indicator (read side) */
  72.     unchar    t_eucleft;    /* bytes left to get in current char (read) */
  73.     unchar    t_eucign;    /* bytes left to ignore (output post proc) */
  74.     unchar    t_eucpad;    /* padding ... for eucwioc */
  75.     eucioc_t eucwioc;    /* eucioc structure (have to use bcopy) */
  76.     unchar    *t_eucp;    /* ptr to parallel array of column widths */
  77.     mblk_t    *t_eucp_mp;    /* the m_blk that holds parallel array */
  78.     unchar    t_maxeuc;    /* the max length in memory bytes of an EUC */
  79.     int    t_eucwarn;    /* bad EUC counter */
  80.     struct emp_tty t_emap;    /* XENIX character mapping info */
  81. } ldtermstd_state_t;
  82.  
  83. /*
  84.  * Internal state bits.
  85.  */
  86. #define    TS_XCLUDE    0x00000001    /* exclusive-use flag against open */
  87. #define    TS_TTSTOP    0x00000002    /* output stopped by ^S */
  88. #define    TS_TBLOCK    0x00000004    /* input stopped by IXOFF mode */
  89. #define    TS_QUOT        0x00000008    /* last character input was \ */
  90. #define    TS_ERASE    0x00000010    /* within a \.../ for PRTRUB */
  91. #define    TS_SLNCH    0x00000020    /* next character service routine sees is literal */
  92. #define    TS_PLNCH    0x00000040    /* next character put routine sees is literal */
  93.  
  94. #define TS_TTCR        0x00000080    /* mapping NL to CR-NL */
  95. #define    TS_NOCANON    0x00000100    /* canonicalization done by somebody below us */
  96. #define    TS_RESCAN    0x00000400    /* canonicalization mode changed, rescan input queue */
  97. #define    TS_RTO        0x00000800    /* timer started for vmin/vtime */
  98. #define    TS_TACT        0x00001000    /* timer active for vmin/vtime */
  99. #define TS_MEUC        0x00010000    /* TRUE if multi-byte codesets used */
  100. #define TS_WARNED    0x00020000    /* already warned on console */
  101. #define TS_CLOSE    0x00040000    /* close in progress */
  102.  
  103.  
  104.  
  105. /*
  106.  * Character types.
  107.  */
  108. #define    ORDINARY    0
  109. #define    CONTROL        1
  110. #define    BACKSPACE    2
  111. #define    NEWLINE        3
  112. #define    TAB        4
  113. #define    VTAB        5
  114. #define    RETURN        6
  115.  
  116. /*
  117.  * The following for EUC handling:
  118.  */
  119. #define T_SS2        7
  120. #define T_SS3        8
  121.  
  122. /*
  123.  * Table indicating character classes to tty driver.  In particular,
  124.  * if the class is ORDINARY, then the character needs no special
  125.  * processing on output.
  126.  *
  127.  * Characters in the C1 set are all considered CONTROL; this will
  128.  * work with terminals that properly use the ANSI/ISO extensions,
  129.  * but might cause distress with terminals that put graphics in
  130.  * the range 0200-0237.  On the other hand, characters in that
  131.  * range cause even greater distress to other UNIX terminal drivers....
  132.  */
  133.  
  134. static char typetab[256] = {
  135. /* 000 */     CONTROL,    CONTROL,    CONTROL,    CONTROL,
  136. /* 004 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  137. /* 010 */    BACKSPACE,    TAB,        NEWLINE,    CONTROL,
  138. /* 014 */    VTAB,        RETURN,        CONTROL,    CONTROL,
  139. /* 020 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  140. /* 024 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  141. /* 030 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  142. /* 034 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  143. /* 040 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  144. /* 044 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  145. /* 050 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  146. /* 054 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  147. /* 060 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  148. /* 064 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  149. /* 070 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  150. /* 074 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  151. /* 100 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  152. /* 104 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  153. /* 110 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  154. /* 114 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  155. /* 120 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  156. /* 124 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  157. /* 130 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  158. /* 134 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  159. /* 140 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  160. /* 144 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  161. /* 150 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  162. /* 154 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  163. /* 160 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  164. /* 164 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  165. /* 170 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  166. /* 174 */    ORDINARY,    ORDINARY,    ORDINARY,    CONTROL,
  167. /* 200 */     CONTROL,    CONTROL,    CONTROL,    CONTROL,
  168. /* 204 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  169. /* 210 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  170. /* 214 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  171. /* 220 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  172. /* 224 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  173. /* 230 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  174. /* 234 */    CONTROL,    CONTROL,    CONTROL,    CONTROL,
  175. /* 240 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  176. /* 244 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  177. /* 250 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  178. /* 254 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  179. /* 260 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  180. /* 264 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  181. /* 270 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  182. /* 274 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  183. /* 300 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  184. /* 304 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  185. /* 310 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  186. /* 314 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  187. /* 320 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  188. /* 324 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  189. /* 330 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  190. /* 334 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  191. /* 340 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  192. /* 344 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  193. /* 350 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  194. /* 354 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  195. /* 360 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  196. /* 364 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  197. /* 370 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  198. /*
  199.  * WARNING:  For EUC, 0xFF must be an ordinary character.  It is used with
  200.  * single-byte EUC in some of the "ISO Latin Alphabet" codesets, and occupies
  201.  * a screen position; in those ISO sets where that position isn't used, it
  202.  * shouldn't make any difference.
  203.  */
  204. /* 374 */    ORDINARY,    ORDINARY,    ORDINARY,    ORDINARY,
  205. };
  206.  
  207. /*
  208.  * Translation table for output without OLCUC.  All ORDINARY-class characters
  209.  * translate to themselves.  All other characters have a zero in the table,
  210.  * which stops the copying.
  211.  */
  212. static unsigned char notrantab[256] = {
  213. /* 000 */    0,    0,    0,    0,    0,    0,    0,    0,
  214. /* 010 */    0,    0,    0,    0,    0,    0,    0,    0,
  215. /* 020 */    0,    0,    0,    0,    0,    0,    0,    0,
  216. /* 030 */    0,    0,    0,    0,    0,    0,    0,    0,
  217. /* 040 */    ' ',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
  218. /* 050 */    '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
  219. /* 060 */    '0',    '1',    '2',    '3',    '4',    '5',    '6',    '7',
  220. /* 070 */    '8',    '9',    ':',    ';',    '<',    '=',    '>',    '?',
  221. /* 100 */    '@',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  222. /* 110 */    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  223. /* 120 */    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  224. /* 130 */    'X',    'Y',    'Z',    '[',    '\\',    ']',    '^',    '_',
  225. /* 140 */    '`',    'a',    'b',    'c',    'd',    'e',    'f',    'g',
  226. /* 150 */    'h',    'i',    'j',    'k',    'l',    'm',    'n',    'o',
  227. /* 160 */    'p',    'q',    'r',    's',    't',    'u',    'v',    'w',
  228. /* 170 */    'x',    'y',    'z',    '{',    '|',    '}',    '~',    0,
  229. /* 200 */    0,    0,    0,    0,    0,    0,    0,    0,
  230. /* 210 */    0,    0,    0,    0,    0,    0,    0,    0,
  231. /* 220 */    0,    0,    0,    0,    0,    0,    0,    0,
  232. /* 230 */    0,    0,    0,    0,    0,    0,    0,    0,
  233. /* 240 */    0240,    0241,    0242,    0243,    0244,    0245,    0246,    0247,
  234. /* 250 */    0250,    0251,    0252,    0253,    0254,    0255,    0256,    0257,
  235. /* 260 */    0260,    0261,    0262,    0263,    0264,    0265,    0266,    0267,
  236. /* 270 */    0270,    0271,    0272,    0273,    0274,    0275,    0276,    0277,
  237. /* 300 */    0300,    0301,    0302,    0303,    0304,    0305,    0306,    0307,
  238. /* 310 */    0310,    0311,    0312,    0313,    0314,    0315,    0316,    0317,
  239. /* 320 */    0320,    0321,    0322,    0323,    0324,    0325,    0326,    0327,
  240. /* 330 */    0330,    0331,    0332,    0333,    0334,    0335,    0336,    0337,
  241. /* 340 */    0340,    0341,    0342,    0343,    0344,    0345,    0346,    0347,
  242. /* 350 */    0350,    0351,    0352,    0353,    0354,    0355,    0356,    0357,
  243. /* 360 */    0360,    0361,    0362,    0363,    0364,    0365,    0366,    0367,
  244. /*
  245.  * WARNING: as for above ISO sets, 0377 may be used.  Translate it to
  246.  * itself.
  247.  */
  248. /* 370 */    0370,    0371,    0372,    0373,    0374,    0375,    0376,    0377,
  249. };
  250.  
  251. /*
  252.  * Translation table for output with OLCUC.  All ORDINARY-class characters
  253.  * translate to themselves, except for lower-case letters which translate
  254.  * to their upper-case equivalents.  All other characters have a zero in
  255.  * the table, which stops the copying.
  256.  */
  257. static unsigned char lcuctab[256] = {
  258. /* 000 */    0,    0,    0,    0,    0,    0,    0,    0,
  259. /* 010 */    0,    0,    0,    0,    0,    0,    0,    0,
  260. /* 020 */    0,    0,    0,    0,    0,    0,    0,    0,
  261. /* 030 */    0,    0,    0,    0,    0,    0,    0,    0,
  262. /* 040 */    ' ',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
  263. /* 050 */    '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
  264. /* 060 */    '0',    '1',    '2',    '3',    '4',    '5',    '6',    '7',
  265. /* 070 */    '8',    '9',    ':',    ';',    '<',    '=',    '>',    '?',
  266. /* 100 */    '@',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  267. /* 110 */    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  268. /* 120 */    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  269. /* 130 */    'X',    'Y',    'Z',    '[',    '\\',    ']',    '^',    '_',
  270. /* 140 */    '`',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  271. /* 150 */    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  272. /* 160 */    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  273. /* 170 */    'X',    'Y',    'Z',    '{',    '|',    '}',    '~',    0,
  274. /* 200 */    0,    0,    0,    0,    0,    0,    0,    0,
  275. /* 210 */    0,    0,    0,    0,    0,    0,    0,    0,
  276. /* 220 */    0,    0,    0,    0,    0,    0,    0,    0,
  277. /* 230 */    0,    0,    0,    0,    0,    0,    0,    0,
  278. /* 240 */    0240,    0241,    0242,    0243,    0244,    0245,    0246,    0247,
  279. /* 250 */    0250,    0251,    0252,    0253,    0254,    0255,    0256,    0257,
  280. /* 260 */    0260,    0261,    0262,    0263,    0264,    0265,    0266,    0267,
  281. /* 270 */    0270,    0271,    0272,    0273,    0274,    0275,    0276,    0277,
  282. /* 300 */    0300,    0301,    0302,    0303,    0304,    0305,    0306,    0307,
  283. /* 310 */    0310,    0311,    0312,    0313,    0314,    0315,    0316,    0317,
  284. /* 320 */    0320,    0321,    0322,    0323,    0324,    0325,    0326,    0327,
  285. /* 330 */    0330,    0331,    0332,    0333,    0334,    0335,    0336,    0337,
  286. /* 340 */    0340,    0341,    0342,    0343,    0344,    0345,    0346,    0347,
  287. /* 350 */    0350,    0351,    0352,    0353,    0354,    0355,    0356,    0357,
  288. /* 360 */    0360,    0361,    0362,    0363,    0364,    0365,    0366,    0367,
  289. /*
  290.  * WARNING: as for above ISO sets, 0377 may be used.  Translate it to
  291.  * itself.
  292.  */
  293. /* 370 */    0370,    0371,    0372,    0373,    0374,    0375,    0376,    0377,
  294. };
  295.  
  296. /*
  297.  * Input mapping table -- if an entry is non-zero, and XCASE is set,
  298.  * when the corresponding character is typed preceded by "\" the escape
  299.  * sequence is replaced by the table value.  Mostly used for
  300.  * upper-case only terminals.
  301.  */
  302. static char    imaptab[256] = {
  303. /* 000 */    0,    0,    0,    0,    0,    0,    0,    0,
  304. /* 010 */    0,    0,    0,    0,    0,    0,    0,    0,
  305. /* 020 */    0,    0,    0,    0,    0,    0,    0,    0,
  306. /* 030 */    0,    0,    0,    0,    0,    0,    0,    0,
  307. /* 040 */    0,    '|',    0,    0,    0,    0,    0,    '`',
  308. /* 050 */    '{',    '}',    0,    0,    0,    0,    0,    0,
  309. /* 060 */    0,    0,    0,    0,    0,    0,    0,    0,
  310. /* 070 */    0,    0,    0,    0,    0,    0,    0,    0,
  311. /* 100 */    0,    0,    0,    0,    0,    0,    0,    0,
  312. /* 110 */    0,    0,    0,    0,    0,    0,    0,    0,
  313. /* 120 */    0,    0,    0,    0,    0,    0,    0,    0,
  314. /* 130 */    0,    0,    0,    0,    '\\',    0,    '~',    0,
  315. /* 140 */    0,    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  316. /* 150 */    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  317. /* 160 */    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  318. /* 170 */    'X',    'Y',    'Z',    0,    0,    0,    0,    0,
  319. /* 200-377 aren't mapped */
  320. };
  321.  
  322. /*
  323.  * Output mapping table -- if an entry is non-zero, and XCASE is set,
  324.  * the corresponding character is printed as "\" followed by the table
  325.  * value.  Mostly used for upper-case only terminals.
  326.  */
  327. static char    omaptab[256] = {
  328. /* 000 */    0,    0,    0,    0,    0,    0,    0,    0,
  329. /* 010 */    0,    0,    0,    0,    0,    0,    0,    0,
  330. /* 020 */    0,    0,    0,    0,    0,    0,    0,    0,
  331. /* 030 */    0,    0,    0,    0,    0,    0,    0,    0,
  332. /* 040 */    0,    0,    0,    0,    0,    0,    0,    0,
  333. /* 050 */    0,    0,    0,    0,    0,    0,    0,    0,
  334. /* 060 */    0,    0,    0,    0,    0,    0,    0,    0,
  335. /* 070 */    0,    0,    0,    0,    0,    0,    0,    0,
  336. /* 100 */    0,    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  337. /* 110 */    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  338. /* 120 */    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  339. /* 130 */    'X',    'Y',    'Z',    0,    0,    0,    0,    0,
  340. /* 140 */    '\'',    0,    0,    0,    0,    0,    0,    0,
  341. /* 150 */    0,    0,    0,    0,    0,    0,    0,    0,
  342. /* 160 */    0,    0,    0,    0,    0,    0,    0,    0,
  343. /* 170 */    0,    0,    0,    '(',    '!',    ')',    '^',    0,
  344. /* 200-377 aren't mapped */
  345. };
  346.  
  347. /*
  348.  * Translation table for TS_MEUC output without OLCUC.  All printing ASCII
  349.  * characters translate to themselves.  All other _bytes_ have a zero in
  350.  * the table, which stops the copying.  This and the following table exist
  351.  * only so we can use the existing movtuc processing with or without OLCUC.
  352.  * Maybe it speeds up something...because we can copy a block of characters
  353.  * by only looking for zeros in the table.
  354.  *
  355.  * If we took the simple expedient of DISALLOWING "olcuc" with multi-byte
  356.  * processing, we could rid ourselves of both these tables and save 512 bytes;
  357.  * seriously, it doesn't make much sense to use olcuc with multi-byte, and
  358.  * it will probably never be used.  Consideration should be given to disallowing
  359.  * the combination TS_MEUC & OLCUC.
  360.  */
  361. static unsigned char enotrantab[256] = {
  362. /* 000 */    0,    0,    0,    0,    0,    0,    0,    0,
  363. /* 010 */    0,    0,    0,    0,    0,    0,    0,    0,
  364. /* 020 */    0,    0,    0,    0,    0,    0,    0,    0,
  365. /* 030 */    0,    0,    0,    0,    0,    0,    0,    0,
  366. /* 040 */    ' ',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
  367. /* 050 */    '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
  368. /* 060 */    '0',    '1',    '2',    '3',    '4',    '5',    '6',    '7',
  369. /* 070 */    '8',    '9',    ':',    ';',    '<',    '=',    '>',    '?',
  370. /* 100 */    '@',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  371. /* 110 */    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  372. /* 120 */    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  373. /* 130 */    'X',    'Y',    'Z',    '[',    '\\',    ']',    '^',    '_',
  374. /* 140 */    '`',    'a',    'b',    'c',    'd',    'e',    'f',    'g',
  375. /* 150 */    'h',    'i',    'j',    'k',    'l',    'm',    'n',    'o',
  376. /* 160 */    'p',    'q',    'r',    's',    't',    'u',    'v',    'w',
  377. /* 170 */    'x',    'y',    'z',    '{',    '|',    '}',    '~',    0,
  378. /* 200 - 377 aren't mapped (they're stoppers). */
  379. };
  380.  
  381. /*
  382.  * Translation table for TS_MEUC output with OLCUC.  All printing ASCII
  383.  * translate to themselves, except for lower-case letters which translate
  384.  * to their upper-case equivalents.  All other bytes have a zero in
  385.  * the table, which stops the copying.  Useless for ISO Latin Alphabet
  386.  * translations, but *sigh* OLCUC is really only defined for ASCII anyway.
  387.  * We only have this table so we can use the existing OLCUC processing with
  388.  * TS_MEUC set (multi-byte mode).  Nobody would ever think of actually
  389.  * _using_ it...would they?
  390.  */
  391. static unsigned char elcuctab[256] = {
  392. /* 000 */    0,    0,    0,    0,    0,    0,    0,    0,
  393. /* 010 */    0,    0,    0,    0,    0,    0,    0,    0,
  394. /* 020 */    0,    0,    0,    0,    0,    0,    0,    0,
  395. /* 030 */    0,    0,    0,    0,    0,    0,    0,    0,
  396. /* 040 */    ' ',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
  397. /* 050 */    '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
  398. /* 060 */    '0',    '1',    '2',    '3',    '4',    '5',    '6',    '7',
  399. /* 070 */    '8',    '9',    ':',    ';',    '<',    '=',    '>',    '?',
  400. /* 100 */    '@',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  401. /* 110 */    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  402. /* 120 */    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  403. /* 130 */    'X',    'Y',    'Z',    '[',    '\\',    ']',    '^',    '_',
  404. /* 140 */    '`',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  405. /* 150 */    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  406. /* 160 */    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  407. /* 170 */    'X',    'Y',    'Z',    '{',    '|',    '}',    '~',    0,
  408. /* 200 - 377 aren't mapped (they're stoppers). */
  409. };
  410.  
  411.  
  412. #endif    /* _SYS_LDTERM_H */
  413.