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 */ 31typedef 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 */ 50enum { 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 59extern 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 */ 65extern UBool beVerbose, haveCopyright; 66 67/* prototypes */ 68extern void 69setUnicodeVersion(const char *v); 70 71extern void 72init(void); 73 74extern void 75storeNorm(uint32_t code, Norm *norm); 76 77extern void 78setQCFlags(uint32_t code, uint8_t qcFlags); 79 80extern void 81setCompositionExclusion(uint32_t code); 82 83U_CFUNC void 84setFNC(uint32_t c, UChar *s); 85 86extern void 87processData(void); 88 89extern void 90generateData(const char *dataDir, UBool csource); 91 92extern void 93cleanUpData(void); 94 95#endif 96 97