intl/icu/source/tools/toolutil/denseranges.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /*
michael@0 2 *******************************************************************************
michael@0 3 * Copyright (C) 2010, International Business Machines
michael@0 4 * Corporation and others. All Rights Reserved.
michael@0 5 *******************************************************************************
michael@0 6 * file name: denseranges.h
michael@0 7 * encoding: US-ASCII
michael@0 8 * tab size: 8 (not used)
michael@0 9 * indentation:4
michael@0 10 *
michael@0 11 * created on: 2010sep25
michael@0 12 * created by: Markus W. Scherer
michael@0 13 *
michael@0 14 * Helper code for finding a small number of dense ranges.
michael@0 15 */
michael@0 16
michael@0 17 #ifndef __DENSERANGES_H__
michael@0 18 #define __DENSERANGES_H__
michael@0 19
michael@0 20 #include "unicode/utypes.h"
michael@0 21
michael@0 22 /**
michael@0 23 * Does it make sense to write 1..capacity ranges?
michael@0 24 * Returns 0 if not, otherwise the number of ranges.
michael@0 25 * @param values Sorted array of signed-integer values.
michael@0 26 * @param length Number of values.
michael@0 27 * @param density Minimum average range density, in 256th. (0x100=100%=perfectly dense.)
michael@0 28 * Should be 0x80..0x100, must be 1..0x100.
michael@0 29 * @param ranges Output ranges array.
michael@0 30 * @param capacity Maximum number of ranges.
michael@0 31 * @return Minimum number of ranges (at most capacity) that have the desired density,
michael@0 32 * or 0 if that density cannot be achieved.
michael@0 33 */
michael@0 34 U_CAPI int32_t U_EXPORT2
michael@0 35 uprv_makeDenseRanges(const int32_t values[], int32_t length,
michael@0 36 int32_t density,
michael@0 37 int32_t ranges[][2], int32_t capacity);
michael@0 38
michael@0 39 #endif // __DENSERANGES_H__

mercurial