]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | ******************************************************************************* | |
3 | * | |
73c04bcf | 4 | * Copyright (C) 2000-2005, International Business Machines |
b75a7d8f A |
5 | * Corporation and others. All Rights Reserved. |
6 | * | |
7 | ******************************************************************************* | |
8 | * file name: ucol_elm.h | |
9 | * encoding: US-ASCII | |
10 | * tab size: 8 (not used) | |
11 | * indentation:4 | |
12 | * | |
13 | * created 02/22/2001 | |
14 | * created by: Vladimir Weinstein | |
15 | * | |
16 | * This program reads the Franctional UCA table and generates | |
17 | * internal format for UCA table as well as inverse UCA table. | |
18 | * It then writes binary files containing the data: ucadata.dat | |
19 | * & invuca.dat | |
20 | */ | |
21 | #ifndef UCOL_UCAELEMS_H | |
22 | #define UCOL_UCAELEMS_H | |
23 | ||
24 | #include "unicode/utypes.h" | |
25 | ||
26 | #if !UCONFIG_NO_COLLATION | |
27 | ||
28 | #include "ucol_cnt.h" | |
29 | #include "ucol_imp.h" | |
30 | ||
31 | #ifdef UCOL_DEBUG | |
32 | #include "cmemory.h" | |
33 | #include <stdio.h> | |
34 | #endif | |
35 | ||
73c04bcf | 36 | U_CDECL_BEGIN |
b75a7d8f A |
37 | |
38 | typedef struct { | |
39 | uint32_t *CEs; | |
40 | int32_t position; | |
41 | int32_t size; | |
42 | } ExpansionTable; | |
43 | ||
44 | typedef struct { | |
45 | UChar prefixChars[128]; | |
46 | UChar *prefix; | |
47 | uint32_t prefixSize; | |
48 | UChar uchars[128]; | |
49 | UChar *cPoints; | |
50 | uint32_t cSize; /* Number of characters in sequence - for contraction */ | |
51 | uint32_t noOfCEs; /* Number of collation elements */ | |
52 | uint32_t CEs[128]; /* These are collation elements - there could be more than one - in case of expansion */ | |
53 | uint32_t mapCE; /* This is the value element maps in original table */ | |
54 | uint32_t sizePrim[128]; | |
55 | uint32_t sizeSec[128]; | |
56 | uint32_t sizeTer[128]; | |
57 | UBool variableTop; | |
58 | UBool caseBit; | |
59 | UBool isThai; | |
60 | } UCAElements; | |
61 | ||
62 | typedef struct { | |
63 | uint32_t *endExpansionCE; | |
64 | UBool *isV; | |
73c04bcf A |
65 | int32_t position; |
66 | int32_t size; | |
b75a7d8f A |
67 | uint8_t maxLSize; |
68 | uint8_t maxVSize; | |
69 | uint8_t maxTSize; | |
70 | } MaxJamoExpansionTable; | |
71 | ||
72 | typedef struct { | |
73 | uint32_t *endExpansionCE; | |
74 | uint8_t *expansionCESize; | |
73c04bcf A |
75 | int32_t position; |
76 | int32_t size; | |
b75a7d8f A |
77 | } MaxExpansionTable; |
78 | ||
79 | typedef struct { | |
80 | /*CompactEIntArray *mapping; */ | |
81 | UNewTrie *mapping; | |
82 | ExpansionTable *expansions; | |
83 | struct CntTable *contractions; | |
84 | UCATableHeader *image; | |
85 | UColOptionSet *options; | |
86 | MaxExpansionTable *maxExpansions; | |
87 | MaxJamoExpansionTable *maxJamoExpansions; | |
88 | uint8_t *unsafeCP; | |
89 | uint8_t *contrEndCP; | |
90 | const UCollator *UCA; | |
91 | UHashtable *prefixLookup; | |
92 | } tempUCATable; | |
93 | ||
374ca955 | 94 | U_CAPI tempUCATable * U_EXPORT2 uprv_uca_initTempTable(UCATableHeader *image, UColOptionSet *opts, const UCollator *UCA, UColCETags initTag, UColCETags supplementaryInitTag, UErrorCode *status); |
b75a7d8f A |
95 | U_CAPI tempUCATable * U_EXPORT2 uprv_uca_cloneTempTable(tempUCATable *t, UErrorCode *status); |
96 | U_CAPI void U_EXPORT2 uprv_uca_closeTempTable(tempUCATable *t); | |
97 | U_CAPI uint32_t U_EXPORT2 uprv_uca_addAnElement(tempUCATable *t, UCAElements *element, UErrorCode *status); | |
98 | U_CAPI UCATableHeader * U_EXPORT2 uprv_uca_assembleTable(tempUCATable *t, UErrorCode *status); | |
99 | U_CAPI int32_t U_EXPORT2 | |
100 | uprv_uca_canonicalClosure(tempUCATable *t, UErrorCode *status); | |
101 | ||
102 | ||
103 | #define paddedsize(something) ((something)+((((something)%4)!=0)?(4-(something)%4):0)) | |
104 | #define headersize (paddedsize(sizeof(UCATableHeader))+paddedsize(sizeof(UColOptionSet))) | |
105 | ||
73c04bcf | 106 | U_CDECL_END |
b75a7d8f A |
107 | |
108 | #endif /* #if !UCONFIG_NO_COLLATION */ | |
109 | ||
110 | #endif |