michael@0: /* michael@0: ******************************************************************************* michael@0: * Copyright (C) 2000-2011, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: ******************************************************************************* michael@0: * file name: ucol_data.h michael@0: * encoding: US-ASCII michael@0: * tab size: 8 (not used) michael@0: * indentation:4 michael@0: * michael@0: * created on: 2011jul02 michael@0: * created by: Markus Scherer michael@0: * michael@0: * Private implementation header for C/C++ collation. michael@0: * Some file data structure definitions were moved here from i18n/ucol_imp.h michael@0: * so that the common library (via ucol_swp.cpp) need not depend on the i18n library at all. michael@0: * michael@0: * We do not want to move the collation swapper to the i18n library because michael@0: * a) the resource bundle swapper depends on it and would have to move too, and michael@0: * b) we might want to eventually implement runtime data swapping, michael@0: * which might (or might not) be easier if all swappers are in the common library. michael@0: */ michael@0: michael@0: #ifndef __UCOL_DATA_H__ michael@0: #define __UCOL_DATA_H__ michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: #if !UCONFIG_NO_COLLATION michael@0: michael@0: /* let us know whether reserved fields are reset to zero or junked */ michael@0: #define UCOL_HEADER_MAGIC 0x20030618 michael@0: michael@0: typedef struct { michael@0: int32_t size; michael@0: /* all the offsets are in bytes */ michael@0: /* to get the address add to the header address and cast properly */ michael@0: uint32_t options; /* these are the default options for the collator */ michael@0: uint32_t UCAConsts; /* structure which holds values for indirect positioning and implicit ranges */ michael@0: uint32_t contractionUCACombos; /* this one is needed only for UCA, to copy the appropriate contractions */ michael@0: uint32_t magic; /* magic number - lets us know whether reserved data is reset or junked */ michael@0: uint32_t mappingPosition; /* const uint8_t *mappingPosition; */ michael@0: uint32_t expansion; /* uint32_t *expansion; */ michael@0: uint32_t contractionIndex; /* UChar *contractionIndex; */ michael@0: uint32_t contractionCEs; /* uint32_t *contractionCEs; */ michael@0: uint32_t contractionSize; /* needed for various closures */ michael@0: /*int32_t latinOneMapping;*/ /* this is now handled in the trie itself *//* fast track to latin1 chars */ michael@0: michael@0: uint32_t endExpansionCE; /* array of last collation element in michael@0: expansion */ michael@0: uint32_t expansionCESize; /* array of maximum expansion size michael@0: corresponding to the expansion michael@0: collation elements with last element michael@0: in endExpansionCE*/ michael@0: int32_t endExpansionCECount; /* size of endExpansionCE */ michael@0: uint32_t unsafeCP; /* hash table of unsafe code points */ michael@0: uint32_t contrEndCP; /* hash table of final code points */ michael@0: /* in contractions. */ michael@0: michael@0: int32_t contractionUCACombosSize; /* number of UCA contraction items. */ michael@0: /*Length is contractionUCACombosSize*contractionUCACombosWidth*sizeof(UChar) */ michael@0: UBool jamoSpecial; /* is jamoSpecial */ michael@0: UBool isBigEndian; /* is this data big endian? from the UDataInfo header*/ michael@0: uint8_t charSetFamily; /* what is the charset family of this data from the UDataInfo header*/ michael@0: uint8_t contractionUCACombosWidth; /* width of UCA combos field */ michael@0: UVersionInfo version; michael@0: UVersionInfo UCAVersion; /* version of the UCA, read from file */ michael@0: UVersionInfo UCDVersion; /* UCD version, obtained by u_getUnicodeVersion */ michael@0: UVersionInfo formatVersion; /* format version from the UDataInfo header */ michael@0: uint32_t scriptToLeadByte; /* offset to script to lead collation byte mapping data */ michael@0: uint32_t leadByteToScript; /* offset to lead collation byte to script mapping data */ michael@0: uint8_t reserved[76]; /* for future use */ michael@0: } UCATableHeader; michael@0: michael@0: typedef struct { michael@0: uint32_t byteSize; michael@0: uint32_t tableSize; michael@0: uint32_t contsSize; michael@0: uint32_t table; michael@0: uint32_t conts; michael@0: UVersionInfo UCAVersion; /* version of the UCA, read from file */ michael@0: uint8_t padding[8]; michael@0: } InverseUCATableHeader; michael@0: michael@0: #endif /* !UCONFIG_NO_COLLATION */ michael@0: michael@0: #endif /* __UCOL_DATA_H__ */