c7aa1a8208dae6013de1d1d4a33e270f29c66117
[debian/tar] / gnu / localeconv.c
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Query locale dependent information for formatting numbers.
4    Copyright (C) 2012-2013 Free Software Foundation, Inc.
5
6    This program is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18
19 #include <config.h>
20
21 /* Specification.  */
22 #include <locale.h>
23
24 #if HAVE_STRUCT_LCONV_DECIMAL_POINT
25
26 /* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_*
27    members.  */
28
29 struct lconv *
30 localeconv (void)
31 {
32   static struct lconv result;
33 # undef lconv
34 # undef localeconv
35   struct lconv *sys_result = localeconv ();
36
37   result.decimal_point = sys_result->decimal_point;
38   result.thousands_sep = sys_result->thousands_sep;
39   result.grouping = sys_result->grouping;
40   result.mon_decimal_point = sys_result->mon_decimal_point;
41   result.mon_thousands_sep = sys_result->mon_thousands_sep;
42   result.mon_grouping = sys_result->mon_grouping;
43   result.positive_sign = sys_result->positive_sign;
44   result.negative_sign = sys_result->negative_sign;
45   result.currency_symbol = sys_result->currency_symbol;
46   result.frac_digits = sys_result->frac_digits;
47   result.p_cs_precedes = sys_result->p_cs_precedes;
48   result.p_sign_posn = sys_result->p_sign_posn;
49   result.p_sep_by_space = sys_result->p_sep_by_space;
50   result.n_cs_precedes = sys_result->n_cs_precedes;
51   result.n_sign_posn = sys_result->n_sign_posn;
52   result.n_sep_by_space = sys_result->n_sep_by_space;
53   result.int_curr_symbol = sys_result->int_curr_symbol;
54   result.int_frac_digits = sys_result->int_frac_digits;
55   result.int_p_cs_precedes = sys_result->p_cs_precedes;
56   result.int_p_sign_posn = sys_result->p_sign_posn;
57   result.int_p_sep_by_space = sys_result->p_sep_by_space;
58   result.int_n_cs_precedes = sys_result->n_cs_precedes;
59   result.int_n_sign_posn = sys_result->n_sign_posn;
60   result.int_n_sep_by_space = sys_result->n_sep_by_space;
61
62   return &result;
63 }
64
65 #else
66
67 /* Override for platforms where 'struct lconv' is a dummy.  */
68
69 # include <limits.h>
70
71 struct lconv *
72 localeconv (void)
73 {
74   static /*const*/ struct lconv result =
75     {
76       /* decimal_point */ ".",
77       /* thousands_sep */ "",
78       /* grouping */ "",
79       /* mon_decimal_point */ "",
80       /* mon_thousands_sep */ "",
81       /* mon_grouping */ "",
82       /* positive_sign */ "",
83       /* negative_sign */ "",
84       /* currency_symbol */ "",
85       /* frac_digits */ CHAR_MAX,
86       /* p_cs_precedes */ CHAR_MAX,
87       /* p_sign_posn */ CHAR_MAX,
88       /* p_sep_by_space */ CHAR_MAX,
89       /* n_cs_precedes */ CHAR_MAX,
90       /* n_sign_posn */ CHAR_MAX,
91       /* n_sep_by_space */ CHAR_MAX,
92       /* int_curr_symbol */ "",
93       /* int_frac_digits */ CHAR_MAX,
94       /* int_p_cs_precedes */ CHAR_MAX,
95       /* int_p_sign_posn */ CHAR_MAX,
96       /* int_p_sep_by_space */ CHAR_MAX,
97       /* int_n_cs_precedes */ CHAR_MAX,
98       /* int_n_sign_posn */ CHAR_MAX,
99       /* int_n_sep_by_space */ CHAR_MAX
100     };
101
102   return &result;
103 }
104
105 #endif