/* ******************************************************************************* * * Copyright (C) 2002, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: uprops.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 2002feb24 * created by: Markus W. Scherer * * Constants for mostly non-core Unicode character properties * stored in uprops.dat. */ #ifndef __UPROPS_H__ #define __UPROPS_H__ #include "unicode/utypes.h" #include "unicode/uset.h" /* indexes[] entries */ enum { UPROPS_PROPS32_INDEX, UPROPS_EXCEPTIONS_INDEX, UPROPS_EXCEPTIONS_TOP_INDEX, UPROPS_ADDITIONAL_TRIE_INDEX, UPROPS_ADDITIONAL_VECTORS_INDEX, UPROPS_ADDITIONAL_VECTORS_COLUMNS_INDEX, UPROPS_RESERVED_INDEX, /* 6 */ /* maximum values for code values in vector word 0 */ UPROPS_MAX_VALUES_INDEX=10, /* maximum values for code values in vector word 2 */ UPROPS_MAX_VALUES_2_INDEX, UPROPS_INDEX_COUNT=16 }; /* definitions for the main properties words */ enum { /* general category shift==0 0 (5 bits) */ UPROPS_EXCEPTION_SHIFT=5, /* 5 (1 bit) */ UPROPS_BIDI_SHIFT, /* 6 (5 bits) */ UPROPS_MIRROR_SHIFT=UPROPS_BIDI_SHIFT+5, /* 11 (1 bit) */ UPROPS_NUMERIC_TYPE_SHIFT, /* 12 (3 bits) */ UPROPS_CASE_SENSITIVE_SHIFT=UPROPS_NUMERIC_TYPE_SHIFT+3,/* 15 (1 bit) format version 3.2 */ UPROPS_RESERVED_SHIFT, /* 16 (4 bits) */ UPROPS_VALUE_SHIFT=20, /* 20 */ UPROPS_EXCEPTION_BIT=1UL<>UPROPS_NUMERIC_TYPE_SHIFT)&7) #define GET_UNSIGNED_VALUE(props) ((props)>>UPROPS_VALUE_SHIFT) #define GET_SIGNED_VALUE(props) ((int32_t)(props)>>UPROPS_VALUE_SHIFT) #define GET_EXCEPTIONS(props) (exceptionsTable+GET_UNSIGNED_VALUE(props)) #define CAT_MASK(props) U_MASK(GET_CATEGORY(props)) enum { EXC_UPPERCASE, EXC_LOWERCASE, EXC_TITLECASE, EXC_UNUSED, EXC_NUMERIC_VALUE, EXC_DENOMINATOR_VALUE, EXC_MIRROR_MAPPING, EXC_SPECIAL_CASING, EXC_CASE_FOLDING }; /* number of properties vector words */ #define UPROPS_VECTOR_WORDS 3 /* * Properties in vector word 0 * Bits * 31..24 DerivedAge version major/minor one nibble each * 23 reserved * 22..18 Line Break * 17..15 East Asian Width * 14.. 7 UBlockCode * 6.. 0 UScriptCode */ /* derived age: one nibble each for major and minor version numbers */ #define UPROPS_AGE_MASK 0xff000000 #define UPROPS_AGE_SHIFT 24 #define UPROPS_LB_MASK 0x007C0000 #define UPROPS_LB_SHIFT 18 #define UPROPS_EA_MASK 0x00038000 #define UPROPS_EA_SHIFT 15 #define UPROPS_BLOCK_MASK 0x00007f80 #define UPROPS_BLOCK_SHIFT 7 #define UPROPS_SCRIPT_MASK 0x0000007f /* * Properties in vector word 1 * Each bit encodes one binary property. * The following constants represent the bit number, use 1<