michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef __UCONV_TIL_H__ michael@0: #define __UCONV_TIL_H__ michael@0: michael@0: #include "prcpucfg.h" michael@0: michael@0: michael@0: /*=====================================*/ michael@0: #define PACK(h,l) (int16_t)(( (h) << 8) | (l)) michael@0: michael@0: #if defined(IS_LITTLE_ENDIAN) michael@0: #define ShiftInCell(sub,len,min,max) \ michael@0: PACK(len,sub), PACK(max,min) michael@0: #define ShiftOutCell(sub,len,minh,minl,maxh,maxl) \ michael@0: PACK(len,sub), PACK(minl,minh), PACK(maxl,maxh) michael@0: #else michael@0: #define ShiftInCell(sub,len,min,max) \ michael@0: PACK(sub,len), PACK(min, max) michael@0: #define ShiftOutCell(sub,len,minh,minl,maxh,maxl) \ michael@0: PACK(sub,len), PACK(minh,minl), PACK(maxh,maxl) michael@0: #endif michael@0: michael@0: typedef enum { michael@0: u1ByteCharset = 0, michael@0: u2BytesCharset, michael@0: u2BytesGRCharset, michael@0: u2BytesGRPrefix8FCharset, michael@0: u2BytesGRPrefix8EA2Charset, michael@0: u2BytesGRPrefix8EA3Charset, michael@0: u2BytesGRPrefix8EA4Charset, michael@0: u2BytesGRPrefix8EA5Charset, michael@0: u2BytesGRPrefix8EA6Charset, michael@0: u2BytesGRPrefix8EA7Charset, michael@0: uDecomposedHangulCharset, michael@0: uJohabHangulCharset, michael@0: uJohabSymbolCharset, michael@0: u4BytesGB18030Charset, michael@0: u2BytesGR128Charset, michael@0: uMultibytesCharset, michael@0: uNumOfCharsetType = uMultibytesCharset michael@0: } uScanClassID; michael@0: michael@0: typedef enum { michael@0: u1ByteChar = 0, michael@0: u2BytesChar, michael@0: u2BytesGRChar, michael@0: u1BytePrefix8EChar, /* Used by JIS0201 GR in EUC_JP */ michael@0: uNumOfCharType michael@0: } uScanSubClassID; michael@0: michael@0: typedef struct { michael@0: unsigned char classID; michael@0: unsigned char reserveLen; michael@0: unsigned char shiftin_Min; michael@0: unsigned char shiftin_Max; michael@0: } uShiftInCell; michael@0: michael@0: typedef struct { michael@0: int16_t numOfItem; michael@0: uShiftInCell shiftcell[1]; michael@0: } uShiftInTableMutable; michael@0: michael@0: typedef const uShiftInTableMutable uShiftInTable; michael@0: michael@0: typedef struct { michael@0: unsigned char classID; michael@0: unsigned char reserveLen; michael@0: unsigned char shiftout_MinHB; michael@0: unsigned char shiftout_MinLB; michael@0: unsigned char shiftout_MaxHB; michael@0: unsigned char shiftout_MaxLB; michael@0: } uShiftOutCell; michael@0: michael@0: typedef struct { michael@0: int16_t numOfItem; michael@0: uShiftOutCell shiftcell[1]; michael@0: } uShiftOutTableMutable; michael@0: michael@0: typedef const uShiftOutTableMutable uShiftOutTable; michael@0: michael@0: michael@0: /*=====================================*/ michael@0: michael@0: typedef struct { michael@0: unsigned char min; michael@0: unsigned char max; michael@0: } uRange; michael@0: michael@0: /*=====================================*/ michael@0: michael@0: typedef uint16_t* uMappingTableMutable; michael@0: typedef const uint16_t uMappingTable; michael@0: michael@0: #endif michael@0: