]> git.saurik.com Git - apple/icu.git/blame_incremental - icuSources/tools/gencase/gencase.h
ICU-8.11.1.tar.gz
[apple/icu.git] / icuSources / tools / gencase / gencase.h
... / ...
CommitLineData
1/*
2*******************************************************************************
3*
4* Copyright (C) 2004-2005, International Business Machines
5* Corporation and others. All Rights Reserved.
6*
7*******************************************************************************
8* file name: gencase.h
9* encoding: US-ASCII
10* tab size: 8 (not used)
11* indentation:4
12*
13* created on: 2004aug28
14* created by: Markus W. Scherer
15*/
16
17#ifndef __GENCASE_H__
18#define __GENCASE_H__
19
20#include "unicode/utypes.h"
21#include "utrie.h"
22#include "ucase.h"
23
24U_CDECL_BEGIN
25
26/* Unicode versions --------------------------------------------------------- */
27
28enum {
29 UNI_1_0,
30 UNI_1_1,
31 UNI_2_0,
32 UNI_3_0,
33 UNI_3_1,
34 UNI_3_2,
35 UNI_4_0,
36 UNI_4_0_1,
37 UNI_4_1,
38 UNI_VER_COUNT
39};
40
41extern int32_t ucdVersion;
42
43/* gencase ------------------------------------------------------------------ */
44
45#define UGENCASE_EXC_SHIFT 16
46#define UGENCASE_EXC_MASK 0xffff0000
47
48/*
49 * Values for the ucase.icu unfold[] data array, see store.c.
50 * The values are stored in ucase.icu so that the runtime code will work with
51 * changing values, but they are hardcoded for gencase for simplicity.
52 * They are optimized, that is, provide for minimal table column widths,
53 * for the actual Unicode data, so that the table size is minimized.
54 * Future versions of Unicode may require increases of some of these values.
55 */
56enum {
57 UGENCASE_UNFOLD_STRING_WIDTH=3,
58 UGENCASE_UNFOLD_CP_WIDTH=2,
59 UGENCASE_UNFOLD_WIDTH=UGENCASE_UNFOLD_STRING_WIDTH+UGENCASE_UNFOLD_CP_WIDTH,
60 UGENCASE_UNFOLD_MAX_ROWS=250
61};
62
63/* Values for additional data stored in pv column 1 */
64enum {
65 UGENCASE_IS_MID_LETTER_SHIFT /* bit 0 */
66};
67
68/* special casing data */
69typedef struct {
70 UChar32 code;
71 UBool isComplex;
72 UChar lowerCase[32], upperCase[32], titleCase[32];
73} SpecialCasing;
74
75/* case folding data */
76typedef struct {
77 UChar32 code, simple;
78 char status;
79 UChar full[32];
80} CaseFolding;
81
82/* case mapping properties */
83typedef struct {
84 UChar32 code, lowerCase, upperCase, titleCase;
85 UChar32 closure[8];
86 SpecialCasing *specialCasing;
87 CaseFolding *caseFolding;
88 uint8_t gc, cc;
89} Props;
90
91/* global flags */
92extern UBool beVerbose, haveCopyright;
93
94/* properties vectors in gencase.c */
95extern uint32_t *pv;
96
97/* prototypes */
98U_CFUNC void
99writeUCDFilename(char *basename, const char *filename, const char *suffix);
100
101U_CFUNC UBool
102isToken(const char *token, const char *s);
103
104extern void
105setUnicodeVersion(const char *v);
106
107extern void
108setProps(Props *p);
109
110U_CFUNC uint32_t U_EXPORT2
111getFoldedPropsValue(UNewTrie *trie, UChar32 start, int32_t offset);
112
113extern void
114addCaseSensitive(UChar32 first, UChar32 last);
115
116extern void
117makeCaseClosure(void);
118
119extern void
120makeExceptions(void);
121
122extern void
123generateData(const char *dataDir, UBool csource);
124
125U_CDECL_END
126
127#endif