1*0e209d39SAndroid Build Coastguard Worker // © 2016 and later: Unicode, Inc. and others. 2*0e209d39SAndroid Build Coastguard Worker // License & terms of use: http://www.unicode.org/copyright.html 3*0e209d39SAndroid Build Coastguard Worker /* 4*0e209d39SAndroid Build Coastguard Worker ******************************************************************************* 5*0e209d39SAndroid Build Coastguard Worker * Copyright (C) 2000-2011, International Business Machines 6*0e209d39SAndroid Build Coastguard Worker * Corporation and others. All Rights Reserved. 7*0e209d39SAndroid Build Coastguard Worker ******************************************************************************* 8*0e209d39SAndroid Build Coastguard Worker * file name: ucol_data.h 9*0e209d39SAndroid Build Coastguard Worker * encoding: UTF-8 10*0e209d39SAndroid Build Coastguard Worker * tab size: 8 (not used) 11*0e209d39SAndroid Build Coastguard Worker * indentation:4 12*0e209d39SAndroid Build Coastguard Worker * 13*0e209d39SAndroid Build Coastguard Worker * created on: 2011jul02 14*0e209d39SAndroid Build Coastguard Worker * created by: Markus Scherer 15*0e209d39SAndroid Build Coastguard Worker * 16*0e209d39SAndroid Build Coastguard Worker * Private implementation header for C/C++ collation. 17*0e209d39SAndroid Build Coastguard Worker * Some file data structure definitions were moved here from i18n/ucol_imp.h 18*0e209d39SAndroid Build Coastguard Worker * so that the common library (via ucol_swp.cpp) need not depend on the i18n library at all. 19*0e209d39SAndroid Build Coastguard Worker * 20*0e209d39SAndroid Build Coastguard Worker * We do not want to move the collation swapper to the i18n library because 21*0e209d39SAndroid Build Coastguard Worker * a) the resource bundle swapper depends on it and would have to move too, and 22*0e209d39SAndroid Build Coastguard Worker * b) we might want to eventually implement runtime data swapping, 23*0e209d39SAndroid Build Coastguard Worker * which might (or might not) be easier if all swappers are in the common library. 24*0e209d39SAndroid Build Coastguard Worker */ 25*0e209d39SAndroid Build Coastguard Worker 26*0e209d39SAndroid Build Coastguard Worker #ifndef __UCOL_DATA_H__ 27*0e209d39SAndroid Build Coastguard Worker #define __UCOL_DATA_H__ 28*0e209d39SAndroid Build Coastguard Worker 29*0e209d39SAndroid Build Coastguard Worker #include "unicode/utypes.h" 30*0e209d39SAndroid Build Coastguard Worker 31*0e209d39SAndroid Build Coastguard Worker #if !UCONFIG_NO_COLLATION 32*0e209d39SAndroid Build Coastguard Worker 33*0e209d39SAndroid Build Coastguard Worker /* let us know whether reserved fields are reset to zero or junked */ 34*0e209d39SAndroid Build Coastguard Worker #define UCOL_HEADER_MAGIC 0x20030618 35*0e209d39SAndroid Build Coastguard Worker 36*0e209d39SAndroid Build Coastguard Worker typedef struct { 37*0e209d39SAndroid Build Coastguard Worker int32_t size; 38*0e209d39SAndroid Build Coastguard Worker /* all the offsets are in bytes */ 39*0e209d39SAndroid Build Coastguard Worker /* to get the address add to the header address and cast properly */ 40*0e209d39SAndroid Build Coastguard Worker uint32_t options; /* these are the default options for the collator */ 41*0e209d39SAndroid Build Coastguard Worker uint32_t UCAConsts; /* structure which holds values for indirect positioning and implicit ranges */ 42*0e209d39SAndroid Build Coastguard Worker uint32_t contractionUCACombos; /* this one is needed only for UCA, to copy the appropriate contractions */ 43*0e209d39SAndroid Build Coastguard Worker uint32_t magic; /* magic number - lets us know whether reserved data is reset or junked */ 44*0e209d39SAndroid Build Coastguard Worker uint32_t mappingPosition; /* const uint8_t *mappingPosition; */ 45*0e209d39SAndroid Build Coastguard Worker uint32_t expansion; /* uint32_t *expansion; */ 46*0e209d39SAndroid Build Coastguard Worker uint32_t contractionIndex; /* char16_t *contractionIndex; */ 47*0e209d39SAndroid Build Coastguard Worker uint32_t contractionCEs; /* uint32_t *contractionCEs; */ 48*0e209d39SAndroid Build Coastguard Worker uint32_t contractionSize; /* needed for various closures */ 49*0e209d39SAndroid Build Coastguard Worker /*int32_t latinOneMapping;*/ /* this is now handled in the trie itself *//* fast track to latin1 chars */ 50*0e209d39SAndroid Build Coastguard Worker 51*0e209d39SAndroid Build Coastguard Worker uint32_t endExpansionCE; /* array of last collation element in 52*0e209d39SAndroid Build Coastguard Worker expansion */ 53*0e209d39SAndroid Build Coastguard Worker uint32_t expansionCESize; /* array of maximum expansion size 54*0e209d39SAndroid Build Coastguard Worker corresponding to the expansion 55*0e209d39SAndroid Build Coastguard Worker collation elements with last element 56*0e209d39SAndroid Build Coastguard Worker in endExpansionCE*/ 57*0e209d39SAndroid Build Coastguard Worker int32_t endExpansionCECount; /* size of endExpansionCE */ 58*0e209d39SAndroid Build Coastguard Worker uint32_t unsafeCP; /* hash table of unsafe code points */ 59*0e209d39SAndroid Build Coastguard Worker uint32_t contrEndCP; /* hash table of final code points */ 60*0e209d39SAndroid Build Coastguard Worker /* in contractions. */ 61*0e209d39SAndroid Build Coastguard Worker 62*0e209d39SAndroid Build Coastguard Worker int32_t contractionUCACombosSize; /* number of UCA contraction items. */ 63*0e209d39SAndroid Build Coastguard Worker /*Length is contractionUCACombosSize*contractionUCACombosWidth*sizeof(char16_t) */ 64*0e209d39SAndroid Build Coastguard Worker UBool jamoSpecial; /* is jamoSpecial */ 65*0e209d39SAndroid Build Coastguard Worker UBool isBigEndian; /* is this data big endian? from the UDataInfo header*/ 66*0e209d39SAndroid Build Coastguard Worker uint8_t charSetFamily; /* what is the charset family of this data from the UDataInfo header*/ 67*0e209d39SAndroid Build Coastguard Worker uint8_t contractionUCACombosWidth; /* width of UCA combos field */ 68*0e209d39SAndroid Build Coastguard Worker UVersionInfo version; 69*0e209d39SAndroid Build Coastguard Worker UVersionInfo UCAVersion; /* version of the UCA, read from file */ 70*0e209d39SAndroid Build Coastguard Worker UVersionInfo UCDVersion; /* UCD version, obtained by u_getUnicodeVersion */ 71*0e209d39SAndroid Build Coastguard Worker UVersionInfo formatVersion; /* format version from the UDataInfo header */ 72*0e209d39SAndroid Build Coastguard Worker uint32_t scriptToLeadByte; /* offset to script to lead collation byte mapping data */ 73*0e209d39SAndroid Build Coastguard Worker uint32_t leadByteToScript; /* offset to lead collation byte to script mapping data */ 74*0e209d39SAndroid Build Coastguard Worker uint8_t reserved[76]; /* for future use */ 75*0e209d39SAndroid Build Coastguard Worker } UCATableHeader; 76*0e209d39SAndroid Build Coastguard Worker 77*0e209d39SAndroid Build Coastguard Worker typedef struct { 78*0e209d39SAndroid Build Coastguard Worker uint32_t byteSize; 79*0e209d39SAndroid Build Coastguard Worker uint32_t tableSize; 80*0e209d39SAndroid Build Coastguard Worker uint32_t contsSize; 81*0e209d39SAndroid Build Coastguard Worker uint32_t table; 82*0e209d39SAndroid Build Coastguard Worker uint32_t conts; 83*0e209d39SAndroid Build Coastguard Worker UVersionInfo UCAVersion; /* version of the UCA, read from file */ 84*0e209d39SAndroid Build Coastguard Worker uint8_t padding[8]; 85*0e209d39SAndroid Build Coastguard Worker } InverseUCATableHeader; 86*0e209d39SAndroid Build Coastguard Worker 87*0e209d39SAndroid Build Coastguard Worker #endif /* !UCONFIG_NO_COLLATION */ 88*0e209d39SAndroid Build Coastguard Worker 89*0e209d39SAndroid Build Coastguard Worker #endif /* __UCOL_DATA_H__ */ 90