1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/i18n/ucol_wgt.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,70 @@ 1.4 +/* 1.5 +******************************************************************************* 1.6 +* 1.7 +* Copyright (C) 1999-2008, International Business Machines 1.8 +* Corporation and others. All Rights Reserved. 1.9 +* 1.10 +******************************************************************************* 1.11 +* file name: ucol_wgt.h 1.12 +* encoding: US-ASCII 1.13 +* tab size: 8 (not used) 1.14 +* indentation:4 1.15 +* 1.16 +* created on: 2001mar08 1.17 +* created by: Markus W. Scherer 1.18 +*/ 1.19 + 1.20 +#ifndef UCOL_WGT_H 1.21 +#define UCOL_WGT_H 1.22 + 1.23 +#include "unicode/utypes.h" 1.24 + 1.25 +#if !UCONFIG_NO_COLLATION 1.26 + 1.27 +/* definitions for CE weights */ 1.28 + 1.29 +typedef struct WeightRange { 1.30 + uint32_t start, end; 1.31 + int32_t length, count; 1.32 + int32_t length2; 1.33 + uint32_t count2; 1.34 +} WeightRange; 1.35 + 1.36 +/** 1.37 + * Determine heuristically 1.38 + * what ranges to use for a given number of weights between (excluding) 1.39 + * two limits. 1.40 + * 1.41 + * @param lowerLimit A collation element weight; the ranges will be filled to cover 1.42 + * weights greater than this one. 1.43 + * @param upperLimit A collation element weight; the ranges will be filled to cover 1.44 + * weights less than this one. 1.45 + * @param n The number of collation element weights w necessary such that 1.46 + * lowerLimit<w<upperLimit in lexical order. 1.47 + * @param maxByte The highest valid byte value. 1.48 + * @param ranges An array that is filled in with one or more ranges to cover 1.49 + * n weights between the limits. 1.50 + * @return number of ranges, 0 if it is not possible to fit n elements between the limits 1.51 + */ 1.52 +U_CFUNC int32_t 1.53 +ucol_allocWeights(uint32_t lowerLimit, uint32_t upperLimit, 1.54 + uint32_t n, 1.55 + uint32_t maxByte, 1.56 + WeightRange ranges[7]); 1.57 + 1.58 +/** 1.59 + * Given a set of ranges calculated by ucol_allocWeights(), 1.60 + * iterate through the weights. 1.61 + * The ranges are modified to keep the current iteration state. 1.62 + * 1.63 + * @param ranges The array of ranges that ucol_allocWeights() filled in. 1.64 + * The ranges are modified. 1.65 + * @param pRangeCount The number of ranges. It will be decremented when necessary. 1.66 + * @return The next weight in the ranges, or 0xffffffff if there is none left. 1.67 + */ 1.68 +U_CFUNC uint32_t 1.69 +ucol_nextWeight(WeightRange ranges[], int32_t *pRangeCount); 1.70 + 1.71 +#endif /* #if !UCONFIG_NO_COLLATION */ 1.72 + 1.73 +#endif