blob: 19462198e91484e099e914eec50b00fda82b42d4 [file] [log] [blame]
Hye-Shik Chang3e2a3062004-01-17 14:29:29 +00001/*
2 * cjkcommon.h: Common Constants and Macroes for CJK Character Sets
3 *
4 * Written by Hye-Shik Chang <perky@FreeBSD.org>
5 * $CJKCodecs: cjkcommon.h,v 1.2 2003/12/31 05:46:55 perky Exp $
6 */
7
8#ifndef _CJKCOMMON_H_
9#define _CJKCOMMON_H_
10
11#ifdef uint32_t
12typedef uint32_t ucs4_t;
13#else
14typedef unsigned int ucs4_t;
15#endif
16
17#ifdef uint16_t
18typedef uint16_t ucs2_t, DBCHAR;
19#else
20typedef unsigned short ucs2_t, DBCHAR;
21#endif
22
23#define UNIINV Py_UNICODE_REPLACEMENT_CHARACTER
24#define NOCHAR 0xFFFF
25#define MULTIC 0xFFFE
26#define DBCINV 0xFFFD
27
28struct dbcs_index {
29 const ucs2_t *map;
30 unsigned char bottom, top;
31};
32typedef struct dbcs_index decode_map;
33
34struct widedbcs_index {
35 const ucs4_t *map;
36 unsigned char bottom, top;
37};
38typedef struct widedbcs_index widedecode_map;
39
40struct unim_index {
41 const DBCHAR *map;
42 unsigned char bottom, top;
43};
44typedef struct unim_index encode_map;
45
46struct dbcs_map {
47 const char *charset;
48 const struct unim_index *encmap;
49 const struct dbcs_index *decmap;
50};
51
52struct pair_encodemap {
53 ucs4_t uniseq;
54 DBCHAR code;
55};
56
57#endif