michael@0: /* michael@0: ******************************************************************************* michael@0: * michael@0: * Copyright (C) 2002-2012, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: * michael@0: ******************************************************************************* michael@0: * file name: uprops.h michael@0: * encoding: US-ASCII michael@0: * tab size: 8 (not used) michael@0: * indentation:4 michael@0: * michael@0: * created on: 2002feb24 michael@0: * created by: Markus W. Scherer michael@0: * michael@0: * Constants for mostly non-core Unicode character properties michael@0: * stored in uprops.icu. michael@0: */ michael@0: michael@0: #ifndef __UPROPS_H__ michael@0: #define __UPROPS_H__ michael@0: michael@0: #include "unicode/utypes.h" michael@0: #include "unicode/uset.h" michael@0: #include "uset_imp.h" michael@0: #include "udataswp.h" michael@0: michael@0: /* indexes[] entries */ michael@0: enum { michael@0: UPROPS_PROPS32_INDEX, michael@0: UPROPS_EXCEPTIONS_INDEX, michael@0: UPROPS_EXCEPTIONS_TOP_INDEX, michael@0: michael@0: UPROPS_ADDITIONAL_TRIE_INDEX, michael@0: UPROPS_ADDITIONAL_VECTORS_INDEX, michael@0: UPROPS_ADDITIONAL_VECTORS_COLUMNS_INDEX, michael@0: michael@0: UPROPS_SCRIPT_EXTENSIONS_INDEX, michael@0: michael@0: UPROPS_RESERVED_INDEX_7, michael@0: UPROPS_RESERVED_INDEX_8, michael@0: michael@0: /* size of the data file (number of 32-bit units after the header) */ michael@0: UPROPS_DATA_TOP_INDEX, michael@0: michael@0: /* maximum values for code values in vector word 0 */ michael@0: UPROPS_MAX_VALUES_INDEX=10, michael@0: /* maximum values for code values in vector word 2 */ michael@0: UPROPS_MAX_VALUES_2_INDEX, michael@0: michael@0: UPROPS_INDEX_COUNT=16 michael@0: }; michael@0: michael@0: /* definitions for the main properties words */ michael@0: enum { michael@0: /* general category shift==0 0 (5 bits) */ michael@0: /* reserved 5 (1 bit) */ michael@0: UPROPS_NUMERIC_TYPE_VALUE_SHIFT=6 /* 6 (10 bits) */ michael@0: }; michael@0: michael@0: #define GET_CATEGORY(props) ((props)&0x1f) michael@0: #define CAT_MASK(props) U_MASK(GET_CATEGORY(props)) michael@0: michael@0: #define GET_NUMERIC_TYPE_VALUE(props) ((props)>>UPROPS_NUMERIC_TYPE_VALUE_SHIFT) michael@0: michael@0: /* constants for the storage form of numeric types and values */ michael@0: enum { michael@0: /** No numeric value. */ michael@0: UPROPS_NTV_NONE=0, michael@0: /** Decimal digits: nv=0..9 */ michael@0: UPROPS_NTV_DECIMAL_START=1, michael@0: /** Other digits: nv=0..9 */ michael@0: UPROPS_NTV_DIGIT_START=11, michael@0: /** Small integers: nv=0..154 */ michael@0: UPROPS_NTV_NUMERIC_START=21, michael@0: /** Fractions: ((ntv>>4)-12) / ((ntv&0xf)+1) = -1..17 / 1..16 */ michael@0: UPROPS_NTV_FRACTION_START=0xb0, michael@0: /** michael@0: * Large integers: michael@0: * ((ntv>>5)-14) * 10^((ntv&0x1f)+2) = (1..9)*(10^2..10^33) michael@0: * (only one significant decimal digit) michael@0: */ michael@0: UPROPS_NTV_LARGE_START=0x1e0, michael@0: /** michael@0: * Sexagesimal numbers: michael@0: * ((ntv>>2)-0xbf) * 60^((ntv&3)+1) = (1..9)*(60^1..60^4) michael@0: */ michael@0: UPROPS_NTV_BASE60_START=0x300, michael@0: /** No numeric value (yet). */ michael@0: UPROPS_NTV_RESERVED_START=UPROPS_NTV_BASE60_START+36, /* 0x300+9*4=0x324 */ michael@0: michael@0: UPROPS_NTV_MAX_SMALL_INT=UPROPS_NTV_FRACTION_START-UPROPS_NTV_NUMERIC_START-1 michael@0: }; michael@0: michael@0: #define UPROPS_NTV_GET_TYPE(ntv) \ michael@0: ((ntv==UPROPS_NTV_NONE) ? U_NT_NONE : \ michael@0: (ntv