Revision: | 1.17 |
Committed: | Wed Nov 5 14:43:54 2008 UTC (15 years, 8 months ago) by root |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | before_dynamic_fontidx, rxvt-unicode-rel-9_29, rxvt-unicode-rel-9_26, rxvt-unicode-rel-9_25, rxvt-unicode-rel-9_22, rxvt-unicode-rel-9_20, rxvt-unicode-rel-9_21, rel-9_14, rel-9_11, rel-9_10, rel-9_12, rxvt-unicode-rel-9_19, rxvt-unicode-rel-9_18, rxvt-unicode-rel-9_17, rxvt-unicode-rel-9_16, rxvt-unicode-rel-9_15, dynamic_fontidx, rxvt-unicode-rel-9_30, rel-9_09, rel-9_06, rel-9_07, HEAD |
Changes since 1.16: | +4 -2 lines |
Log Message: | minor overlay refactoring, syntax changes |
# | User | Rev | Content |
---|---|---|---|
1 | pcg | 1.1 | #ifndef ENCODING_H |
2 | #define ENCODING_H | ||
3 | |||
4 | root | 1.12 | #include <inttypes.h> |
5 | pcg | 1.1 | |
6 | pcg | 1.11 | typedef uint32_t unicode_t; |
7 | |||
8 | pcg | 1.3 | // order must match the table in encoding.C(!) |
9 | pcg | 1.1 | enum codeset { |
10 | CS_UNKNOWN = 0, | ||
11 | CS_US_ASCII, | ||
12 | |||
13 | CS_ISO8859_1, | ||
14 | CS_ISO8859_2, | ||
15 | CS_ISO8859_3, | ||
16 | CS_ISO8859_4, | ||
17 | CS_ISO8859_5, | ||
18 | CS_ISO8859_6, | ||
19 | CS_ISO8859_7, | ||
20 | CS_ISO8859_8, | ||
21 | CS_ISO8859_9, | ||
22 | CS_ISO8859_10, | ||
23 | CS_ISO8859_11, | ||
24 | CS_ISO8859_13, | ||
25 | CS_ISO8859_14, | ||
26 | CS_ISO8859_15, | ||
27 | CS_ISO8859_16, | ||
28 | |||
29 | CS_KOI8_R, | ||
30 | CS_KOI8_U, | ||
31 | CS_JIS0201_1976_0, | ||
32 | pcg | 1.11 | CS_JIS0208_1990_0, |
33 | pcg | 1.1 | CS_JIS0212_1990_0, |
34 | CS_JIS0213_1, | ||
35 | CS_JIS0213_2, | ||
36 | |||
37 | CS_KSC5601_1987_0, | ||
38 | |||
39 | CS_GB2312_1980_0, | ||
40 | root | 1.14 | CS_GBK_0, |
41 | pcg | 1.1 | |
42 | CS_CNS11643_1992_1, | ||
43 | CS_CNS11643_1992_2, | ||
44 | CS_CNS11643_1992_3, | ||
45 | CS_CNS11643_1992_4, | ||
46 | CS_CNS11643_1992_5, | ||
47 | CS_CNS11643_1992_6, | ||
48 | CS_CNS11643_1992_7, | ||
49 | CS_CNS11643_1992_F, | ||
50 | |||
51 | pcg | 1.3 | CS_BIG5, |
52 | pcg | 1.1 | CS_BIG5_EXT, |
53 | CS_BIG5_PLUS, | ||
54 | |||
55 | CS_VISCII, | ||
56 | |||
57 | CS_UNICODE_16, /* 16-bit subset of unicode, for X11 */ | ||
58 | CS_UNICODE, | ||
59 | |||
60 | NUM_CODESETS | ||
61 | }; | ||
62 | |||
63 | codeset codeset_from_name (const char *name); | ||
64 | |||
65 | enum { | ||
66 | root | 1.15 | ZERO_WIDTH_CHAR = 0x200b, |
67 | pcg | 1.6 | REPLACEMENT_CHAR = 0xfffd, |
68 | root | 1.16 | NOCHAR = 0xffff, // must be invalid in ANY codeset (!) |
69 | pcg | 1.1 | }; |
70 | |||
71 | root | 1.17 | struct rxvt_codeset_conv |
72 | { | ||
73 | root | 1.13 | uint32_t (*from_unicode) (unicode_t unicode); |
74 | pcg | 1.11 | #if ENCODING_TO_UNICODE |
75 | root | 1.13 | unicode_t (*to_unicode) (uint32_t enc); |
76 | pcg | 1.11 | #endif |
77 | pcg | 1.1 | }; |
78 | |||
79 | root | 1.13 | extern const rxvt_codeset_conv rxvt_codeset[NUM_CODESETS]; |
80 | pcg | 1.1 | |
81 | pcg | 1.11 | extern unicode_t rxvt_compose (unicode_t c1, unicode_t c2); |
82 | pcg | 1.6 | |
83 | root | 1.13 | #define FROM_UNICODE(cs,code) rxvt_codeset[cs].from_unicode (code) |
84 | #define TO_UNICODE(cs,code) rxvt_codeset[cs].to_unicode (code) | ||
85 | pcg | 1.1 | |
86 | root | 1.17 | struct unicode // namespace für arme |
87 | { | ||
88 | pcg | 1.11 | static bool is_space (unicode_t c); |
89 | }; | ||
90 | |||
91 | pcg | 1.1 | #endif |
92 |