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