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
|
|
|
#include "cmemory.h"
|
|
|
|
|
2001-05-16 17:09:31 +00:00
|
|
|
#ifdef UCOL_DEBUG
|
|
|
|
#include <stdio.h>
|
|
|
|
#endif
|
|
|
|
|
2001-02-26 10:28:56 +00:00
|
|
|
typedef struct {
|
|
|
|
uint32_t *CEs;
|
|
|
|
int32_t position;
|
|
|
|
int32_t size;
|
|
|
|
} ExpansionTable;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
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-08-10 20:30:44 +00:00
|
|
|
CompactEIntArray *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-02-26 10:28:56 +00:00
|
|
|
} tempUCATable;
|
|
|
|
|
2001-03-30 00:23:46 +00:00
|
|
|
U_CAPI tempUCATable * U_EXPORT2 uprv_uca_initTempTable(UCATableHeader *image, UColOptionSet *opts, const UCollator *UCA, UErrorCode *status);
|
2001-05-15 17:39:41 +00:00
|
|
|
U_CAPI tempUCATable *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);
|
|
|
|
U_CAPI UCATableHeader U_EXPORT2 *uprv_uca_assembleTable(tempUCATable *t, UErrorCode *status);
|
|
|
|
|
2001-05-16 18:11:32 +00:00
|
|
|
uint32_t uprv_uca_processContraction(CntTable *contractions, UCAElements *element, uint32_t existingCE, UErrorCode *status);
|
2001-02-26 10:28:56 +00:00
|
|
|
int32_t uprv_uca_addExpansion(ExpansionTable *expansions, uint32_t value, UErrorCode *status);
|
2001-03-22 21:16:20 +00:00
|
|
|
void uprv_uca_reverseElement(UCAElements *el);
|
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-02-27 18:38:48 +00:00
|
|
|
#endif
|