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 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | #ifndef __UCONV_TIL_H__ |
michael@0 | 6 | #define __UCONV_TIL_H__ |
michael@0 | 7 | |
michael@0 | 8 | #include "prcpucfg.h" |
michael@0 | 9 | |
michael@0 | 10 | |
michael@0 | 11 | /*=====================================*/ |
michael@0 | 12 | #define PACK(h,l) (int16_t)(( (h) << 8) | (l)) |
michael@0 | 13 | |
michael@0 | 14 | #if defined(IS_LITTLE_ENDIAN) |
michael@0 | 15 | #define ShiftInCell(sub,len,min,max) \ |
michael@0 | 16 | PACK(len,sub), PACK(max,min) |
michael@0 | 17 | #define ShiftOutCell(sub,len,minh,minl,maxh,maxl) \ |
michael@0 | 18 | PACK(len,sub), PACK(minl,minh), PACK(maxl,maxh) |
michael@0 | 19 | #else |
michael@0 | 20 | #define ShiftInCell(sub,len,min,max) \ |
michael@0 | 21 | PACK(sub,len), PACK(min, max) |
michael@0 | 22 | #define ShiftOutCell(sub,len,minh,minl,maxh,maxl) \ |
michael@0 | 23 | PACK(sub,len), PACK(minh,minl), PACK(maxh,maxl) |
michael@0 | 24 | #endif |
michael@0 | 25 | |
michael@0 | 26 | typedef enum { |
michael@0 | 27 | u1ByteCharset = 0, |
michael@0 | 28 | u2BytesCharset, |
michael@0 | 29 | u2BytesGRCharset, |
michael@0 | 30 | u2BytesGRPrefix8FCharset, |
michael@0 | 31 | u2BytesGRPrefix8EA2Charset, |
michael@0 | 32 | u2BytesGRPrefix8EA3Charset, |
michael@0 | 33 | u2BytesGRPrefix8EA4Charset, |
michael@0 | 34 | u2BytesGRPrefix8EA5Charset, |
michael@0 | 35 | u2BytesGRPrefix8EA6Charset, |
michael@0 | 36 | u2BytesGRPrefix8EA7Charset, |
michael@0 | 37 | uDecomposedHangulCharset, |
michael@0 | 38 | uJohabHangulCharset, |
michael@0 | 39 | uJohabSymbolCharset, |
michael@0 | 40 | u4BytesGB18030Charset, |
michael@0 | 41 | u2BytesGR128Charset, |
michael@0 | 42 | uMultibytesCharset, |
michael@0 | 43 | uNumOfCharsetType = uMultibytesCharset |
michael@0 | 44 | } uScanClassID; |
michael@0 | 45 | |
michael@0 | 46 | typedef enum { |
michael@0 | 47 | u1ByteChar = 0, |
michael@0 | 48 | u2BytesChar, |
michael@0 | 49 | u2BytesGRChar, |
michael@0 | 50 | u1BytePrefix8EChar, /* Used by JIS0201 GR in EUC_JP */ |
michael@0 | 51 | uNumOfCharType |
michael@0 | 52 | } uScanSubClassID; |
michael@0 | 53 | |
michael@0 | 54 | typedef struct { |
michael@0 | 55 | unsigned char classID; |
michael@0 | 56 | unsigned char reserveLen; |
michael@0 | 57 | unsigned char shiftin_Min; |
michael@0 | 58 | unsigned char shiftin_Max; |
michael@0 | 59 | } uShiftInCell; |
michael@0 | 60 | |
michael@0 | 61 | typedef struct { |
michael@0 | 62 | int16_t numOfItem; |
michael@0 | 63 | uShiftInCell shiftcell[1]; |
michael@0 | 64 | } uShiftInTableMutable; |
michael@0 | 65 | |
michael@0 | 66 | typedef const uShiftInTableMutable uShiftInTable; |
michael@0 | 67 | |
michael@0 | 68 | typedef struct { |
michael@0 | 69 | unsigned char classID; |
michael@0 | 70 | unsigned char reserveLen; |
michael@0 | 71 | unsigned char shiftout_MinHB; |
michael@0 | 72 | unsigned char shiftout_MinLB; |
michael@0 | 73 | unsigned char shiftout_MaxHB; |
michael@0 | 74 | unsigned char shiftout_MaxLB; |
michael@0 | 75 | } uShiftOutCell; |
michael@0 | 76 | |
michael@0 | 77 | typedef struct { |
michael@0 | 78 | int16_t numOfItem; |
michael@0 | 79 | uShiftOutCell shiftcell[1]; |
michael@0 | 80 | } uShiftOutTableMutable; |
michael@0 | 81 | |
michael@0 | 82 | typedef const uShiftOutTableMutable uShiftOutTable; |
michael@0 | 83 | |
michael@0 | 84 | |
michael@0 | 85 | /*=====================================*/ |
michael@0 | 86 | |
michael@0 | 87 | typedef struct { |
michael@0 | 88 | unsigned char min; |
michael@0 | 89 | unsigned char max; |
michael@0 | 90 | } uRange; |
michael@0 | 91 | |
michael@0 | 92 | /*=====================================*/ |
michael@0 | 93 | |
michael@0 | 94 | typedef uint16_t* uMappingTableMutable; |
michael@0 | 95 | typedef const uint16_t uMappingTable; |
michael@0 | 96 | |
michael@0 | 97 | #endif |
michael@0 | 98 |