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.1 by pcg, Mon Nov 24 17:28:08 2003 UTC vs.
Revision 1.6 by pcg, Thu Mar 4 20:09:01 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
6// order must match the table in encoding.C(!)
6enum codeset { 7enum codeset {
7 CS_UNKNOWN = 0, 8 CS_UNKNOWN = 0,
8 CS_SPECIAL,
9 CS_US_ASCII, 9 CS_US_ASCII,
10 10
11 CS_ISO8859_1, 11 CS_ISO8859_1,
12 CS_ISO8859_2, 12 CS_ISO8859_2,
13 CS_ISO8859_3, 13 CS_ISO8859_3,
44 CS_CNS11643_1992_5, 44 CS_CNS11643_1992_5,
45 CS_CNS11643_1992_6, 45 CS_CNS11643_1992_6,
46 CS_CNS11643_1992_7, 46 CS_CNS11643_1992_7,
47 CS_CNS11643_1992_F, 47 CS_CNS11643_1992_F,
48 48
49 CS_BIG5,
49 CS_BIG5_EXT, 50 CS_BIG5_EXT,
50 CS_BIG5_PLUS, 51 CS_BIG5_PLUS,
51 52
52 CS_VISCII, 53 CS_VISCII,
53 54
59 60
60codeset codeset_from_name (const char *name); 61codeset codeset_from_name (const char *name);
61 62
62enum { 63enum {
63 ZERO_WIDTH_CHAR = 0x200b, 64 ZERO_WIDTH_CHAR = 0x200b,
65 REPLACEMENT_CHAR = 0xfffd,
64 NOCHAR = 65535, // must be invalid in ANY codeset(!) 66 NOCHAR = 65535, // must be invalid in ANY codeset (!)
65}; 67};
66 68
67struct rxvt_codeset_conv { 69struct rxvt_codeset_conv {
68 virtual uint32_t from_unicode (uint32_t unicode) const { return unicode; } 70 virtual uint32_t from_unicode (uint32_t unicode) const { return unicode; }
69 virtual uint32_t to_unicode (uint32_t enc) const { return enc; } 71 virtual uint32_t to_unicode (uint32_t enc) const { return enc; }
70}; 72};
71 73
72extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS]; 74extern const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS];
73 75
76extern uint32_t rxvt_compose (uint32_t c1, uint32_t c2);
77
74#define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code) 78#define FROM_UNICODE(cs,code) rxvt_codeset[cs]->from_unicode (code)
75#define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code) 79#define TO_UNICODE(cs,code) rxvt_codeset[cs]->to_unicode (code)
76 80
77#endif 81#endif
78 82

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines