]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
51004dcb A |
3 | /* |
4 | ***************************************************************************************** | |
5 | * Copyright (C) 2010-2013, International Business Machines | |
6 | * Corporation and others. All Rights Reserved. | |
7 | ***************************************************************************************** | |
8 | */ | |
9 | ||
10 | #ifndef UGENDER_H | |
11 | #define UGENDER_H | |
12 | ||
13 | #include "unicode/utypes.h" | |
14 | ||
15 | #if !UCONFIG_NO_FORMATTING | |
51004dcb A |
16 | |
17 | #include "unicode/localpointer.h" | |
18 | ||
19 | /** | |
20 | * \file | |
21 | * \brief C API: The purpose of this API is to compute the gender of a list as a | |
22 | * whole given the gender of each element. | |
23 | * | |
24 | */ | |
25 | ||
26 | /** | |
27 | * Genders | |
57a6839d | 28 | * @stable ICU 50 |
51004dcb A |
29 | */ |
30 | enum UGender { | |
31 | /** | |
32 | * Male gender. | |
57a6839d | 33 | * @stable ICU 50 |
51004dcb A |
34 | */ |
35 | UGENDER_MALE, | |
36 | /** | |
37 | * Female gender. | |
57a6839d | 38 | * @stable ICU 50 |
51004dcb A |
39 | */ |
40 | UGENDER_FEMALE, | |
41 | /** | |
42 | * Neutral gender. | |
57a6839d | 43 | * @stable ICU 50 |
51004dcb A |
44 | */ |
45 | UGENDER_OTHER | |
46 | }; | |
47 | /** | |
57a6839d | 48 | * @stable ICU 50 |
51004dcb A |
49 | */ |
50 | typedef enum UGender UGender; | |
51 | ||
3d1f044b | 52 | struct UGenderInfo; |
51004dcb A |
53 | /** |
54 | * Opaque UGenderInfo object for use in C programs. | |
57a6839d | 55 | * @stable ICU 50 |
51004dcb | 56 | */ |
51004dcb A |
57 | typedef struct UGenderInfo UGenderInfo; |
58 | ||
59 | /** | |
60 | * Opens a new UGenderInfo object given locale. | |
61 | * @param locale The locale for which the rules are desired. | |
57a6839d | 62 | * @param status UErrorCode pointer |
51004dcb | 63 | * @return A UGenderInfo for the specified locale, or NULL if an error occurred. |
57a6839d | 64 | * @stable ICU 50 |
51004dcb | 65 | */ |
57a6839d | 66 | U_STABLE const UGenderInfo* U_EXPORT2 |
51004dcb A |
67 | ugender_getInstance(const char *locale, UErrorCode *status); |
68 | ||
69 | ||
70 | /** | |
71 | * Given a list, returns the gender of the list as a whole. | |
72 | * @param genderInfo pointer that ugender_getInstance returns. | |
73 | * @param genders the gender of each element in the list. | |
74 | * @param size the size of the list. | |
75 | * @param status A pointer to a UErrorCode to receive any errors. | |
76 | * @return The gender of the list. | |
57a6839d | 77 | * @stable ICU 50 |
51004dcb | 78 | */ |
57a6839d | 79 | U_STABLE UGender U_EXPORT2 |
3d1f044b | 80 | ugender_getListGender(const UGenderInfo* genderInfo, const UGender *genders, int32_t size, UErrorCode *status); |
51004dcb | 81 | |
51004dcb A |
82 | #endif /* #if !UCONFIG_NO_FORMATTING */ |
83 | ||
84 | #endif |