]> git.ipfire.org Git - thirdparty/glibc.git/blame - locale/localeconv.c
update from main archive 970214
[thirdparty/glibc.git] / locale / localeconv.c
CommitLineData
933e73fa 1/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
28f540f4
RM
2This file is part of the GNU C Library.
3
4The GNU C Library is free software; you can redistribute it and/or
5modify it under the terms of the GNU Library General Public License as
6published by the Free Software Foundation; either version 2 of the
7License, or (at your option) any later version.
8
9The GNU C Library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12Library General Public License for more details.
13
14You should have received a copy of the GNU Library General Public
15License along with the GNU C Library; see the file COPYING.LIB. If
16not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17Cambridge, MA 02139, USA. */
18
28f540f4 19#include <locale.h>
933e73fa 20#include "localeinfo.h"
28f540f4
RM
21
22/* Return monetary and numeric information about the current locale. */
23struct lconv *
933e73fa 24localeconv __P ((void))
28f540f4
RM
25{
26 static struct lconv result;
27
933e73fa
RM
28 result.decimal_point = (char *) _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
29 result.thousands_sep = (char *) _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP);
30 result.grouping = (char *) _NL_CURRENT (LC_NUMERIC, GROUPING);
31
32 result.int_curr_symbol = (char *) _NL_CURRENT (LC_MONETARY, INT_CURR_SYMBOL);
33 result.currency_symbol = (char *) _NL_CURRENT (LC_MONETARY, CURRENCY_SYMBOL);
34 result.mon_decimal_point = (char *) _NL_CURRENT (LC_MONETARY,
35 MON_DECIMAL_POINT);
36 result.mon_thousands_sep = (char *) _NL_CURRENT (LC_MONETARY,
37 MON_THOUSANDS_SEP);
38 result.mon_grouping = (char *) _NL_CURRENT (LC_MONETARY, MON_GROUPING);
39 result.positive_sign = (char *) _NL_CURRENT (LC_MONETARY, POSITIVE_SIGN);
40 result.negative_sign = (char *) _NL_CURRENT (LC_MONETARY, NEGATIVE_SIGN);
41 result.int_frac_digits = *(char *) _NL_CURRENT (LC_MONETARY,
42 INT_FRAC_DIGITS);
43 result.frac_digits = *(char *) _NL_CURRENT (LC_MONETARY, FRAC_DIGITS);
44 result.p_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY, P_CS_PRECEDES);
45 result.p_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY, P_SEP_BY_SPACE);
46 result.n_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY, P_CS_PRECEDES);
47 result.n_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY, N_SEP_BY_SPACE);
48 result.p_sign_posn = *(char *) _NL_CURRENT (LC_MONETARY, P_SIGN_POSN);
49 result.n_sign_posn = *(char *) _NL_CURRENT (LC_MONETARY, N_SIGN_POSN);
28f540f4
RM
50
51 return &result;
52}