home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / tn3270 / api / asc_ebc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-26  |  5.1 KB  |  111 lines

  1. /*-
  2.  * Copyright (c) 1988 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  */
  33.  
  34. #ifndef lint
  35. static char sccsid[] = "@(#)asc_ebc.c    4.2 (Berkeley) 4/26/91";
  36. #endif /* not lint */
  37.  
  38. /*
  39.  * Ascii<->Ebcdic translation tables.
  40.  */
  41.  
  42. #include "asc_ebc.h"
  43.  
  44. unsigned char asc_ebc[NASCII]    = {
  45.  
  46. /* 00 */   0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
  47. /* 08 */   0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
  48. /* 10 */   0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
  49. /* 18 */   0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
  50. /* 20 */   0x40,  0x5A,  0x7F,  0x7B,  0x5B,  0x6C,  0x50,  0x7D,
  51. /* 28 */   0x4D,  0x5D,  0x5C,  0x4E,  0x6B,  0x60,  0x4B,  0x61,
  52. /* 30 */   0xF0,  0xF1,  0xF2,  0xF3,  0xF4,  0xF5,  0xF6,  0xF7,
  53. /* 38 */   0xF8,  0xF9,  0x7A,  0x5E,  0x4C,  0x7E,  0x6E,  0x6F,
  54. /* 40 */   0x7C,  0xC1,  0xC2,  0xC3,  0xC4,  0xC5,  0xC6,  0xC7,
  55. /* 48 */   0xC8,  0xC9,  0xD1,  0xD2,  0xD3,  0xD4,  0xD5,  0xD6,
  56. /* 50 */   0xD7,  0xD8,  0xD9,  0xE2,  0xE3,  0xE4,  0xE5,  0xE6,
  57. /* 58 */   0xE7,  0xE8,  0xE9,  0xAD,  0xE0,  0xBD,  0x5F,  0x6D,
  58. /* 60 */   0x79,  0x81,  0x82,  0x83,  0x84,  0x85,  0x86,  0x87,
  59. /* 68 */   0x88,  0x89,  0x91,  0x92,  0x93,  0x94,  0x95,  0x96,
  60. /* 70 */   0x97,  0x98,  0x99,  0xA2,  0xA3,  0xA4,  0xA5,  0xA6,
  61. /* 78 */   0xA7,  0xA8,  0xA9,  0xC0,  0x4F,  0xD0,  0xA1,  0x00,
  62.  
  63. };
  64.  
  65. /*
  66.  * ebcdic to ascii translation tables
  67.  */
  68.  
  69. unsigned char    ebc_asc[NEBC] = {
  70. /* 00 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  71. /* 08 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  72. /* 10 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  73. /* 18 */   ' ',  ' ',  ' ',  ' ',  '*',  ' ',  ';',  ' ',
  74. /* 20 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  75. /* 28 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  76. /* 30 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  77. /* 38 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  78. /* 40 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  79.  
  80. /* 48 */   ' ',  ' ', 
  81. #if    !defined(MSDOS)
  82.         /* 4A */       '\\',
  83. #else    /* !defined(MSDOS) */
  84.         /* 4A */       '\233',        /* PC cent sign */
  85. #endif    /* !defined(MSDOS) */
  86.         /* 4B */              '.',  '<',  '(',  '+',  '|',
  87.  
  88. /* 50 */   '&',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  89. /* 58 */   ' ',  ' ',  '!',  '$',  '*',  ')',  ';',  '^',
  90. /* 60 */   '-',  '/',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  91. /* 68 */   ' ',  ' ',  '|',  ',',  '%',  '_',  '>',  '?',
  92. /* 70 */   ' ',  '^',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  93. /* 78 */   ' ',  '`',  ':',  '#',  '@', '\'',  '=',  '"',
  94. /* 80 */   ' ',  'a',  'b',  'c',  'd',  'e',  'f',  'g',
  95. /* 88 */   'h',  'i',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  96. /* 90 */   ' ',  'j',  'k',  'l',  'm',  'n',  'o',  'p',
  97. /* 98 */   'q',  'r',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  98. /* A0 */   ' ',  '~',  's',  't',  'u',  'v',  'w',  'x',
  99. /* A8 */   'y',  'z',  ' ',  ' ',  ' ',  '[',  ' ',  ' ',
  100. /* B0 */   ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  101. /* B8 */   ' ',  ' ',  ' ',  ' ',  ' ',  ']',  ' ',  ' ',
  102. /* C0 */   '{',  'A',  'B',  'C',  'D',  'E',  'F',  'G',
  103. /* C8 */   'H',  'I',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  104. /* D0 */   '}',  'J',  'K',  'L',  'M',  'N',  'O',  'P',
  105. /* D8 */   'Q',  'R',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  106. /* E0 */  '\\',  ' ',  'S',  'T',  'U',  'V',  'W',  'X',
  107. /* E8 */   'Y',  'Z',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  108. /* F0 */   '0',  '1',  '2',  '3',  '4',  '5',  '6',  '7',
  109. /* F8 */   '8',  '9',  ' ',  ' ',  ' ',  ' ',  ' ',  ' ',
  110. };
  111.