~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/common/uprops.h

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
*******************************************************************************
3
 
*
4
 
*   Copyright (C) 2002, International Business Machines
5
 
*   Corporation and others.  All Rights Reserved.
6
 
*
7
 
*******************************************************************************
8
 
*   file name:  uprops.h
9
 
*   encoding:   US-ASCII
10
 
*   tab size:   8 (not used)
11
 
*   indentation:4
12
 
*
13
 
*   created on: 2002feb24
14
 
*   created by: Markus W. Scherer
15
 
*
16
 
*   Constants for mostly non-core Unicode character properties
17
 
*   stored in uprops.dat.
18
 
*/
19
 
 
20
 
#ifndef __UPROPS_H__
21
 
#define __UPROPS_H__
22
 
 
23
 
/* indexes[] entries */
24
 
enum {
25
 
    UPROPS_PROPS32_INDEX,
26
 
    UPROPS_EXCEPTIONS_INDEX,
27
 
    UPROPS_EXCEPTIONS_TOP_INDEX,
28
 
 
29
 
    UPROPS_ADDITIONAL_TRIE_INDEX,
30
 
    UPROPS_ADDITIONAL_VECTORS_INDEX,
31
 
    UPROPS_ADDITIONAL_VECTORS_COLUMNS_INDEX,
32
 
 
33
 
    UPROPS_RESERVED_INDEX,
34
 
 
35
 
    UPROPS_INDEX_COUNT=16
36
 
};
37
 
 
38
 
/* definitions for the main properties words */
39
 
enum {
40
 
    /* general category shift==0                            0 (5 bits) */
41
 
    UPROPS_EXCEPTION_SHIFT=5,                           /*  5 (1 bit)  */
42
 
    UPROPS_BIDI_SHIFT,                                  /*  6 (5 bits) */
43
 
    UPROPS_MIRROR_SHIFT=UPROPS_BIDI_SHIFT+5,            /* 11 (1 bit)  */
44
 
    UPROPS_NUMERIC_TYPE_SHIFT,                          /* 12 (3 bits) */
45
 
    UPROPS_RESERVED_SHIFT=UPROPS_NUMERIC_TYPE_SHIFT+3,  /* 15 (5 bits) */
46
 
    UPROPS_VALUE_SHIFT=20,                              /* 20 */
47
 
 
48
 
    UPROPS_EXCEPTION_BIT=1UL<<UPROPS_EXCEPTION_SHIFT,
49
 
    UPROPS_VALUE_BITS=32-UPROPS_VALUE_SHIFT,
50
 
 
51
 
    UPROPS_MIN_VALUE=-(1L<<(UPROPS_VALUE_BITS-1)),
52
 
    UPROPS_MAX_VALUE=(1L<<(UPROPS_VALUE_BITS-1))-1,
53
 
    UPROPS_MAX_EXCEPTIONS_COUNT=1L<<UPROPS_VALUE_BITS
54
 
};
55
 
 
56
 
/* number of properties vector words */
57
 
#define UPROPS_VECTOR_WORDS     2
58
 
 
59
 
/*
60
 
 * Properties in vector word 0
61
 
 * Bits
62
 
 * 31..24   DerivedAge version major/minor one nibble each
63
 
 * 23..18   reserved
64
 
 * 17..15   East Asian Width
65
 
 * 14.. 7   UBlockCode
66
 
 *  6.. 0   UScriptCode
67
 
 */
68
 
 
69
 
/* derived age: one nibble each for major and minor version numbers */
70
 
#define UPROPS_AGE_MASK         0xff000000
71
 
#define UPROPS_AGE_SHIFT        24
72
 
 
73
 
#define UPROPS_EA_WIDTH_MASK    0x00038000
74
 
#define UPROPS_EA_WIDTH_SHIFT   15
75
 
 
76
 
#define UPROPS_BLOCK_MASK       0x00007f80
77
 
#define UPROPS_BLOCK_SHIFT      7
78
 
 
79
 
#define UPROPS_SCRIPT_MASK      0x0000007f
80
 
 
81
 
/*
82
 
 * Properties in vector word 1
83
 
 * Each bit encodes one binary property.
84
 
 * The following constants represent the bit number, use 1<<UPROPS_XYZ.
85
 
 * UPROPS_BINARY_1_TOP<=32!
86
 
 *
87
 
 * Keep this list of property enums in sync with
88
 
 * propListNames[] in icu/source/tools/genprops/props2.c!
89
 
 */
90
 
enum {
91
 
    UPROPS_WHITE_SPACE,
92
 
    UPROPS_BIDI_CONTROL,
93
 
    UPROPS_JOIN_CONTROL,
94
 
    UPROPS_DASH,
95
 
    UPROPS_HYPHEN,
96
 
    UPROPS_QUOTATION_MARK,
97
 
    UPROPS_TERMINAL_PUNCTUATION,
98
 
    UPROPS_OTHER_MATH,
99
 
    UPROPS_HEX_DIGIT,
100
 
    UPROPS_ASCII_HEX_DIGIT,
101
 
    UPROPS_OTHER_ALPHABETIC,
102
 
    UPROPS_IDEOGRAPHIC,
103
 
    UPROPS_DIACRITIC,
104
 
    UPROPS_EXTENDER,
105
 
    UPROPS_OTHER_LOWERCASE,
106
 
    UPROPS_OTHER_UPPERCASE,
107
 
    UPROPS_NONCHARACTER_CODE_POINT,
108
 
    UPROPS_OTHER_GRAPHEME_EXTEND,
109
 
    UPROPS_GRAPHEME_LINK,
110
 
    UPROPS_IDS_BINARY_OPERATOR,
111
 
    UPROPS_IDS_TRINARY_OPERATOR,
112
 
    UPROPS_RADICAL,
113
 
    UPROPS_UNIFIED_IDEOGRAPH,
114
 
    UPROPS_OTHER_DEFAULT_IGNORABLE_CODE_POINT,
115
 
    UPROPS_DEPRECATED,
116
 
    UPROPS_SOFT_DOTTED,
117
 
    UPROPS_LOGICAL_ORDER_EXCEPTION,
118
 
 
119
 
    /* derivedPropListNames[] in genprops/props2.c, not easily derivable */
120
 
    UPROPS_XID_START,
121
 
    UPROPS_XID_CONTINUE,
122
 
 
123
 
    UPROPS_BINARY_1_TOP
124
 
};
125
 
 
126
 
/**
127
 
 * Get a properties vector word for a code point.
128
 
 * Implemented in uchar.c for uprops.c.
129
 
 * @return 0 if no data or illegal argument
130
 
 */
131
 
U_CFUNC uint32_t
132
 
u_getUnicodeProperties(UChar32 c, int32_t column);
133
 
 
134
 
/* ### TODO check with PropertyValueAliases.txt and move to uchar.h, @draft ICU 2.x */
135
 
/**
136
 
 * East Asian Widths constants.
137
 
 * Keep in sync with names list in genprops/props2.c.
138
 
 */
139
 
enum UEAWidthCode {
140
 
    U_EA_NEUTRAL,
141
 
    U_EA_AMBIGUOUS,
142
 
    U_EA_HALF_WIDTH,
143
 
    U_EA_FULL_WIDTH,
144
 
    U_EA_NARROW,
145
 
    U_EA_WIDE,
146
 
    U_EA_TOP
147
 
};
148
 
typedef enum UEAWidthCode UEAWidthCode;
149
 
 
150
 
#endif