]> git.saurik.com Git - apple/icu.git/blame - icuSources/tools/toolutil/propsvec.h
ICU-6.2.15.tar.gz
[apple/icu.git] / icuSources / tools / toolutil / propsvec.h
CommitLineData
b75a7d8f
A
1/*
2*******************************************************************************
3*
374ca955 4* Copyright (C) 2002-2004, International Business Machines
b75a7d8f
A
5* Corporation and others. All Rights Reserved.
6*
7*******************************************************************************
8* file name: propsvec.h
9* encoding: US-ASCII
10* tab size: 8 (not used)
11* indentation:4
12*
13* created on: 2002feb22
14* created by: Markus W. Scherer
15*
16* Store additional Unicode character properties in bit set vectors.
17*/
18
19#ifndef __UPROPSVEC_H__
20#define __UPROPSVEC_H__
21
22#include "unicode/utypes.h"
23#include "utrie.h"
24
25/*
26 * Unicode Properties Vectors associated with code point ranges.
27 * Stored in an array of uint32_t.
28 *
29 * The array starts with a header, then rows of integers store
30 * the range limits and the properties vectors.
31 *
32 * In each row, row[0] contains the start code point and
33 * row[1] contains the limit code point,
34 * which is the start of the next range.
35 *
36 * Initially, there is only one range [0..0x110000[ with values 0.
37 *
38 * It would be possible to store only one range boundary per row,
39 * but self-contained rows allow to later sort them by contents.
40 */
41enum {
374ca955 42 /* stores number of columns, plus two for start & limit values */
b75a7d8f
A
43 UPVEC_COLUMNS,
44 UPVEC_MAXROWS,
45 UPVEC_ROWS,
374ca955
A
46 /* search optimization: remember last row seen */
47 UPVEC_PREV_ROW,
b75a7d8f
A
48 UPVEC_HEADER_LENGTH
49};
50
374ca955 51U_CAPI uint32_t * U_EXPORT2
b75a7d8f
A
52upvec_open(int32_t columns, int32_t maxRows);
53
374ca955 54U_CAPI void U_EXPORT2
b75a7d8f
A
55upvec_close(uint32_t *pv);
56
374ca955 57U_CAPI UBool U_EXPORT2
b75a7d8f 58upvec_setValue(uint32_t *pv,
374ca955 59 UChar32 start, UChar32 limit,
b75a7d8f
A
60 int32_t column,
61 uint32_t value, uint32_t mask,
62 UErrorCode *pErrorCode);
63
374ca955
A
64U_CAPI uint32_t U_EXPORT2
65upvec_getValue(uint32_t *pv, UChar32 c, int32_t column);
66
67/*
68 * pRangeStart and pRangeLimit can be NULL.
69 * @return NULL if rowIndex out of range and for illegal arguments
70 */
71U_CAPI uint32_t * U_EXPORT2
b75a7d8f 72upvec_getRow(uint32_t *pv, int32_t rowIndex,
374ca955 73 UChar32 *pRangeStart, UChar32 *pRangeLimit);
b75a7d8f 74
374ca955 75U_CAPI int32_t U_EXPORT2
b75a7d8f
A
76upvec_toTrie(uint32_t *pv, UNewTrie *trie, UErrorCode *pErrorCode);
77
78#endif