]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/ucol_wgt.h
2 *******************************************************************************
4 * Copyright (C) 1999-2008, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
8 * file name: ucol_wgt.h
10 * tab size: 8 (not used)
13 * created on: 2001mar08
14 * created by: Markus W. Scherer
20 #include "unicode/utypes.h"
22 #if !UCONFIG_NO_COLLATION
24 /* definitions for CE weights */
26 typedef struct WeightRange
{
28 int32_t length
, count
;
34 * Determine heuristically
35 * what ranges to use for a given number of weights between (excluding)
38 * @param lowerLimit A collation element weight; the ranges will be filled to cover
39 * weights greater than this one.
40 * @param upperLimit A collation element weight; the ranges will be filled to cover
41 * weights less than this one.
42 * @param n The number of collation element weights w necessary such that
43 * lowerLimit<w<upperLimit in lexical order.
44 * @param maxByte The highest valid byte value.
45 * @param ranges An array that is filled in with one or more ranges to cover
46 * n weights between the limits.
47 * @return number of ranges, 0 if it is not possible to fit n elements between the limits
50 ucol_allocWeights(uint32_t lowerLimit
, uint32_t upperLimit
,
53 WeightRange ranges
[7]);
56 * Given a set of ranges calculated by ucol_allocWeights(),
57 * iterate through the weights.
58 * The ranges are modified to keep the current iteration state.
60 * @param ranges The array of ranges that ucol_allocWeights() filled in.
61 * The ranges are modified.
62 * @param pRangeCount The number of ranges. It will be decremented when necessary.
63 * @return The next weight in the ranges, or 0xffffffff if there is none left.
66 ucol_nextWeight(WeightRange ranges
[], int32_t *pRangeCount
);
68 #endif /* #if !UCONFIG_NO_COLLATION */