xref: /netbsd-src/distrib/utils/libhack/localeconv.c (revision ddb0cef57cb465339c8875e1131d96a5c0d67c65)
1 /*	$NetBSD: localeconv.c,v 1.4 2013/04/18 16:25:55 joerg Exp $	*/
2 
3 /*
4  * Written by J.T. Conklin <jtc@NetBSD.org>.
5  * Public domain.
6  */
7 
8 #define _NETBSD_SOURCE
9 #include <sys/cdefs.h>
10 #include <sys/localedef.h>
11 #include <locale.h>
12 #include <limits.h>
13 
14 /*
15  * The localeconv() function constructs a struct lconv from the current
16  * monetary and numeric locales.
17  */
18 
19 /*
20  * Return the current locale conversion.
21  * Fixed in the "C" locale.
22  */
23 struct lconv *
localeconv(void)24 localeconv(void)
25 {
26     static struct lconv ret = {
27 	/* char	*decimal_point */ ".",
28 	/* char	*thousands_sep */ "",
29 	/* char	*grouping */ "",
30 	/* char	*int_curr_symbol */ "",
31 	/* char	*currency_symbol */ "",
32 	/* char	*mon_decimal_point */ "",
33 	/* char	*mon_thousands_sep */ "",
34 	/* char	*mon_grouping */ "",
35 	/* char	*positive_sign */ "",
36 	/* char	*negative_sign */ "",
37 	/* char	int_frac_digits */ CHAR_MAX,
38 	/* char	frac_digits */ CHAR_MAX,
39 	/* char	p_cs_precedes */ CHAR_MAX,
40 	/* char	p_sep_by_space */ CHAR_MAX,
41 	/* char	n_cs_precedes */ CHAR_MAX,
42 	/* char	n_sep_by_space */ CHAR_MAX,
43 	/* char	p_sign_posn */ CHAR_MAX,
44 	/* char	n_sign_posn */ CHAR_MAX,
45     };
46 
47     return (&ret);
48 }
49 
50 /* ARGSUSED */
51 struct lconv *
localeconv_l(locale_t loc)52 localeconv_l(locale_t loc)
53 {
54 	return localeconv();
55 }
56