• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 *******************************************************************************
3 *
4 *   Copyright (C) 1999-2005, International Business Machines
5 *   Corporation and others.  All Rights Reserved.
6 *
7 *******************************************************************************
8 *   file name:  gennorm.h
9 *   encoding:   US-ASCII
10 *   tab size:   8 (not used)
11 *   indentation:4
12 *
13 *   created on: 2001may25
14 *   created by: Markus W. Scherer
15 */
16 
17 #ifndef __GENPROPS_H__
18 #define __GENPROPS_H__
19 
20 #include "unicode/utypes.h"
21 #include "unicode/uset.h"
22 
23 /* file definitions */
24 #define DATA_NAME "unorm"
25 #define DATA_TYPE "icu"
26 
27 /*
28  * data structure that holds the normalization properties for one or more
29  * code point(s) at build time
30  */
31 typedef struct Norm {
32     uint8_t udataCC, lenNFD, lenNFKD;
33     uint8_t qcFlags, combiningFlags;
34     uint16_t canonBothCCs, compatBothCCs, combiningIndex, specialTag;
35     uint32_t *nfd, *nfkd;
36     uint32_t value32; /* temporary variable for generating runtime norm32 and fcd values */
37     int32_t fncIndex;
38     USet *canonStart;
39     UBool unsafeStart;
40 } Norm;
41 
42 /*
43  * modularization flags
44  *
45  * Corresponding bits in gStoreFlags control whether certain kinds of data
46  * are to be stored in (1) or omitted from (0) the data file.
47  * The flags are controlled by a command-line argument, with a letter
48  * per flag.
49  */
50 enum {
51     UGENNORM_STORE_COMPAT,      /* (k) compatibility decompositions */
52     UGENNORM_STORE_COMPOSITION, /* (c) composition data */
53     UGENNORM_STORE_FCD,         /* (f) FCD data */
54     UGENNORM_STORE_AUX,         /* (a) auxiliary trie and associated data */
55     UGENNORM_STORE_EXCLUSIONS,  /* (x) exclusion sets */
56     UGENNORM_STORE_COUNT
57 };
58 
59 extern uint32_t gStoreFlags;
60 
61 #define DO_STORE(flag)      (0!=(gStoreFlags&U_MASK(flag)))
62 #define DO_NOT_STORE(flag)  (0==(gStoreFlags&U_MASK(flag)))
63 
64 /* global flags */
65 extern UBool beVerbose, haveCopyright;
66 
67 /* prototypes */
68 extern void
69 setUnicodeVersion(const char *v);
70 
71 extern void
72 init(void);
73 
74 extern void
75 storeNorm(uint32_t code, Norm *norm);
76 
77 extern void
78 setQCFlags(uint32_t code, uint8_t qcFlags);
79 
80 extern void
81 setCompositionExclusion(uint32_t code);
82 
83 U_CFUNC void
84 setFNC(uint32_t c, UChar *s);
85 
86 extern void
87 processData(void);
88 
89 extern void
90 generateData(const char *dataDir, UBool csource);
91 
92 extern void
93 cleanUpData(void);
94 
95 #endif
96 
97