ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/encoding.h
(Generate patch)

Comparing rxvt-unicode/src/encoding.h (file contents):
Revision 1.3 by pcg, Wed Mar 3 00:20:33 2004 UTC vs.
Revision 1.11 by pcg, Mon Mar 15 01:27:46 2004 UTC

1#ifndef ENCODING_H 1#ifndef ENCODING_H
2#define ENCODING_H 2#define ENCODING_H
3 3
4#include <stdint.h> 4#include <stdint.h>
5 5
6typedef uint32_t unicode_t;
7
6// order must match the table in encoding.C(!) 8// order must match the table in encoding.C(!)
7enum codeset { 9enum codeset {
8 CS_UNKNOWN = 0, 10 CS_UNKNOWN = 0,
9 CS_SPECIAL,
10 CS_US_ASCII, 11 CS_US_ASCII,
11 12
12 CS_ISO8859_1, 13 CS_ISO8859_1,
13 CS_ISO8859_2, 14 CS_ISO8859_2,
14 CS_ISO8859_3, 15 CS_ISO8859_3,
26 CS_ISO8859_16, 27 CS_ISO8859_16,
27 28
28 CS_KOI8_R, 29 CS_KOI8_R,
29 CS_KOI8_U, 30 CS_KOI8_U,
30 CS_JIS0201_1976_0, 31 CS_JIS0201_1976_0,
31 CS_JIS0208_1983_0, 32 CS_JIS0208_1990_0,
32 CS_JIS0212_1990_0, 33 CS_JIS0212_1990_0,
33
34 CS_JIS0213_1, 34 CS_JIS0213_1,
35 CS_JIS0213_2, 35 CS_JIS0213_2,
36 36
37 CS_KSC5601_1987_0, 37 CS_KSC5601_1987_0,
38 38
61 61
62codeset codeset_from_name (const char *name); 62codeset codeset_from_name (const char *name);
63 63
64enum { 64enum {
65 ZERO_WIDTH_CHAR = 0x200b, 65 ZERO_WIDTH_CHAR = 0x200b,
66 REPLACEMENT_CHAR = 0xfffd,
66 NOCHAR = 65535, // must be invalid in ANY codeset (!) 67 NOCHAR = 65535, // must be invalid in ANY codeset (!)
67}; 68};
68 69
69struct rxvt_codeset_conv { 70struct rxvt_codeset_conv {
70 virtual uint32_t from_unicode (uint32_t unicode) const { return unicode; } 71 virtual uint32_t from_unicode (unicode_t unicode) const { return unicode; }
72#if ENCODING_TO_UNICODE
71 virtual uint32_t to_unicode (uint32_t enc) const { return enc; } 73 virtual unicode_t to_unicode (uint32_t enc) const { return enc; }
74#endif
72}; 75};
73 76
74extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS]; 77extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS];
75 78
79extern unicode_t rxvt_compose (unicode_t c1, unicode_t c2);
80
76#define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code) 81#define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code)
77#define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code) 82#define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code)
78 83
84struct unicode { // namespace für arme
85 static bool is_space (unicode_t c);
86};
87
79#endif 88#endif
80 89

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines