2001-02-26 10:28:56 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright (C) 2000-2001, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
|
|
|
*******************************************************************************
|
2001-03-08 17:40:42 +00:00
|
|
|
* file name: ucol_elm.h
|
2001-02-26 10:28:56 +00:00
|
|
|
* encoding: US-ASCII
|
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created 02/22/2001
|
|
|
|
* created by: Vladimir Weinstein
|
|
|
|
*
|
|
|
|
* This program reads the Franctional UCA table and generates
|
|
|
|
* internal format for UCA table as well as inverse UCA table.
|
|
|
|
* It then writes binary files containing the data: ucadata.dat
|
|
|
|
* & invuca.dat
|
|
|
|
*/
|
|
|
|
#ifndef UCOL_UCAELEMS_H
|
|
|
|
#define UCOL_UCAELEMS_H
|
|
|
|
|
2001-03-08 17:40:42 +00:00
|
|
|
#include "ucol_cnt.h"
|
2001-02-26 10:28:56 +00:00
|
|
|
#include "unicode/utypes.h"
|
2001-03-08 17:40:42 +00:00
|
|
|
#include "ucol_imp.h"
|
2001-02-26 10:28:56 +00:00
|
|
|
|
2001-05-16 17:09:31 +00:00
|
|
|
#ifdef UCOL_DEBUG
|
2002-02-28 01:42:40 +00:00
|
|
|
#include "cmemory.h"
|
2001-05-16 17:09:31 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#endif
|
|
|
|
|
2001-10-20 01:09:31 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2001-02-26 10:28:56 +00:00
|
|
|
typedef struct {
|
|
|
|
uint32_t *CEs;
|
|
|
|
int32_t position;
|
|
|
|
int32_t size;
|
|
|
|
} ExpansionTable;
|
|
|
|
|
|
|
|
typedef struct {
|
2001-09-27 23:18:14 +00:00
|
|
|
UChar prefixChars[128];
|
|
|
|
UChar *prefix;
|
|
|
|
uint32_t prefixSize;
|
2001-02-26 10:28:56 +00:00
|
|
|
UChar uchars[128];
|
|
|
|
UChar *cPoints;
|
2001-03-22 21:16:20 +00:00
|
|
|
uint32_t cSize; /* Number of characters in sequence - for contraction */
|
|
|
|
uint32_t noOfCEs; /* Number of collation elements */
|
2001-02-26 10:28:56 +00:00
|
|
|
uint32_t CEs[128]; /* These are collation elements - there could be more than one - in case of expansion */
|
|
|
|
uint32_t mapCE; /* This is the value element maps in original table */
|
2001-03-22 21:16:20 +00:00
|
|
|
uint32_t sizePrim[128];
|
|
|
|
uint32_t sizeSec[128];
|
|
|
|
uint32_t sizeTer[128];
|
2001-02-26 10:28:56 +00:00
|
|
|
UBool variableTop;
|
|
|
|
UBool caseBit;
|
|
|
|
UBool isThai;
|
|
|
|
} UCAElements;
|
|
|
|
|
2001-06-12 15:53:34 +00:00
|
|
|
typedef struct {
|
|
|
|
uint32_t *endExpansionCE;
|
|
|
|
UBool *isV;
|
|
|
|
int position;
|
|
|
|
int size;
|
|
|
|
uint8_t maxLSize;
|
|
|
|
uint8_t maxVSize;
|
|
|
|
uint8_t maxTSize;
|
|
|
|
} MaxJamoExpansionTable;
|
|
|
|
|
2001-02-26 10:28:56 +00:00
|
|
|
typedef struct {
|
2001-03-02 01:14:03 +00:00
|
|
|
uint32_t *endExpansionCE;
|
|
|
|
uint8_t *expansionCESize;
|
|
|
|
int position;
|
|
|
|
int size;
|
|
|
|
} MaxExpansionTable;
|
|
|
|
|
|
|
|
typedef struct {
|
2001-12-19 07:00:45 +00:00
|
|
|
/*CompactEIntArray *mapping; */
|
|
|
|
UNewTrie *mapping;
|
2001-06-12 15:53:34 +00:00
|
|
|
ExpansionTable *expansions;
|
|
|
|
struct CntTable *contractions;
|
|
|
|
UCATableHeader *image;
|
|
|
|
UColOptionSet *options;
|
|
|
|
MaxExpansionTable *maxExpansions;
|
|
|
|
MaxJamoExpansionTable *maxJamoExpansions;
|
|
|
|
uint8_t *unsafeCP;
|
|
|
|
uint8_t *contrEndCP;
|
|
|
|
const UCollator *UCA;
|
2001-10-02 01:26:13 +00:00
|
|
|
UHashtable *prefixLookup;
|
2001-02-26 10:28:56 +00:00
|
|
|
} tempUCATable;
|
|
|
|
|
2001-09-20 20:16:39 +00:00
|
|
|
U_CAPI tempUCATable * U_EXPORT2 uprv_uca_initTempTable(UCATableHeader *image, UColOptionSet *opts, const UCollator *UCA, UColCETags initTag, UErrorCode *status);
|
|
|
|
U_CAPI tempUCATable * U_EXPORT2 uprv_uca_cloneTempTable(tempUCATable *t, UErrorCode *status);
|
2001-02-26 10:28:56 +00:00
|
|
|
U_CAPI void U_EXPORT2 uprv_uca_closeTempTable(tempUCATable *t);
|
|
|
|
U_CAPI uint32_t U_EXPORT2 uprv_uca_addAnElement(tempUCATable *t, UCAElements *element, UErrorCode *status);
|
2001-09-20 20:16:39 +00:00
|
|
|
U_CAPI UCATableHeader * U_EXPORT2 uprv_uca_assembleTable(tempUCATable *t, UErrorCode *status);
|
2002-07-13 05:24:35 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2002-06-13 18:31:34 +00:00
|
|
|
uprv_uca_canonicalClosure(tempUCATable *t, UErrorCode *status);
|
|
|
|
|
2001-02-26 10:28:56 +00:00
|
|
|
|
|
|
|
#define paddedsize(something) ((something)+((((something)%4)!=0)?(4-(something)%4):0))
|
2001-03-30 00:23:46 +00:00
|
|
|
#define headersize (paddedsize(sizeof(UCATableHeader))+paddedsize(sizeof(UColOptionSet)))
|
2001-02-26 10:28:56 +00:00
|
|
|
|
2001-10-20 01:09:31 +00:00
|
|
|
U_NAMESPACE_END
|
|
|
|
|
2001-02-27 18:38:48 +00:00
|
|
|
#endif
|