• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
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
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
28  * @stable ICU 50
29  */
30 enum UGender {
31     /**
32      * Male gender.
33      * @stable ICU 50
34      */
35     UGENDER_MALE,
36     /**
37      * Female gender.
38      * @stable ICU 50
39      */
40     UGENDER_FEMALE,
41     /**
42      * Neutral gender.
43      * @stable ICU 50
44      */
45     UGENDER_OTHER
46 };
47 /**
48  * @stable ICU 50
49  */
50 typedef enum UGender UGender;
51 
52 struct UGenderInfo;
53 /**
54  * Opaque UGenderInfo object for use in C programs.
55  * @stable ICU 50
56  */
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.
62  * @param status UErrorCode pointer
63  * @return A UGenderInfo for the specified locale, or NULL if an error occurred.
64  * @stable ICU 50
65  */
66 U_STABLE const UGenderInfo* U_EXPORT2
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.
77  * @stable ICU 50
78  */
79 U_STABLE UGender U_EXPORT2
80 ugender_getListGender(const UGenderInfo* genderInfo, const UGender *genders, int32_t size, UErrorCode *status);
81 
82 #endif /* #if !UCONFIG_NO_FORMATTING */
83 
84 #endif
85