source: trunk/third/kermit/ckcxla.h @ 20081

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