]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/unicode/uplrule.h
ICU-531.30.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / uplrule.h
CommitLineData
729e4ab9
A
1/*
2******************************************************************************
4388f060 3* Copyright (C) 2010-2011 Apple Inc. All Rights Reserved.
729e4ab9
A
4******************************************************************************
5*/
6
7#ifndef UPLRULE_H
8#define UPLRULE_H
9
10#include "unicode/utypes.h"
11
12#if !UCONFIG_NO_FORMATTING
13
4388f060
A
14#include "unicode/upluralrules.h"
15
16/**
17 * NOTE - THE TEMPORARY APPLE INTERFACES DECLARED HERE ARE OBSOLETE, PLEASE USE
18 * THE REAL ICU EQUIVALENTS IN upluralrules.h
19 */
20
729e4ab9
A
21/**
22 * A UPluralRules object for use in C programs.
4388f060 23 * struct UPluralRules; defined in upluralrules.h
729e4ab9 24 */
729e4ab9
A
25
26/**
27 * Open a new UPluralRules object using the predefined plural rules for a
28 * given locale.
29 * @param locale The locale for which the rules are desired.
30 * @param status A pointer to a UErrorCode to receive any errors.
31 * @return A UPluralRules for the specified locale, or 0 if an error occurred.
4388f060 32 * @internal/obsolete, use uplrules_open in upluralrules.h
729e4ab9
A
33 */
34U_INTERNAL UPluralRules* U_EXPORT2
35uplrule_open(const char *locale,
36 UErrorCode *status);
37
38/**
39 * Close a UPluralRules object. Once closed it may no longer be used.
40 * @param plrules The UPluralRules object to close.
4388f060 41 * @internal/obsolete, use uplrules_close in upluralrules.h
729e4ab9
A
42 */
43U_INTERNAL void U_EXPORT2
44uplrule_close(UPluralRules *plrules);
45
46/**
47 * Given an int32_t number, returns the keyword of the first rule that
48 * applies to the number, according to the supplied UPluralRules object.
49 * @param plrules The UPluralRules object specifying the rules.
50 * @param number The number for which the rule has to be determined.
51 * @param keyword The keyword of the rule that applies to number.
52 * @param capacity The capacity of keyword.
53 * @param status A pointer to a UErrorCode to receive any errors.
54 * @return The length of keyword.
4388f060 55 * @internal/obsolete, use uplrules_select in upluralrules.h
729e4ab9
A
56 */
57U_INTERNAL int32_t U_EXPORT2
58uplrule_select(const UPluralRules *plrules,
59 int32_t number,
60 UChar *keyword, int32_t capacity,
61 UErrorCode *status);
62
63/**
64 * Given a double number, returns the keyword of the first rule that
65 * applies to the number, according to the supplied UPluralRules object.
66 * @param plrules The UPluralRules object specifying the rules.
67 * @param number The number for which the rule has to be determined.
68 * @param keyword The keyword of the rule that applies to number.
69 * @param capacity The capacity of keyword.
70 * @param status A pointer to a UErrorCode to receive any errors.
71 * @return The length of keyword.
4388f060 72 * @internal/obsolete, use uplrules_select in upluralrules.h
729e4ab9
A
73 */
74U_INTERNAL int32_t U_EXPORT2
75uplrule_selectDouble(const UPluralRules *plrules,
76 double number,
77 UChar *keyword, int32_t capacity,
78 UErrorCode *status);
79
80#endif /* #if !UCONFIG_NO_FORMATTING */
81
82#endif