Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/localeconv.c @ 17298:d536543d59a6
statat: new module, split out from fstatat
GNU Emacs needs the POSIX-specified fstatat, but not the
gnulib-specified statat and lstat. Split the latter two into a
new module 'statat'.
* lib/openat.h: Depend on GNULIB_STATAT, not GNULIB_FSTATAT.
* lib/openat.h, lib/statat.c (STATAT_INLINE):
Rename from FSTATAT_INLINE. All uses changed.
* modules/fstatat (Files): Remove lib/statat.c.
(gl_MODULE_INDICATOR([fstatat])): Remove.
(lib_SOURCES): Remove.
(Maintainer): Add self.
* modules/statat, modules/statat-tests, tests/test-statat.c: New files.
* tests/test-fstatat.c (BASE): Don't define if already defined.
(do_stat, do_lstat) [!TEST_STATAT]: Test fstatat instead.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 23 Jan 2013 18:20:09 -0800 |
parents | e542fd46ad6f |
children |
rev | line source |
---|---|
16720 | 1 /* Query locale dependent information for formatting numbers. |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16720
diff
changeset
|
2 Copyright (C) 2012-2013 Free Software Foundation, Inc. |
16720 | 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 #include <config.h> | |
18 | |
19 /* Specification. */ | |
20 #include <locale.h> | |
21 | |
22 #if HAVE_STRUCT_LCONV_DECIMAL_POINT | |
23 | |
24 /* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_* | |
25 members. */ | |
26 | |
27 struct lconv * | |
28 localeconv (void) | |
29 { | |
30 static struct lconv result; | |
31 # undef lconv | |
32 # undef localeconv | |
33 struct lconv *sys_result = localeconv (); | |
34 | |
35 result.decimal_point = sys_result->decimal_point; | |
36 result.thousands_sep = sys_result->thousands_sep; | |
37 result.grouping = sys_result->grouping; | |
38 result.mon_decimal_point = sys_result->mon_decimal_point; | |
39 result.mon_thousands_sep = sys_result->mon_thousands_sep; | |
40 result.mon_grouping = sys_result->mon_grouping; | |
41 result.positive_sign = sys_result->positive_sign; | |
42 result.negative_sign = sys_result->negative_sign; | |
43 result.currency_symbol = sys_result->currency_symbol; | |
44 result.frac_digits = sys_result->frac_digits; | |
45 result.p_cs_precedes = sys_result->p_cs_precedes; | |
46 result.p_sign_posn = sys_result->p_sign_posn; | |
47 result.p_sep_by_space = sys_result->p_sep_by_space; | |
48 result.n_cs_precedes = sys_result->n_cs_precedes; | |
49 result.n_sign_posn = sys_result->n_sign_posn; | |
50 result.n_sep_by_space = sys_result->n_sep_by_space; | |
51 result.int_curr_symbol = sys_result->int_curr_symbol; | |
52 result.int_frac_digits = sys_result->int_frac_digits; | |
53 result.int_p_cs_precedes = sys_result->p_cs_precedes; | |
54 result.int_p_sign_posn = sys_result->p_sign_posn; | |
55 result.int_p_sep_by_space = sys_result->p_sep_by_space; | |
56 result.int_n_cs_precedes = sys_result->n_cs_precedes; | |
57 result.int_n_sign_posn = sys_result->n_sign_posn; | |
58 result.int_n_sep_by_space = sys_result->n_sep_by_space; | |
59 | |
60 return &result; | |
61 } | |
62 | |
63 #else | |
64 | |
65 /* Override for platforms where 'struct lconv' is a dummy. */ | |
66 | |
67 # include <limits.h> | |
68 | |
69 struct lconv * | |
70 localeconv (void) | |
71 { | |
72 static /*const*/ struct lconv result = | |
73 { | |
74 /* decimal_point */ ".", | |
75 /* thousands_sep */ "", | |
76 /* grouping */ "", | |
77 /* mon_decimal_point */ "", | |
78 /* mon_thousands_sep */ "", | |
79 /* mon_grouping */ "", | |
80 /* positive_sign */ "", | |
81 /* negative_sign */ "", | |
82 /* currency_symbol */ "", | |
83 /* frac_digits */ CHAR_MAX, | |
84 /* p_cs_precedes */ CHAR_MAX, | |
85 /* p_sign_posn */ CHAR_MAX, | |
86 /* p_sep_by_space */ CHAR_MAX, | |
87 /* n_cs_precedes */ CHAR_MAX, | |
88 /* n_sign_posn */ CHAR_MAX, | |
89 /* n_sep_by_space */ CHAR_MAX, | |
90 /* int_curr_symbol */ "", | |
91 /* int_frac_digits */ CHAR_MAX, | |
92 /* int_p_cs_precedes */ CHAR_MAX, | |
93 /* int_p_sign_posn */ CHAR_MAX, | |
94 /* int_p_sep_by_space */ CHAR_MAX, | |
95 /* int_n_cs_precedes */ CHAR_MAX, | |
96 /* int_n_sign_posn */ CHAR_MAX, | |
97 /* int_n_sep_by_space */ CHAR_MAX | |
98 }; | |
99 | |
100 return &result; | |
101 } | |
102 | |
103 #endif |