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