annotate lib/localeconv.c @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16720
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 #include <config.h>
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 /* Specification. */
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 #include <locale.h>
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #if HAVE_STRUCT_LCONV_DECIMAL_POINT
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 /* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_*
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 members. */
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 struct lconv *
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 localeconv (void)
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 {
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 static struct lconv result;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 # undef lconv
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 # undef localeconv
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 struct lconv *sys_result = localeconv ();
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 result.decimal_point = sys_result->decimal_point;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 result.thousands_sep = sys_result->thousands_sep;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 result.grouping = sys_result->grouping;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 result.mon_decimal_point = sys_result->mon_decimal_point;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 result.mon_thousands_sep = sys_result->mon_thousands_sep;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 result.mon_grouping = sys_result->mon_grouping;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 result.positive_sign = sys_result->positive_sign;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 result.negative_sign = sys_result->negative_sign;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 result.currency_symbol = sys_result->currency_symbol;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 result.frac_digits = sys_result->frac_digits;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 result.p_cs_precedes = sys_result->p_cs_precedes;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 result.p_sign_posn = sys_result->p_sign_posn;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 result.p_sep_by_space = sys_result->p_sep_by_space;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 result.n_cs_precedes = sys_result->n_cs_precedes;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 result.n_sign_posn = sys_result->n_sign_posn;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 result.n_sep_by_space = sys_result->n_sep_by_space;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 result.int_curr_symbol = sys_result->int_curr_symbol;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 result.int_frac_digits = sys_result->int_frac_digits;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 result.int_p_cs_precedes = sys_result->p_cs_precedes;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 result.int_p_sign_posn = sys_result->p_sign_posn;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 result.int_p_sep_by_space = sys_result->p_sep_by_space;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 result.int_n_cs_precedes = sys_result->n_cs_precedes;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 result.int_n_sign_posn = sys_result->n_sign_posn;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 result.int_n_sep_by_space = sys_result->n_sep_by_space;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 return &result;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 }
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 #else
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 /* Override for platforms where 'struct lconv' is a dummy. */
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 # include <limits.h>
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 struct lconv *
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 localeconv (void)
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 {
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 static /*const*/ struct lconv result =
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 {
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 /* decimal_point */ ".",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 /* thousands_sep */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 /* grouping */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 /* mon_decimal_point */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 /* mon_thousands_sep */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 /* mon_grouping */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 /* positive_sign */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 /* negative_sign */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 /* currency_symbol */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 /* frac_digits */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 /* p_cs_precedes */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 /* p_sign_posn */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 /* p_sep_by_space */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 /* n_cs_precedes */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 /* n_sign_posn */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 /* n_sep_by_space */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 /* int_curr_symbol */ "",
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 /* int_frac_digits */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 /* int_p_cs_precedes */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 /* int_p_sign_posn */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 /* int_p_sep_by_space */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 /* int_n_cs_precedes */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 /* int_n_sign_posn */ CHAR_MAX,
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 /* int_n_sep_by_space */ CHAR_MAX
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 };
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 return &result;
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 }
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102
7dbecbf765a8 New module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 #endif