locale.in.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. /* A POSIX <locale.h>.
  2. Copyright (C) 2007-2017 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #if __GNUC__ >= 3
  14. @PRAGMA_SYSTEM_HEADER@
  15. #endif
  16. @PRAGMA_COLUMNS@
  17. #ifdef _GL_ALREADY_INCLUDING_LOCALE_H
  18. /* Special invocation conventions to handle Solaris header files
  19. (through Solaris 10) when combined with gettext's libintl.h. */
  20. #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
  21. #else
  22. /* Normal invocation convention. */
  23. #ifndef _@GUARD_PREFIX@_LOCALE_H
  24. #define _GL_ALREADY_INCLUDING_LOCALE_H
  25. /* The include_next requires a split double-inclusion guard. */
  26. #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
  27. #undef _GL_ALREADY_INCLUDING_LOCALE_H
  28. #ifndef _@GUARD_PREFIX@_LOCALE_H
  29. #define _@GUARD_PREFIX@_LOCALE_H
  30. /* NetBSD 5.0 mis-defines NULL. */
  31. #include <stddef.h>
  32. /* Mac OS X 10.5 defines the locale_t type in <xlocale.h>. */
  33. #if @HAVE_XLOCALE_H@
  34. # include <xlocale.h>
  35. #endif
  36. /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
  37. /* The definition of _GL_ARG_NONNULL is copied here. */
  38. /* The definition of _GL_WARN_ON_USE is copied here. */
  39. /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
  40. On systems that don't define it, use the same value as GNU libintl. */
  41. #if !defined LC_MESSAGES
  42. # define LC_MESSAGES 1729
  43. #endif
  44. /* Bionic libc's 'struct lconv' is just a dummy. */
  45. #if @REPLACE_STRUCT_LCONV@
  46. # define lconv rpl_lconv
  47. struct lconv
  48. {
  49. /* All 'char *' are actually 'const char *'. */
  50. /* Members that depend on the LC_NUMERIC category of the locale. See
  51. <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
  52. /* Symbol used as decimal point. */
  53. char *decimal_point;
  54. /* Symbol used to separate groups of digits to the left of the decimal
  55. point. */
  56. char *thousands_sep;
  57. /* Definition of the size of groups of digits to the left of the decimal
  58. point. */
  59. char *grouping;
  60. /* Members that depend on the LC_MONETARY category of the locale. See
  61. <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
  62. /* Symbol used as decimal point. */
  63. char *mon_decimal_point;
  64. /* Symbol used to separate groups of digits to the left of the decimal
  65. point. */
  66. char *mon_thousands_sep;
  67. /* Definition of the size of groups of digits to the left of the decimal
  68. point. */
  69. char *mon_grouping;
  70. /* Sign used to indicate a value >= 0. */
  71. char *positive_sign;
  72. /* Sign used to indicate a value < 0. */
  73. char *negative_sign;
  74. /* For formatting local currency. */
  75. /* Currency symbol (3 characters) followed by separator (1 character). */
  76. char *currency_symbol;
  77. /* Number of digits after the decimal point. */
  78. char frac_digits;
  79. /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
  80. comes after the number. */
  81. char p_cs_precedes;
  82. /* For values >= 0: Position of the sign. */
  83. char p_sign_posn;
  84. /* For values >= 0: Placement of spaces between currency symbol, sign, and
  85. number. */
  86. char p_sep_by_space;
  87. /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
  88. comes after the number. */
  89. char n_cs_precedes;
  90. /* For values < 0: Position of the sign. */
  91. char n_sign_posn;
  92. /* For values < 0: Placement of spaces between currency symbol, sign, and
  93. number. */
  94. char n_sep_by_space;
  95. /* For formatting international currency. */
  96. /* Currency symbol (3 characters) followed by separator (1 character). */
  97. char *int_curr_symbol;
  98. /* Number of digits after the decimal point. */
  99. char int_frac_digits;
  100. /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
  101. comes after the number. */
  102. char int_p_cs_precedes;
  103. /* For values >= 0: Position of the sign. */
  104. char int_p_sign_posn;
  105. /* For values >= 0: Placement of spaces between currency symbol, sign, and
  106. number. */
  107. char int_p_sep_by_space;
  108. /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
  109. comes after the number. */
  110. char int_n_cs_precedes;
  111. /* For values < 0: Position of the sign. */
  112. char int_n_sign_posn;
  113. /* For values < 0: Placement of spaces between currency symbol, sign, and
  114. number. */
  115. char int_n_sep_by_space;
  116. };
  117. #endif
  118. #if @GNULIB_LOCALECONV@
  119. # if @REPLACE_LOCALECONV@
  120. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  121. # undef localeconv
  122. # define localeconv rpl_localeconv
  123. # endif
  124. _GL_FUNCDECL_RPL (localeconv, struct lconv *, (void));
  125. _GL_CXXALIAS_RPL (localeconv, struct lconv *, (void));
  126. # else
  127. _GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
  128. # endif
  129. _GL_CXXALIASWARN (localeconv);
  130. #elif @REPLACE_STRUCT_LCONV@
  131. # undef localeconv
  132. # define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
  133. #elif defined GNULIB_POSIXCHECK
  134. # undef localeconv
  135. # if HAVE_RAW_DECL_LOCALECONV
  136. _GL_WARN_ON_USE (localeconv,
  137. "localeconv returns too few information on some platforms - "
  138. "use gnulib module localeconv for portability");
  139. # endif
  140. #endif
  141. #if @GNULIB_SETLOCALE@
  142. # if @REPLACE_SETLOCALE@
  143. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  144. # undef setlocale
  145. # define setlocale rpl_setlocale
  146. # define GNULIB_defined_setlocale 1
  147. # endif
  148. _GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale));
  149. _GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
  150. # else
  151. _GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
  152. # endif
  153. _GL_CXXALIASWARN (setlocale);
  154. #elif defined GNULIB_POSIXCHECK
  155. # undef setlocale
  156. # if HAVE_RAW_DECL_SETLOCALE
  157. _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
  158. "use gnulib module setlocale for portability");
  159. # endif
  160. #endif
  161. #if @GNULIB_DUPLOCALE@
  162. # if @REPLACE_DUPLOCALE@
  163. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  164. # undef duplocale
  165. # define duplocale rpl_duplocale
  166. # endif
  167. _GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
  168. _GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
  169. # else
  170. # if @HAVE_DUPLOCALE@
  171. _GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
  172. # endif
  173. # endif
  174. # if @HAVE_DUPLOCALE@
  175. _GL_CXXALIASWARN (duplocale);
  176. # endif
  177. #elif defined GNULIB_POSIXCHECK
  178. # undef duplocale
  179. # if HAVE_RAW_DECL_DUPLOCALE
  180. _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
  181. "use gnulib module duplocale for portability");
  182. # endif
  183. #endif
  184. #endif /* _@GUARD_PREFIX@_LOCALE_H */
  185. #endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
  186. #endif /* _@GUARD_PREFIX@_LOCALE_H */