Update.
[glibc.git] / locale / localeconv.c
blobc5754fed93f91574ce18364ebf7e8ade6321cd2a
1 /* Copyright (C) 1991, 92, 95, 97, 99, 2000 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library 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 GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #include <locale.h>
20 #include "localeinfo.h"
21 #include <shlib-compat.h>
23 /* Return monetary and numeric information about the current locale. */
24 struct lconv *
25 __localeconv (void)
27 static struct lconv result;
29 result.decimal_point = (char *) _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
30 result.thousands_sep = (char *) _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP);
31 result.grouping = (char *) _NL_CURRENT (LC_NUMERIC, GROUPING);
32 if (*result.grouping == CHAR_MAX || *result.grouping == -1)
33 result.grouping = (char *) "";
35 result.int_curr_symbol = (char *) _NL_CURRENT (LC_MONETARY, INT_CURR_SYMBOL);
36 result.currency_symbol = (char *) _NL_CURRENT (LC_MONETARY, CURRENCY_SYMBOL);
37 result.mon_decimal_point = (char *) _NL_CURRENT (LC_MONETARY,
38 MON_DECIMAL_POINT);
39 result.mon_thousands_sep = (char *) _NL_CURRENT (LC_MONETARY,
40 MON_THOUSANDS_SEP);
41 result.mon_grouping = (char *) _NL_CURRENT (LC_MONETARY, MON_GROUPING);
42 if (*result.mon_grouping == CHAR_MAX || *result.mon_grouping == -1)
43 result.mon_grouping = (char *) "";
44 result.positive_sign = (char *) _NL_CURRENT (LC_MONETARY, POSITIVE_SIGN);
45 result.negative_sign = (char *) _NL_CURRENT (LC_MONETARY, NEGATIVE_SIGN);
46 result.int_frac_digits = *(char *) _NL_CURRENT (LC_MONETARY,
47 INT_FRAC_DIGITS);
48 result.frac_digits = *(char *) _NL_CURRENT (LC_MONETARY, FRAC_DIGITS);
49 result.p_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY, P_CS_PRECEDES);
50 result.p_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY, P_SEP_BY_SPACE);
51 result.n_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY, N_CS_PRECEDES);
52 result.n_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY, N_SEP_BY_SPACE);
53 result.p_sign_posn = *(char *) _NL_CURRENT (LC_MONETARY, P_SIGN_POSN);
54 result.n_sign_posn = *(char *) _NL_CURRENT (LC_MONETARY, N_SIGN_POSN);
55 result.int_p_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY,
56 INT_P_CS_PRECEDES);
57 result.int_p_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY,
58 INT_P_SEP_BY_SPACE);
59 result.int_n_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY,
60 INT_N_CS_PRECEDES);
61 result.int_n_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY,
62 INT_N_SEP_BY_SPACE);
63 result.int_p_sign_posn = *(char *) _NL_CURRENT (LC_MONETARY,
64 INT_P_SIGN_POSN);
65 result.int_n_sign_posn = *(char *) _NL_CURRENT (LC_MONETARY,
66 INT_N_SIGN_POSN);
68 return &result;
71 versioned_symbol (libc, __localeconv, localeconv, GLIBC_2_2);
72 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
73 strong_alias (__localeconv, __localeconv20)
74 compat_symbol (libc, __localeconv20, localeconv, GLIBC_2_0);
75 #endif