intl/uconv/public/uconvutil.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/uconv/public/uconvutil.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,98 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +#ifndef __UCONV_TIL_H__
     1.9 +#define __UCONV_TIL_H__
    1.10 +
    1.11 +#include "prcpucfg.h"
    1.12 +
    1.13 +
    1.14 +/*=====================================*/
    1.15 +#define PACK(h,l)   (int16_t)(( (h) << 8) | (l))
    1.16 +
    1.17 +#if defined(IS_LITTLE_ENDIAN)
    1.18 +#define ShiftInCell(sub,len,min,max)  \
    1.19 +    PACK(len,sub), PACK(max,min)
    1.20 +#define ShiftOutCell(sub,len,minh,minl,maxh,maxl)  \
    1.21 +    PACK(len,sub), PACK(minl,minh), PACK(maxl,maxh)
    1.22 +#else
    1.23 +#define ShiftInCell(sub,len,min,max)  \
    1.24 +    PACK(sub,len), PACK(min, max)
    1.25 +#define ShiftOutCell(sub,len,minh,minl,maxh,maxl)  \
    1.26 +    PACK(sub,len), PACK(minh,minl), PACK(maxh,maxl)
    1.27 +#endif
    1.28 +
    1.29 +typedef enum {
    1.30 +        u1ByteCharset = 0,
    1.31 +        u2BytesCharset,
    1.32 +        u2BytesGRCharset,
    1.33 +        u2BytesGRPrefix8FCharset,
    1.34 +        u2BytesGRPrefix8EA2Charset,
    1.35 +        u2BytesGRPrefix8EA3Charset,
    1.36 +        u2BytesGRPrefix8EA4Charset,
    1.37 +        u2BytesGRPrefix8EA5Charset,
    1.38 +        u2BytesGRPrefix8EA6Charset,
    1.39 +        u2BytesGRPrefix8EA7Charset,
    1.40 +        uDecomposedHangulCharset,
    1.41 +        uJohabHangulCharset,
    1.42 +        uJohabSymbolCharset,
    1.43 +        u4BytesGB18030Charset,
    1.44 +        u2BytesGR128Charset,
    1.45 +        uMultibytesCharset,
    1.46 +        uNumOfCharsetType = uMultibytesCharset
    1.47 +} uScanClassID;
    1.48 +
    1.49 +typedef enum {
    1.50 +        u1ByteChar                      = 0,
    1.51 +        u2BytesChar,
    1.52 +        u2BytesGRChar,
    1.53 +        u1BytePrefix8EChar,             /* Used by JIS0201 GR in EUC_JP */
    1.54 +        uNumOfCharType
    1.55 +} uScanSubClassID;
    1.56 +
    1.57 +typedef struct  {
    1.58 +        unsigned char   classID;
    1.59 +        unsigned char   reserveLen;
    1.60 +        unsigned char   shiftin_Min;
    1.61 +        unsigned char   shiftin_Max;
    1.62 +} uShiftInCell;
    1.63 +
    1.64 +typedef struct  {
    1.65 +        int16_t         numOfItem;
    1.66 +        uShiftInCell    shiftcell[1];
    1.67 +} uShiftInTableMutable;
    1.68 +
    1.69 +typedef const uShiftInTableMutable uShiftInTable;
    1.70 +
    1.71 +typedef struct  {
    1.72 +        unsigned char   classID;
    1.73 +        unsigned char   reserveLen;
    1.74 +        unsigned char   shiftout_MinHB;
    1.75 +        unsigned char   shiftout_MinLB;
    1.76 +        unsigned char   shiftout_MaxHB;
    1.77 +        unsigned char   shiftout_MaxLB;
    1.78 +} uShiftOutCell;
    1.79 +
    1.80 +typedef struct  {
    1.81 +        int16_t         numOfItem;
    1.82 +        uShiftOutCell   shiftcell[1];
    1.83 +} uShiftOutTableMutable;
    1.84 +
    1.85 +typedef const uShiftOutTableMutable uShiftOutTable;
    1.86 +
    1.87 +
    1.88 +/*=====================================*/
    1.89 +
    1.90 +typedef struct {
    1.91 +        unsigned char min;
    1.92 +        unsigned char max;
    1.93 +} uRange;
    1.94 +
    1.95 +/*=====================================*/
    1.96 +
    1.97 +typedef uint16_t* uMappingTableMutable; 
    1.98 +typedef const uint16_t uMappingTable; 
    1.99 + 
   1.100 +#endif
   1.101 +

mercurial