Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | Copyright (c) 1999 Samphan Raruenrom <samphan@thai.com> |
michael@0 | 3 | Permission to use, copy, modify, distribute and sell this software |
michael@0 | 4 | and its documentation for any purpose is hereby granted without fee, |
michael@0 | 5 | provided that the above copyright notice appear in all copies and |
michael@0 | 6 | that both that copyright notice and this permission notice appear |
michael@0 | 7 | in supporting documentation. Samphan Raruenrom makes no |
michael@0 | 8 | representations about the suitability of this software for any |
michael@0 | 9 | purpose. It is provided "as is" without express or implied warranty. |
michael@0 | 10 | */ |
michael@0 | 11 | #ifndef __TH_CHAR_H__ |
michael@0 | 12 | #define __TH_CHAR_H__ |
michael@0 | 13 | #include "nscore.h" |
michael@0 | 14 | |
michael@0 | 15 | |
michael@0 | 16 | typedef unsigned char tis_char; |
michael@0 | 17 | |
michael@0 | 18 | #ifdef TH_UNICODE |
michael@0 | 19 | /* |
michael@0 | 20 | * The char16_t type is only usable in C++ code, so we need this ugly hack to |
michael@0 | 21 | * select a binary compatible C type for the expat C code to use. |
michael@0 | 22 | */ |
michael@0 | 23 | #ifdef __cplusplus |
michael@0 | 24 | typedef char16_t th_char; |
michael@0 | 25 | #else |
michael@0 | 26 | typedef uint16_t th_char; |
michael@0 | 27 | #endif |
michael@0 | 28 | #define TH_THAIBEGIN_ 0x0e00 |
michael@0 | 29 | #define th_isthai(c) (0x0e00 <= (c) && (c) <= 0x0e5f) |
michael@0 | 30 | #else |
michael@0 | 31 | typedef tis_char th_char; |
michael@0 | 32 | #define TH_THAIBEGIN_ 0xa0 |
michael@0 | 33 | #define th_isthai(c) ((c) >= 0xa0) |
michael@0 | 34 | #endif |
michael@0 | 35 | #define th_zcode(c) ((c) - TH_THAIBEGIN_) |
michael@0 | 36 | |
michael@0 | 37 | enum TH_CHARNAME { |
michael@0 | 38 | TH_THAIBEGIN = TH_THAIBEGIN_, |
michael@0 | 39 | TH_KOKAI,TH_KHOKHAI,TH_KHOKHUAT,TH_KHOKHWAI,TH_KHOKHON,TH_KHORAKHANG, |
michael@0 | 40 | TH_NGONGU,TH_CHOCHAN,TH_CHOCHING,TH_CHOCHANG,TH_SOSO,TH_CHOCHOE,TH_YOYING, |
michael@0 | 41 | TH_DOCHADA,TH_TOPATAK,TH_THOTHAN,TH_THONANGMONTHO,TH_THOPHUTHAO,TH_NONEN, |
michael@0 | 42 | TH_DODEK,TH_TOTAO,TH_THOTHUNG,TH_THOTHAHAN,TH_THOTHONG,TH_NONU,TH_BOBAIMAI, |
michael@0 | 43 | TH_POPLA,TH_PHOPHUNG,TH_FOFA,TH_PHOPHAN,TH_FOFAN,TH_PHOSAMPHAO,TH_MOMA, |
michael@0 | 44 | TH_YOYAK,TH_RORUA,TH_RU,TH_LOLING,TH_LU,TH_WOWAEN,TH_SOSALA,TH_SORUSI, |
michael@0 | 45 | TH_SOSUA,TH_HOHIP,TH_LOCHULA,TH_OANG,TH_HONOKHUK,TH_PAIYANNOI,TH_SARA_A, |
michael@0 | 46 | TH_MAIHANAKAT,TH_SARA_AA,TH_SARA_AM,TH_SARA_I,TH_SARA_II,TH_SARA_UE, |
michael@0 | 47 | TH_SARA_UEE,TH_SARA_U,TH_SARA_UU,TH_PHINTHU,TH_REM_CHERNG_,TH_TAC_WBRK_, |
michael@0 | 48 | TH_UNDEF_DD,TH_UNDEF_DE,TH_BAHT,TH_SARA_E,TH_SARA_AE,TH_SARA_O,TH_MAIMUAN, |
michael@0 | 49 | TH_MAIMALAI,TH_LAKKHANGYAO,TH_MAIYAMOK,TH_MAITAIKHU,TH_MAIEK,TH_MAITHO, |
michael@0 | 50 | TH_MAITRI,TH_MAICHATTAWA,TH_THANTHAKHAT,TH_NIKHAHIT,TH_YAMAKKAN,TH_FONGMAN, |
michael@0 | 51 | TH_THAIZERO,TH_THAIONE,TH_THAITWO,TH_THAITHREE,TH_THAIFOUR,TH_THAIFIVE, |
michael@0 | 52 | TH_THAISIX,TH_THAISEVEN,TH_THAIEIGHT,TH_THAININE,TH_ANGKHANKHU,TH_KHOMUT, |
michael@0 | 53 | TH_UNDEF_FC,TH_UNDEF_FD,TH_UNDEF_FE,TH_THAIEND |
michael@0 | 54 | }; |
michael@0 | 55 | #endif |