1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/common/ucol_data.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,87 @@ 1.4 +/* 1.5 +******************************************************************************* 1.6 +* Copyright (C) 2000-2011, International Business Machines 1.7 +* Corporation and others. All Rights Reserved. 1.8 +******************************************************************************* 1.9 +* file name: ucol_data.h 1.10 +* encoding: US-ASCII 1.11 +* tab size: 8 (not used) 1.12 +* indentation:4 1.13 +* 1.14 +* created on: 2011jul02 1.15 +* created by: Markus Scherer 1.16 +* 1.17 +* Private implementation header for C/C++ collation. 1.18 +* Some file data structure definitions were moved here from i18n/ucol_imp.h 1.19 +* so that the common library (via ucol_swp.cpp) need not depend on the i18n library at all. 1.20 +* 1.21 +* We do not want to move the collation swapper to the i18n library because 1.22 +* a) the resource bundle swapper depends on it and would have to move too, and 1.23 +* b) we might want to eventually implement runtime data swapping, 1.24 +* which might (or might not) be easier if all swappers are in the common library. 1.25 +*/ 1.26 + 1.27 +#ifndef __UCOL_DATA_H__ 1.28 +#define __UCOL_DATA_H__ 1.29 + 1.30 +#include "unicode/utypes.h" 1.31 + 1.32 +#if !UCONFIG_NO_COLLATION 1.33 + 1.34 +/* let us know whether reserved fields are reset to zero or junked */ 1.35 +#define UCOL_HEADER_MAGIC 0x20030618 1.36 + 1.37 +typedef struct { 1.38 + int32_t size; 1.39 + /* all the offsets are in bytes */ 1.40 + /* to get the address add to the header address and cast properly */ 1.41 + uint32_t options; /* these are the default options for the collator */ 1.42 + uint32_t UCAConsts; /* structure which holds values for indirect positioning and implicit ranges */ 1.43 + uint32_t contractionUCACombos; /* this one is needed only for UCA, to copy the appropriate contractions */ 1.44 + uint32_t magic; /* magic number - lets us know whether reserved data is reset or junked */ 1.45 + uint32_t mappingPosition; /* const uint8_t *mappingPosition; */ 1.46 + uint32_t expansion; /* uint32_t *expansion; */ 1.47 + uint32_t contractionIndex; /* UChar *contractionIndex; */ 1.48 + uint32_t contractionCEs; /* uint32_t *contractionCEs; */ 1.49 + uint32_t contractionSize; /* needed for various closures */ 1.50 + /*int32_t latinOneMapping;*/ /* this is now handled in the trie itself *//* fast track to latin1 chars */ 1.51 + 1.52 + uint32_t endExpansionCE; /* array of last collation element in 1.53 + expansion */ 1.54 + uint32_t expansionCESize; /* array of maximum expansion size 1.55 + corresponding to the expansion 1.56 + collation elements with last element 1.57 + in endExpansionCE*/ 1.58 + int32_t endExpansionCECount; /* size of endExpansionCE */ 1.59 + uint32_t unsafeCP; /* hash table of unsafe code points */ 1.60 + uint32_t contrEndCP; /* hash table of final code points */ 1.61 + /* in contractions. */ 1.62 + 1.63 + int32_t contractionUCACombosSize; /* number of UCA contraction items. */ 1.64 + /*Length is contractionUCACombosSize*contractionUCACombosWidth*sizeof(UChar) */ 1.65 + UBool jamoSpecial; /* is jamoSpecial */ 1.66 + UBool isBigEndian; /* is this data big endian? from the UDataInfo header*/ 1.67 + uint8_t charSetFamily; /* what is the charset family of this data from the UDataInfo header*/ 1.68 + uint8_t contractionUCACombosWidth; /* width of UCA combos field */ 1.69 + UVersionInfo version; 1.70 + UVersionInfo UCAVersion; /* version of the UCA, read from file */ 1.71 + UVersionInfo UCDVersion; /* UCD version, obtained by u_getUnicodeVersion */ 1.72 + UVersionInfo formatVersion; /* format version from the UDataInfo header */ 1.73 + uint32_t scriptToLeadByte; /* offset to script to lead collation byte mapping data */ 1.74 + uint32_t leadByteToScript; /* offset to lead collation byte to script mapping data */ 1.75 + uint8_t reserved[76]; /* for future use */ 1.76 +} UCATableHeader; 1.77 + 1.78 +typedef struct { 1.79 + uint32_t byteSize; 1.80 + uint32_t tableSize; 1.81 + uint32_t contsSize; 1.82 + uint32_t table; 1.83 + uint32_t conts; 1.84 + UVersionInfo UCAVersion; /* version of the UCA, read from file */ 1.85 + uint8_t padding[8]; 1.86 +} InverseUCATableHeader; 1.87 + 1.88 +#endif /* !UCONFIG_NO_COLLATION */ 1.89 + 1.90 +#endif /* __UCOL_DATA_H__ */