1*4887Schin /***********************************************************************
2*4887Schin *                                                                      *
3*4887Schin *               This software is part of the ast package               *
4*4887Schin *           Copyright (c) 1985-2007 AT&T Knowledge Ventures            *
5*4887Schin *                      and is licensed under the                       *
6*4887Schin *                  Common Public License, Version 1.0                  *
7*4887Schin *                      by AT&T Knowledge Ventures                      *
8*4887Schin *                                                                      *
9*4887Schin *                A copy of the License is available at                 *
10*4887Schin *            http://www.opensource.org/licenses/cpl1.0.txt             *
11*4887Schin *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12*4887Schin *                                                                      *
13*4887Schin *              Information and Software Systems Research               *
14*4887Schin *                            AT&T Research                             *
15*4887Schin *                           Florham Park NJ                            *
16*4887Schin *                                                                      *
17*4887Schin *                 Glenn Fowler <gsf@research.att.com>                  *
18*4887Schin *                  David Korn <dgk@research.att.com>                   *
19*4887Schin *                   Phong Vo <kpv@research.att.com>                    *
20*4887Schin *                                                                      *
21*4887Schin ***********************************************************************/
22*4887Schin #pragma prototyped
23*4887Schin 
24*4887Schin /*
25*4887Schin  * localeconv() intercept
26*4887Schin  */
27*4887Schin 
28*4887Schin #include "lclib.h"
29*4887Schin 
30*4887Schin #undef	localeconv
31*4887Schin 
32*4887Schin static char	null[] = "";
33*4887Schin 
34*4887Schin static struct lconv	debug_lconv =
35*4887Schin {
36*4887Schin 	",",
37*4887Schin 	".",
38*4887Schin 	&null[0],
39*4887Schin 	&null[0],
40*4887Schin 	&null[0],
41*4887Schin 	&null[0],
42*4887Schin 	&null[0],
43*4887Schin 	&null[0],
44*4887Schin 	&null[0],
45*4887Schin 	&null[0],
46*4887Schin 	CHAR_MAX,
47*4887Schin 	CHAR_MAX,
48*4887Schin 	CHAR_MAX,
49*4887Schin 	CHAR_MAX,
50*4887Schin 	CHAR_MAX,
51*4887Schin 	CHAR_MAX,
52*4887Schin 	CHAR_MAX,
53*4887Schin 	CHAR_MAX,
54*4887Schin };
55*4887Schin 
56*4887Schin #if !_lib_localeconv
57*4887Schin 
58*4887Schin static struct lconv	default_lconv =
59*4887Schin {
60*4887Schin 	".",
61*4887Schin 	&null[0],
62*4887Schin 	&null[0],
63*4887Schin 	&null[0],
64*4887Schin 	&null[0],
65*4887Schin 	&null[0],
66*4887Schin 	&null[0],
67*4887Schin 	&null[0],
68*4887Schin 	&null[0],
69*4887Schin 	&null[0],
70*4887Schin 	CHAR_MAX,
71*4887Schin 	CHAR_MAX,
72*4887Schin 	CHAR_MAX,
73*4887Schin 	CHAR_MAX,
74*4887Schin 	CHAR_MAX,
75*4887Schin 	CHAR_MAX,
76*4887Schin 	CHAR_MAX,
77*4887Schin 	CHAR_MAX,
78*4887Schin };
79*4887Schin 
80*4887Schin struct lconv*
81*4887Schin localeconv(void)
82*4887Schin {
83*4887Schin 	return &default_lconv;
84*4887Schin }
85*4887Schin 
86*4887Schin #endif
87*4887Schin 
88*4887Schin /*
89*4887Schin  * localeconv() intercept
90*4887Schin  */
91*4887Schin 
92*4887Schin struct lconv*
93*4887Schin _ast_localeconv(void)
94*4887Schin {
95*4887Schin 	return ((locales[AST_LC_MONETARY]->flags | locales[AST_LC_NUMERIC]->flags) & LC_debug) ? &debug_lconv : localeconv();
96*4887Schin }
97