branches/alto2/src/lib/util/unicode.h
| r26155 | r26156 | |
| 90 | 90 | const char *utf8_previous_char(const char *utf8string); |
| 91 | 91 | int utf8_is_valid_string(const char *utf8string); |
| 92 | 92 | |
| 93 | /* Unicode lookup table loader */ |
| 94 | //! load a table translating UINT8 (unsigned char) to Unicode values |
| 95 | unicode_char * uchar_table_load(const char* name); |
| 96 | |
| 97 | //! reverse lookup of uchar in a Unicode table - returns 255 if not found |
| 98 | UINT8 uchar_table_index(unicode_char* table, unicode_char uchar); |
| 99 | |
| 100 | //! free a unicode table |
| 101 | void uchar_table_free(unicode_char* table); |
| 102 | |
| 93 | 103 | /*************************************************************************** |
| 94 | | * unicode.org published UnicodeData.txt parser and accessors |
| 104 | * unicode.org published UnicodeData.txt |
| 105 | * parser and accessors |
| 95 | 106 | ***************************************************************************/ |
| 96 | 107 | |
| 108 | //! load the UnicodeData.txt file an parse it |
| 109 | int unicode_data_load(const char* name); |
| 110 | |
| 111 | //! free the UnicodeData.txt table memory |
| 112 | void unicode_data_free(); |
| 113 | |
| 97 | 114 | //! size of the first 17 Unicode planes |
| 98 | 115 | #define UNICODE_PLANESIZE 0x110000 |
| 99 | 116 | |
| 117 | #ifndef NEED_UNICODE_RANGES |
| 100 | 118 | #define NEED_UNICODE_RANGES 1 //!< define to 1, if the name, first or last of the range of a code is needed |
| 119 | #endif |
| 120 | |
| 121 | #ifndef NEED_UNICODE_NAME |
| 101 | 122 | #define NEED_UNICODE_NAME 1 //!< define to 1, if the name of a code is needed |
| 123 | #endif |
| 124 | |
| 125 | #ifndef NEED_UNICODE_NAME10 |
| 102 | 126 | #define NEED_UNICODE_NAME10 1 //!< define to 1, if the short name of a code is needed |
| 127 | #endif |
| 128 | |
| 129 | #ifndef NEED_UNICODE_GCAT |
| 103 | 130 | #define NEED_UNICODE_GCAT 1 //!< define to 1, if the general category of a code is needed |
| 131 | #endif |
| 132 | |
| 133 | #ifndef NEED_UNICODE_CCOM |
| 104 | 134 | #define NEED_UNICODE_CCOM 1 //!< define to 1, if the canonical combining (name) of a code is needed |
| 135 | #endif |
| 136 | |
| 137 | #ifndef NEED_UNICODE_BIDI |
| 105 | 138 | #define NEED_UNICODE_BIDI 1 //!< define to 1, if the bidirectional category of a code is needed |
| 139 | #endif |
| 140 | |
| 141 | #ifndef NEED_UNICODE_DECO |
| 106 | 142 | #define NEED_UNICODE_DECO 1 //!< define to 1, if the decomposition codes of a code are needed |
| 143 | #endif |
| 144 | |
| 145 | #ifndef NEED_UNICODE_DECIMAL |
| 107 | 146 | #define NEED_UNICODE_DECIMAL 1 //!< define to 1, if the decimal value of a code is needed |
| 147 | #endif |
| 148 | |
| 149 | #ifndef NEED_UNICODE_DIGIT |
| 108 | 150 | #define NEED_UNICODE_DIGIT 1 //!< define to 1, if the digit value of a code is needed |
| 151 | #endif |
| 152 | |
| 153 | #ifndef NEED_UNICODE_NUMERIC |
| 109 | 154 | #define NEED_UNICODE_NUMERIC 1 //!< define to 1, if the numeric value of a code is needed |
| 155 | #endif |
| 156 | |
| 157 | #ifndef NEED_UNICODE_MIRRORED |
| 110 | 158 | #define NEED_UNICODE_MIRRORED 1 //!< define to 1, if the mirrored flag of a code is needed |
| 159 | #endif |
| 160 | |
| 161 | #ifndef NEED_UNICODE_DECN |
| 111 | 162 | #define NEED_UNICODE_DECN 1 //!< define to 1, if access to decomposed code [n] of a code is needed |
| 163 | #endif |
| 164 | |
| 165 | #ifndef NEED_UNICODE_UCASE |
| 112 | 166 | #define NEED_UNICODE_UCASE 1 //!< define to 1, if the upper case value of a code is needed |
| 167 | #endif |
| 168 | |
| 169 | #ifndef NEED_UNICODE_LCASE |
| 113 | 170 | #define NEED_UNICODE_LCASE 1 //!< define to 1, if the lower case value of a code is needed |
| 171 | #endif |
| 172 | |
| 173 | #ifndef NEED_UNICODE_TCASE |
| 114 | 174 | #define NEED_UNICODE_TCASE 1 //!< define to 1, if the title case value of a code is needed |
| 175 | #endif |
| 176 | |
| 177 | #ifndef NEED_UNICODE_WIDTH |
| 115 | 178 | #define NEED_UNICODE_WIDTH 1 //!< define to 1, if the glyph width of a code is needed |
| 179 | #endif |
| 116 | 180 | |
| 117 | 181 | #if NEED_UNICODE_GCAT |
| 118 | 182 | typedef enum { |
| r26155 | r26156 | |
| 292 | 356 | int unicode_width(unicode_char uchar); |
| 293 | 357 | #endif |
| 294 | 358 | |
| 295 | | //! load the UnicodeData.txt file an parse it |
| 296 | | int unicode_data_load(const char* name); |
| 297 | | |
| 298 | | //! free the parse UnicodeData.txt memory |
| 299 | | void unicode_data_free(); |
| 300 | | |
| 301 | 359 | /*************************************************************************** |
| 302 | 360 | MACROS |
| 303 | 361 | ***************************************************************************/ |