ugender.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // Copyright (C) 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. #ifndef UGENDER_H
  10. #define UGENDER_H
  11. #include "unicode/utypes.h"
  12. #if !UCONFIG_NO_FORMATTING
  13. #include "unicode/localpointer.h"
  14. /**
  15. * \file
  16. * \brief C API: The purpose of this API is to compute the gender of a list as a
  17. * whole given the gender of each element.
  18. *
  19. */
  20. /**
  21. * Genders
  22. * @stable ICU 50
  23. */
  24. enum UGender {
  25. /**
  26. * Male gender.
  27. * @stable ICU 50
  28. */
  29. UGENDER_MALE,
  30. /**
  31. * Female gender.
  32. * @stable ICU 50
  33. */
  34. UGENDER_FEMALE,
  35. /**
  36. * Neutral gender.
  37. * @stable ICU 50
  38. */
  39. UGENDER_OTHER
  40. };
  41. /**
  42. * @stable ICU 50
  43. */
  44. typedef enum UGender UGender;
  45. /**
  46. * Opaque UGenderInfo object for use in C programs.
  47. * @stable ICU 50
  48. */
  49. struct UGenderInfo;
  50. typedef struct UGenderInfo UGenderInfo;
  51. /**
  52. * Opens a new UGenderInfo object given locale.
  53. * @param locale The locale for which the rules are desired.
  54. * @param status UErrorCode pointer
  55. * @return A UGenderInfo for the specified locale, or NULL if an error occurred.
  56. * @stable ICU 50
  57. */
  58. U_STABLE const UGenderInfo* U_EXPORT2
  59. ugender_getInstance(const char *locale, UErrorCode *status);
  60. /**
  61. * Given a list, returns the gender of the list as a whole.
  62. * @param genderInfo pointer that ugender_getInstance returns.
  63. * @param genders the gender of each element in the list.
  64. * @param size the size of the list.
  65. * @param status A pointer to a UErrorCode to receive any errors.
  66. * @return The gender of the list.
  67. * @stable ICU 50
  68. */
  69. U_STABLE UGender U_EXPORT2
  70. ugender_getListGender(const UGenderInfo* genderinfo, const UGender *genders, int32_t size, UErrorCode *status);
  71. #endif /* #if !UCONFIG_NO_FORMATTING */
  72. #endif