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