diff -r 000000000000 -r 6474c204b198 intl/icu/source/common/uprops.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/intl/icu/source/common/uprops.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,445 @@ +/* +******************************************************************************* +* +* Copyright (C) 2002-2012, 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.icu. +*/ + +#ifndef __UPROPS_H__ +#define __UPROPS_H__ + +#include "unicode/utypes.h" +#include "unicode/uset.h" +#include "uset_imp.h" +#include "udataswp.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_SCRIPT_EXTENSIONS_INDEX, + + UPROPS_RESERVED_INDEX_7, + UPROPS_RESERVED_INDEX_8, + + /* size of the data file (number of 32-bit units after the header) */ + UPROPS_DATA_TOP_INDEX, + + /* 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) */ + /* reserved 5 (1 bit) */ + UPROPS_NUMERIC_TYPE_VALUE_SHIFT=6 /* 6 (10 bits) */ +}; + +#define GET_CATEGORY(props) ((props)&0x1f) +#define CAT_MASK(props) U_MASK(GET_CATEGORY(props)) + +#define GET_NUMERIC_TYPE_VALUE(props) ((props)>>UPROPS_NUMERIC_TYPE_VALUE_SHIFT) + +/* constants for the storage form of numeric types and values */ +enum { + /** No numeric value. */ + UPROPS_NTV_NONE=0, + /** Decimal digits: nv=0..9 */ + UPROPS_NTV_DECIMAL_START=1, + /** Other digits: nv=0..9 */ + UPROPS_NTV_DIGIT_START=11, + /** Small integers: nv=0..154 */ + UPROPS_NTV_NUMERIC_START=21, + /** Fractions: ((ntv>>4)-12) / ((ntv&0xf)+1) = -1..17 / 1..16 */ + UPROPS_NTV_FRACTION_START=0xb0, + /** + * Large integers: + * ((ntv>>5)-14) * 10^((ntv&0x1f)+2) = (1..9)*(10^2..10^33) + * (only one significant decimal digit) + */ + UPROPS_NTV_LARGE_START=0x1e0, + /** + * Sexagesimal numbers: + * ((ntv>>2)-0xbf) * 60^((ntv&3)+1) = (1..9)*(60^1..60^4) + */ + UPROPS_NTV_BASE60_START=0x300, + /** No numeric value (yet). */ + UPROPS_NTV_RESERVED_START=UPROPS_NTV_BASE60_START+36, /* 0x300+9*4=0x324 */ + + UPROPS_NTV_MAX_SMALL_INT=UPROPS_NTV_FRACTION_START-UPROPS_NTV_NUMERIC_START-1 +}; + +#define UPROPS_NTV_GET_TYPE(ntv) \ + ((ntv==UPROPS_NTV_NONE) ? U_NT_NONE : \ + (ntv