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.11 by pcg, Mon Mar 15 01:27:46 2004 UTC vs.
Revision 1.17 by root, Wed Nov 5 14:43:54 2008 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 <inttypes.h>
5 5
6typedef uint32_t unicode_t; 6typedef uint32_t unicode_t;
7 7
8// order must match the table in encoding.C(!) 8// order must match the table in encoding.C(!)
9enum codeset { 9enum codeset {
35 CS_JIS0213_2, 35 CS_JIS0213_2,
36 36
37 CS_KSC5601_1987_0, 37 CS_KSC5601_1987_0,
38 38
39 CS_GB2312_1980_0, 39 CS_GB2312_1980_0,
40 CS_GBK_0,
40 41
41 CS_CNS11643_1992_1, 42 CS_CNS11643_1992_1,
42 CS_CNS11643_1992_2, 43 CS_CNS11643_1992_2,
43 CS_CNS11643_1992_3, 44 CS_CNS11643_1992_3,
44 CS_CNS11643_1992_4, 45 CS_CNS11643_1992_4,
60}; 61};
61 62
62codeset codeset_from_name (const char *name); 63codeset codeset_from_name (const char *name);
63 64
64enum { 65enum {
65 ZERO_WIDTH_CHAR = 0x200b, 66 ZERO_WIDTH_CHAR = 0x200b,
66 REPLACEMENT_CHAR = 0xfffd, 67 REPLACEMENT_CHAR = 0xfffd,
67 NOCHAR = 65535, // must be invalid in ANY codeset (!) 68 NOCHAR = 0xffff, // must be invalid in ANY codeset (!)
68}; 69};
69 70
70struct rxvt_codeset_conv { 71struct rxvt_codeset_conv
71 virtual uint32_t from_unicode (unicode_t unicode) const { return unicode; } 72{
73 uint32_t (*from_unicode) (unicode_t unicode);
72#if ENCODING_TO_UNICODE 74#if ENCODING_TO_UNICODE
73 virtual unicode_t to_unicode (uint32_t enc) const { return enc; } 75 unicode_t (*to_unicode) (uint32_t enc);
74#endif 76#endif
75}; 77};
76 78
77extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS]; 79extern const rxvt_codeset_conv rxvt_codeset[NUM_CODESETS];
78 80
79extern unicode_t rxvt_compose (unicode_t c1, unicode_t c2); 81extern unicode_t rxvt_compose (unicode_t c1, unicode_t c2);
80 82
81#define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code) 83#define FROM_UNICODE(cs,code) rxvt_codeset[cs].from_unicode (code)
82#define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code) 84#define TO_UNICODE(cs,code) rxvt_codeset[cs].to_unicode (code)
83 85
84struct unicode { // namespace für arme 86struct unicode // namespace für arme
87{
85 static bool is_space (unicode_t c); 88 static bool is_space (unicode_t c);
86}; 89};
87 90
88#endif 91#endif
89 92

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines