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