intl/icu/source/i18n/ucol_elm.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/ucol_elm.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,146 @@
     1.4 +/*
     1.5 +*******************************************************************************
     1.6 +*
     1.7 +*   Copyright (C) 2000-2011, International Business Machines
     1.8 +*   Corporation and others.  All Rights Reserved.
     1.9 +*
    1.10 +*******************************************************************************
    1.11 +*   file name:  ucol_elm.h
    1.12 +*   encoding:   US-ASCII
    1.13 +*   tab size:   8 (not used)
    1.14 +*   indentation:4
    1.15 +*
    1.16 +*   created 02/22/2001
    1.17 +*   created by: Vladimir Weinstein
    1.18 +*
    1.19 +*   This program reads the Franctional UCA table and generates
    1.20 +*   internal format for UCA table as well as inverse UCA table.
    1.21 +*   It then writes binary files containing the data: ucadata.dat 
    1.22 +*   & invuca.dat
    1.23 +*/
    1.24 +#ifndef UCOL_UCAELEMS_H
    1.25 +#define UCOL_UCAELEMS_H
    1.26 +
    1.27 +#include "unicode/utypes.h"
    1.28 +#include "unicode/uniset.h"
    1.29 +#include "ucol_tok.h"
    1.30 +
    1.31 +#if !UCONFIG_NO_COLLATION
    1.32 +
    1.33 +#include "ucol_imp.h"
    1.34 +
    1.35 +#ifdef UCOL_DEBUG
    1.36 +#include "cmemory.h"
    1.37 +#include <stdio.h>
    1.38 +#endif
    1.39 +
    1.40 +U_CDECL_BEGIN
    1.41 +
    1.42 +/* This is the maximum trie capacity for the mapping trie.
    1.43 +Due to current limitations in genuca and the design of UTrie,
    1.44 +this number can't be more than 256K.
    1.45 +As of Unicode 5, it currently could safely go to 128K without
    1.46 +a problem. Normally, less than 32K are tailored.
    1.47 +*/
    1.48 +#define UCOL_ELM_TRIE_CAPACITY 0x40000
    1.49 +
    1.50 +/* This is the maxmun capacity for temparay combining class 
    1.51 + * table.  The table will be compacted after scanning all the
    1.52 + * Unicode codepoints.
    1.53 +*/
    1.54 +#define UCOL_MAX_CM_TAB  0x10000
    1.55 +
    1.56 +
    1.57 +typedef struct {
    1.58 +    uint32_t *CEs;
    1.59 +    int32_t position;
    1.60 +    int32_t size;
    1.61 +} ExpansionTable;
    1.62 +
    1.63 +typedef struct {
    1.64 +    UChar prefixChars[128];
    1.65 +    UChar *prefix;
    1.66 +    uint32_t prefixSize;
    1.67 +    UChar uchars[128];
    1.68 +    UChar *cPoints;
    1.69 +    uint32_t cSize;          /* Number of characters in sequence - for contraction */
    1.70 +    uint32_t noOfCEs;        /* Number of collation elements                       */
    1.71 +    uint32_t CEs[128];      /* These are collation elements - there could be more than one - in case of expansion */
    1.72 +    uint32_t mapCE;         /* This is the value element maps in original table   */
    1.73 +    uint32_t sizePrim[128];
    1.74 +    uint32_t sizeSec[128];
    1.75 +    uint32_t sizeTer[128];
    1.76 +    UBool caseBit;
    1.77 +    UBool isThai;
    1.78 +} UCAElements;
    1.79 +
    1.80 +typedef struct {
    1.81 +  uint32_t *endExpansionCE;
    1.82 +  UBool    *isV;
    1.83 +  int32_t   position;
    1.84 +  int32_t   size;
    1.85 +  uint8_t   maxLSize;
    1.86 +  uint8_t   maxVSize;
    1.87 +  uint8_t   maxTSize;
    1.88 +} MaxJamoExpansionTable;
    1.89 +
    1.90 +typedef struct {
    1.91 +  uint32_t *endExpansionCE;
    1.92 +  uint8_t  *expansionCESize;
    1.93 +  int32_t   position;
    1.94 +  int32_t   size;
    1.95 +} MaxExpansionTable;
    1.96 +
    1.97 +typedef struct {
    1.98 +    uint16_t   index[256];  /* index of cPoints by combining class 0-255. */
    1.99 +    UChar      *cPoints;    /* code point array of all combining marks */
   1.100 +    uint32_t   size;        /* total number of combining marks */
   1.101 +} CombinClassTable;
   1.102 +
   1.103 +typedef struct {
   1.104 +  /*CompactEIntArray      *mapping; */
   1.105 +  UNewTrie                 *mapping; 
   1.106 +  ExpansionTable        *expansions; 
   1.107 +  struct CntTable       *contractions;
   1.108 +  UCATableHeader        *image;
   1.109 +  UColOptionSet         *options;
   1.110 +  MaxExpansionTable     *maxExpansions;
   1.111 +  MaxJamoExpansionTable *maxJamoExpansions;
   1.112 +  uint8_t               *unsafeCP;
   1.113 +  uint8_t               *contrEndCP;
   1.114 +  const UCollator       *UCA;
   1.115 +  UHashtable      *prefixLookup;
   1.116 +  CombinClassTable      *cmLookup;  /* combining class lookup for tailoring. */
   1.117 +} tempUCATable; 
   1.118 +
   1.119 +typedef struct {
   1.120 +    UChar cp;
   1.121 +    uint16_t cClass;   // combining class
   1.122 +}CompData;
   1.123 +
   1.124 +typedef struct {
   1.125 +    CompData *precomp;
   1.126 +    int32_t precompLen;
   1.127 +    UChar *decomp;
   1.128 +    int32_t decompLen;
   1.129 +    UChar *comp;
   1.130 +    int32_t compLen;
   1.131 +    uint16_t curClass;
   1.132 +    uint16_t tailoringCM;
   1.133 +    int32_t  cmPos;
   1.134 +}tempTailorContext;
   1.135 +
   1.136 +U_CAPI tempUCATable * U_EXPORT2 uprv_uca_initTempTable(UCATableHeader *image, UColOptionSet *opts, const UCollator *UCA, UColCETags initTag, UColCETags supplementaryInitTag, UErrorCode *status);
   1.137 +U_CAPI void U_EXPORT2 uprv_uca_closeTempTable(tempUCATable *t);
   1.138 +U_CAPI uint32_t U_EXPORT2 uprv_uca_addAnElement(tempUCATable *t, UCAElements *element, UErrorCode *status);
   1.139 +U_CAPI UCATableHeader * U_EXPORT2 uprv_uca_assembleTable(tempUCATable *t, UErrorCode *status);
   1.140 +
   1.141 +U_CAPI int32_t U_EXPORT2
   1.142 +uprv_uca_canonicalClosure(tempUCATable *t, UColTokenParser *src,
   1.143 +                          icu::UnicodeSet *closed, UErrorCode *status);
   1.144 +
   1.145 +U_CDECL_END
   1.146 +
   1.147 +#endif /* #if !UCONFIG_NO_COLLATION */
   1.148 +
   1.149 +#endif

mercurial