1/* A POSIX <locale.h>.
2   Copyright (C) 2007-2014 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#if __GNUC__ >= 3
18@PRAGMA_SYSTEM_HEADER@
19#endif
20@PRAGMA_COLUMNS@
21
22#ifdef _GL_ALREADY_INCLUDING_LOCALE_H
23
24/* Special invocation conventions to handle Solaris header files
25   (through Solaris 10) when combined with gettext's libintl.h.  */
26
27#@INCLUDE_NEXT@ @NEXT_LOCALE_H@
28
29#else
30/* Normal invocation convention.  */
31
32#ifndef _@GUARD_PREFIX@_LOCALE_H
33
34#define _GL_ALREADY_INCLUDING_LOCALE_H
35
36/* The include_next requires a split double-inclusion guard.  */
37#@INCLUDE_NEXT@ @NEXT_LOCALE_H@
38
39#undef _GL_ALREADY_INCLUDING_LOCALE_H
40
41#ifndef _@GUARD_PREFIX@_LOCALE_H
42#define _@GUARD_PREFIX@_LOCALE_H
43
44/* NetBSD 5.0 mis-defines NULL.  */
45#include <stddef.h>
46
47/* Mac OS X 10.5 defines the locale_t type in <xlocale.h>.  */
48#if @HAVE_XLOCALE_H@
49# include <xlocale.h>
50#endif
51
52/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
53
54/* The definition of _GL_ARG_NONNULL is copied here.  */
55
56/* The definition of _GL_WARN_ON_USE is copied here.  */
57
58/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
59   On systems that don't define it, use the same value as GNU libintl.  */
60#if !defined LC_MESSAGES
61# define LC_MESSAGES 1729
62#endif
63
64/* Bionic libc's 'struct lconv' is just a dummy.  */
65#if @REPLACE_STRUCT_LCONV@
66# define lconv rpl_lconv
67struct lconv
68{
69  /* All 'char *' are actually 'const char *'.  */
70
71  /* Members that depend on the LC_NUMERIC category of the locale.  See
72     <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
73
74  /* Symbol used as decimal point.  */
75  char *decimal_point;
76  /* Symbol used to separate groups of digits to the left of the decimal
77     point.  */
78  char *thousands_sep;
79  /* Definition of the size of groups of digits to the left of the decimal
80     point.  */
81  char *grouping;
82
83  /* Members that depend on the LC_MONETARY category of the locale.  See
84     <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
85
86  /* Symbol used as decimal point.  */
87  char *mon_decimal_point;
88  /* Symbol used to separate groups of digits to the left of the decimal
89     point.  */
90  char *mon_thousands_sep;
91  /* Definition of the size of groups of digits to the left of the decimal
92     point.  */
93  char *mon_grouping;
94  /* Sign used to indicate a value >= 0.  */
95  char *positive_sign;
96  /* Sign used to indicate a value < 0.  */
97  char *negative_sign;
98
99  /* For formatting local currency.  */
100  /* Currency symbol (3 characters) followed by separator (1 character).  */
101  char *currency_symbol;
102  /* Number of digits after the decimal point.  */
103  char frac_digits;
104  /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
105     comes after the number.  */
106  char p_cs_precedes;
107  /* For values >= 0: Position of the sign.  */
108  char p_sign_posn;
109  /* For values >= 0: Placement of spaces between currency symbol, sign, and
110     number.  */
111  char p_sep_by_space;
112  /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
113     comes after the number.  */
114  char n_cs_precedes;
115  /* For values < 0: Position of the sign.  */
116  char n_sign_posn;
117  /* For values < 0: Placement of spaces between currency symbol, sign, and
118     number.  */
119  char n_sep_by_space;
120
121  /* For formatting international currency.  */
122  /* Currency symbol (3 characters) followed by separator (1 character).  */
123  char *int_curr_symbol;
124  /* Number of digits after the decimal point.  */
125  char int_frac_digits;
126  /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
127     comes after the number.  */
128  char int_p_cs_precedes;
129  /* For values >= 0: Position of the sign.  */
130  char int_p_sign_posn;
131  /* For values >= 0: Placement of spaces between currency symbol, sign, and
132     number.  */
133  char int_p_sep_by_space;
134  /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
135     comes after the number.  */
136  char int_n_cs_precedes;
137  /* For values < 0: Position of the sign.  */
138  char int_n_sign_posn;
139  /* For values < 0: Placement of spaces between currency symbol, sign, and
140     number.  */
141  char int_n_sep_by_space;
142};
143#endif
144
145#if @GNULIB_LOCALECONV@
146# if @REPLACE_LOCALECONV@
147#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
148#   undef localeconv
149#   define localeconv rpl_localeconv
150#  endif
151_GL_FUNCDECL_RPL (localeconv, struct lconv *, (void));
152_GL_CXXALIAS_RPL (localeconv, struct lconv *, (void));
153# else
154_GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
155# endif
156_GL_CXXALIASWARN (localeconv);
157#elif @REPLACE_STRUCT_LCONV@
158# undef localeconv
159# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
160#elif defined GNULIB_POSIXCHECK
161# undef localeconv
162# if HAVE_RAW_DECL_LOCALECONV
163_GL_WARN_ON_USE (localeconv,
164                 "localeconv returns too few information on some platforms - "
165                 "use gnulib module localeconv for portability");
166# endif
167#endif
168
169#if @GNULIB_SETLOCALE@
170# if @REPLACE_SETLOCALE@
171#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
172#   undef setlocale
173#   define setlocale rpl_setlocale
174#   define GNULIB_defined_setlocale 1
175#  endif
176_GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale));
177_GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
178# else
179_GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
180# endif
181_GL_CXXALIASWARN (setlocale);
182#elif defined GNULIB_POSIXCHECK
183# undef setlocale
184# if HAVE_RAW_DECL_SETLOCALE
185_GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
186                 "use gnulib module setlocale for portability");
187# endif
188#endif
189
190#if @GNULIB_DUPLOCALE@
191# if @REPLACE_DUPLOCALE@
192#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
193#   undef duplocale
194#   define duplocale rpl_duplocale
195#  endif
196_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
197_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
198# else
199#  if @HAVE_DUPLOCALE@
200_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
201#  endif
202# endif
203# if @HAVE_DUPLOCALE@
204_GL_CXXALIASWARN (duplocale);
205# endif
206#elif defined GNULIB_POSIXCHECK
207# undef duplocale
208# if HAVE_RAW_DECL_DUPLOCALE
209_GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
210                 "use gnulib module duplocale for portability");
211# endif
212#endif
213
214#endif /* _@GUARD_PREFIX@_LOCALE_H */
215#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
216#endif /* _@GUARD_PREFIX@_LOCALE_H */
217