]> git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/unicode/uplrule.h
ICU-511.35.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / uplrule.h
1 /*
2 ******************************************************************************
3 * Copyright (C) 2010-2011 Apple Inc. All Rights Reserved.
4 ******************************************************************************
5 */
6
7 #ifndef UPLRULE_H
8 #define UPLRULE_H
9
10 #include "unicode/utypes.h"
11
12 #if !UCONFIG_NO_FORMATTING
13
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
21 /**
22 * A UPluralRules object for use in C programs.
23 * struct UPluralRules; defined in upluralrules.h
24 */
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.
32 * @internal/obsolete, use uplrules_open in upluralrules.h
33 */
34 U_INTERNAL UPluralRules* U_EXPORT2
35 uplrule_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.
41 * @internal/obsolete, use uplrules_close in upluralrules.h
42 */
43 U_INTERNAL void U_EXPORT2
44 uplrule_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.
55 * @internal/obsolete, use uplrules_select in upluralrules.h
56 */
57 U_INTERNAL int32_t U_EXPORT2
58 uplrule_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.
72 * @internal/obsolete, use uplrules_select in upluralrules.h
73 */
74 U_INTERNAL int32_t U_EXPORT2
75 uplrule_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