]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/ucol_wgt.h
2 *******************************************************************************
4 * Copyright (C) 1999-2001, 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
26 /* definitions for CE weights */
28 typedef struct WeightRange
{
30 int32_t length
, count
;
36 * Determine heuristically
37 * what ranges to use for a given number of weights between (excluding)
40 * @param lowerLimit A collation element weight; the ranges will be filled to cover
41 * weights greater than this one.
42 * @param upperLimit A collation element weight; the ranges will be filled to cover
43 * weights less than this one.
44 * @param n The number of collation element weights w necessary such that
45 * lowerLimit<w<upperLimit in lexical order.
46 * @param maxByte The highest valid byte value.
47 * @param ranges An array that is filled in with one or more ranges to cover
48 * n weights between the limits.
49 * @return number of ranges, 0 if it is not possible to fit n elements between the limits
52 ucol_allocWeights(uint32_t lowerLimit
, uint32_t upperLimit
,
55 WeightRange ranges
[7]);
58 * Given a set of ranges calculated by ucol_allocWeights(),
59 * iterate through the weights.
60 * The ranges are modified to keep the current iteration state.
62 * @param ranges The array of ranges that ucol_allocWeights() filled in.
63 * The ranges are modified.
64 * @param pRangeCount The number of ranges. It will be decremented when necessary.
65 * @return The next weight in the ranges, or 0xffffffff if there is none left.
68 ucol_nextWeight(WeightRange ranges
[], int32_t *pRangeCount
);
70 #endif /* #if !UCONFIG_NO_COLLATION */