ckcxla.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. /*
  2. File CKCXLA.H
  3. System-independent character-set translation header file for C-Kermit.
  4. */
  5. /*
  6. Author: Frank da Cruz <fdc@columbia.edu>,
  7. The Kermit Project - Columbia University, New York City.
  8. Copyright (C) 1985, 2009,
  9. Trustees of Columbia University in the City of New York.
  10. All rights reserved. See the C-Kermit COPYING.TXT file or the
  11. copyright text in the ckcmai.c module for disclaimer and permissions.
  12. */
  13. /*
  14. NOTE:
  15. ISO 204 is Latin-1 + Euro.
  16. ISO 205 is Latin-4 + Euro.
  17. ISO 206 is Latin-7 + Euro.
  18. */
  19. #ifndef CKCXLA_H /* Guard against multiple inclusion */
  20. #define CKCXLA_H
  21. #ifndef KANJI /* Systems supporting Kanji */
  22. #ifdef OS2
  23. #define KANJI
  24. #endif /* OS2 */
  25. #endif /* KANJI */
  26. #ifdef NOKANJI /* Except if NOKANJI is defined. */
  27. #ifdef KANJI
  28. #undef KANJI
  29. #endif /* KANJI */
  30. #endif /* NOKANJI */
  31. #ifndef NOUNICODE
  32. #ifndef UNICODE /* Unicode support */
  33. #ifdef OS2ORUNIX /* Only for K95, UNIX, VMS,... */
  34. #define UNICODE
  35. #else
  36. #ifdef VMS
  37. #define UNICODE
  38. #endif /* VMS */
  39. #endif /* OS2ORUNIX */
  40. #endif /* UNICODE */
  41. #endif /* NOUNICODE */
  42. #define XLA_NONE 0 /* Translation types - none */
  43. #define XLA_BYTE 1 /* Byte-for-byte */
  44. #define XLA_JAPAN 2 /* Japanese */
  45. #define XLA_UNICODE 3 /* Unicode */
  46. #ifndef UNIORKANJI /* Unicode OR Kanji */
  47. #ifdef UNICODE /* i.e. some support for */
  48. #define UNIORKANJI /* multibyte character sets */
  49. #endif /* UNICODE */
  50. #ifdef KANJI
  51. #define UNIORKANJI
  52. #endif /* KANJI */
  53. #endif /* UNIORKANJI */
  54. /*
  55. Disable all support for all classes of character sets
  56. if NOCSETS is defined.
  57. */
  58. #ifdef NOCSETS
  59. #ifdef CKOUNI
  60. #undef CKOUNI
  61. #endif /* CKOUNI */
  62. #ifdef KANJI
  63. #undef KANJI
  64. #endif /* KANJI */
  65. #ifdef CYRILLIC
  66. #undef CYRILLIC
  67. #endif /* CYRILLIC */
  68. #ifdef LATIN2
  69. #undef LATIN2
  70. #endif /* LATIN2 */
  71. #ifdef HEBREW
  72. #undef HEBREW
  73. #endif /* HEBREW */
  74. #ifdef UNICODE
  75. #undef UNICODE
  76. #endif /* UNICODE */
  77. #ifndef NOUNICODE
  78. #define NOUNICODE
  79. #endif /* NOUNICODE */
  80. #else /* Not NOCSETS - Rest of this file... */
  81. #ifdef NOUNICODE /* Unicode */
  82. #ifdef UNICODE
  83. #undef UNICODE
  84. #endif /* UNICODE */
  85. #endif /* NOUNICODE */
  86. #ifdef UNICODE
  87. #ifdef OS2
  88. #ifndef CKOUNI
  89. #define CKOUNI /* Special Unicode features for K95 */
  90. #endif /* CKOUNI */
  91. #endif /* OS2 */
  92. #endif /* UNICODE */
  93. #ifndef OS2
  94. #ifdef CKOUNI
  95. #undef CKOUNI
  96. #endif /* CKOUNI */
  97. #endif /* OS2 */
  98. #ifndef NOLATIN2 /* If they didn't say "no Latin-2" */
  99. #ifndef LATIN2 /* Then if LATIN2 isn't already */
  100. #define LATIN2 /* defined, define it. */
  101. #endif /* LATIN2 */
  102. #endif /* NOLATIN2 */
  103. #ifdef NOCYRILLIC /* (spelling variant...) */
  104. #ifndef NOCYRIL
  105. #define NOCYRIL
  106. #endif /* NOCYRIL */
  107. #endif /* NOCYRILLIC */
  108. #ifndef NOCYRIL /* If they didn't say "no Cyrillic" */
  109. #ifndef CYRILLIC /* Then if CYRILLIC isn't already */
  110. #define CYRILLIC /* defined, define it. */
  111. #endif /* CYRILLIC */
  112. #endif /* NOCYRIL */
  113. #ifndef NOHEBREW /* If they didn't say "no Hebrew" */
  114. #ifndef HEBREW /* Then if HEBREW isn't already */
  115. #define HEBREW /* defined, define it. */
  116. #endif /* HEBREW */
  117. #endif /* NOHEBREW */
  118. #ifndef NOGREEK /* If not no Greek */
  119. #ifndef GREEK /* then if GREEK isn't already */
  120. #define GREEK /* defined, define it. */
  121. #endif /* GREEK */
  122. #endif /* NOGREEK */
  123. #ifndef NOKANJI /* If not no Kanji */
  124. #ifndef KANJI /* then if KANJI isn't already */
  125. #define KANJI /* defined, define it. */
  126. #endif /* KANJI */
  127. #endif /* NOKANJI */
  128. /* File ckcxla.h -- Character-set-related definitions, system independent */
  129. /* Codes for Kermit Transfer Syntax Level (obsolete) */
  130. #define TS_L0 0 /* Level 0 (Transparent) */
  131. #define TS_L1 1 /* Level 1 (one standard character set) */
  132. #define TS_L2 2 /* Level 2 (multiple character sets in same file) */
  133. #define UNK 63 /* Symbol to use for unknown character (63 = ?) */
  134. /*
  135. Codes for the base alphabet of a given character set.
  136. These are assigned in roughly ISO 8859 order.
  137. (Each is assumed to include ASCII/Roman.)
  138. */
  139. #define AL_UNIV 0 /* Universal (like ISO 10646) */
  140. #define AL_ROMAN 1 /* Roman (Latin) alphabet */
  141. #define AL_CYRIL 2 /* Cyrillic alphabet */
  142. #define AL_ARABIC 3 /* Arabic */
  143. #define AL_GREEK 4 /* Greek */
  144. #define AL_HEBREW 5 /* Hebrew */
  145. #define AL_KANA 6 /* Japanese Katakana */
  146. #define AL_JAPAN 7 /* Japanese Katakana+Kanji ideograms */
  147. #define AL_HAN 8 /* Chinese/Japanese/Korean ideograms */
  148. #define AL_INDIA 9 /* Indian scripts (ISCII) */
  149. #define AL_VIET 10 /* Vietnamese (VISCII) */
  150. /* Add more here... */
  151. #define AL_UNK 999 /* Unknown (transparent) */
  152. /* Codes for languages */
  153. /*
  154. NOTE: It would perhaps be better to use ISO 639-1988 2-letter "Codes for
  155. Representation of Names of Languages" here, shown in the comments below.
  156. */
  157. #define L_ASCII 0 /* EN ASCII, English */
  158. #define L_USASCII 0 /* EN ASCII, English */
  159. #define L_DUTCH 1 /* NL Dutch */
  160. #define L_FINNISH 2 /* FI Finnish */
  161. #define L_FRENCH 3 /* FR French */
  162. #define L_GERMAN 4 /* DE German */
  163. #define L_HUNGARIAN 5 /* HU Hungarian */
  164. #define L_ITALIAN 6 /* IT Italian */
  165. #define L_NORWEGIAN 7 /* NO Norwegian */
  166. #define L_PORTUGUESE 8 /* PT Portuguese */
  167. #define L_SPANISH 9 /* ES Spanish */
  168. #define L_SWEDISH 10 /* SV Swedish */
  169. #define L_SWISS 11 /* RM Swiss (Rhaeto-Romance) */
  170. #define L_DANISH 12 /* DA Danish */
  171. #define L_ICELANDIC 13 /* IS Icelandic */
  172. #define L_RUSSIAN 14 /* RU Russian */
  173. #define L_JAPANESE 15 /* JA Japanese */
  174. #define L_HEBREW 16 /* IW Hebrew */
  175. #define L_GREEK 17 /* Greek */
  176. #define MAXLANG 17 /* Number of languages */
  177. /*
  178. File character-sets are defined in the system-specific ck?xla.h file,
  179. except for the following ones, which must be available to all versions:
  180. */
  181. #define FC_TRANSP 254 /* Transparent */
  182. #define FC_UNDEF 255 /* Undefined */
  183. /*
  184. Designators for Kermit's transfer character sets. These are all standard
  185. sets, or based on them. Symbols must be unique in the first 8 characters,
  186. because some C preprocessors have this limit.
  187. */
  188. /* LIST1 */
  189. #define TC_TRANSP 0 /* Transparent, no character translation */
  190. #define TC_USASCII 1 /* ISO 646 IRV / US 7-bit ASCII */
  191. #define TC_1LATIN 2 /* ISO 8859-1, Latin Alphabet 1 */
  192. #define TC_2LATIN 3 /* ISO 8859-2, Latin Alphabet 2 */
  193. #define TC_CYRILL 4 /* ISO 8859-5, Latin/Cyrillic */
  194. #define TC_JEUC 5 /* Japanese EUC = JIS 0201+0202+0208 */
  195. #define TC_HEBREW 6 /* ISO 8859-8, Latin/Hebrew */
  196. #define TC_GREEK 7 /* ISO 8859-7, Latin/Greek */
  197. #define TC_9LATIN 8 /* ISO 8859-15 Latin Alphabet 9 (with Euro) */
  198. #define TC_UCS2 9 /* ISO 10646 / Unicode UCS-2 */
  199. #define TC_UTF8 10 /* ISO 10646 / Unicode UTF-8 */
  200. #define MAXTCSETS 10 /* Highest Transfer Character Set Number */
  201. #ifdef COMMENT
  202. /*
  203. Not used and probably won't be due to ISO-10646 / Unicode.
  204. */
  205. #define TC_3LATIN 11 /* ISO 8859-3, Latin-3 */
  206. #define TC_4LATIN 12 /* ISO 8859-4, Latin-4 */
  207. #define TC_5LATIN 13 /* ISO 8859-9, Latin-5 */
  208. #define TC_ARABIC 14 /* ISO-8859-6, Latin/Arabic */
  209. #define TC_JIS208 15 /* Japanese JIS X 0208 multibyte set */
  210. #define TC_CHINES 16 /* Chinese Standard GB 2312-80 */
  211. #define TC_KOREAN 17 /* Korean KS C 5601-1987 */
  212. #define TC_ISCII 18 /* Indian standard code for ii... */
  213. #define TC_VSCII 19 /* Vietnam standard code for ii... */
  214. /* etc... */
  215. #endif /* COMMENT */
  216. /* Structure for character-set information */
  217. struct csinfo {
  218. char *name; /* Descriptive name of character set */
  219. int size; /* Size (e.g. 128, 256, 16384) */
  220. int code; /* Like TC_1LATIN, etc. */
  221. char *designator; /* Designator, like I2/100 = Latin-1 */
  222. int alphabet; /* Base alphabet */
  223. char *keyword; /* Keyword for this character-set */
  224. };
  225. /* Structure for language information */
  226. struct langinfo {
  227. int id; /* Language ID code (L_whatever) */
  228. int fc; /* File character set to use */
  229. int tc; /* Transfer character set to use */
  230. char *description; /* Description of language */
  231. };
  232. /* Now take in the system-specific definitions */
  233. #ifdef UNIX
  234. #include "ckuxla.h"
  235. #endif /* UNIX */
  236. #ifdef OSK /* OS-9 */
  237. #include "ckuxla.h"
  238. #endif /* OS-9 */
  239. #ifdef VMS /* VAX/VMS */
  240. #include "ckuxla.h"
  241. #endif /* VMS */
  242. #ifdef GEMDOS /* Atari ST */
  243. #include "ckuxla.h"
  244. #endif /* GEMDOS */
  245. #ifdef MAC /* Macintosh */
  246. #include "ckmxla.h"
  247. #endif /* MAC */
  248. #ifdef OS2 /* OS/2 */
  249. #include "ckuxla.h" /* Uses big UNIX version */
  250. #endif /* OS2 */
  251. #ifdef AMIGA /* Commodore Amiga */
  252. #include "ckuxla.h"
  253. #endif /* AMIGA */
  254. #ifdef datageneral /* Data General MV AOS/VS */
  255. #include "ckuxla.h"
  256. #endif /* datageneral */
  257. #ifdef STRATUS /* Stratus Computer, Inc. VOS */
  258. #include "ckuxla.h"
  259. #endif /* STRATUS */
  260. #ifdef UNICODE
  261. #include "ckcuni.h" /* Unicode */
  262. #endif /* UNICODE */
  263. #ifdef KANJI
  264. #define UNKSJIS 0x817f
  265. _PROTOTYP(USHORT eu_to_sj, (USHORT) ); /* EUC-JP to Shift-JIS */
  266. _PROTOTYP(USHORT sj_to_eu, (USHORT) ); /* Shift-JIS to EUC-JP */
  267. _PROTOTYP( int xkanjf, (void) );
  268. _PROTOTYP( int xkanji, (int, int (*)(char)) );
  269. _PROTOTYP( int xkanjz, (int (*)(char) ) );
  270. _PROTOTYP( int zkanjf, (void) );
  271. _PROTOTYP( int zkanji, (int (*)(void)) ); /* Kanji function prototypes */
  272. _PROTOTYP( int zkanjz, (void) );
  273. _PROTOTYP(VOID j7init, ( void ) ); /* Initialize JIS-7 parser */
  274. _PROTOTYP(int getj7, ( void ) ); /* Get next JIS-7 character */
  275. #endif /* KANJI */
  276. #ifndef MAC
  277. #ifndef NOLOCAL
  278. _PROTOTYP( int cs_size, (int) );
  279. _PROTOTYP( int cs_is_std, (int) );
  280. _PROTOTYP( int cs_is_nrc, (int) );
  281. _PROTOTYP( VOID setremcharset, (int, int) );
  282. _PROTOTYP( VOID setlclcharset, (int) );
  283. #endif /* NOLOCAL */
  284. #endif /* MAC */
  285. _PROTOTYP(VOID setxlatype, (int, int));
  286. #endif /* NOCSETS */
  287. #endif /* CKCXLA_H */
  288. /* End of ckcxla.h */