Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * <<setlocale>>, <<localeconv>>---select or query locale
27 * char *setlocale(int <[category]>, const char *<[locale]>);
28 * lconv *localeconv(void);
29 * char *_setlocale_r(void *<[reent]>,
30 * int <[category]>, const char *<[locale]>);
31 * lconv *_localeconv_r(void *<[reent]>);
34 * char *setlocale(<[category]>, <[locale]>)
37 * lconv *localeconv();
38 * char *_setlocale_r(<[reent]>, <[category]>, <[locale]>)
42 * lconv *_localeconv_r(<[reent]>);
44 * <<setlocale>> is the facility defined by ANSI C to condition the
45 * execution environment for international collating and formatting
46 * information; <<localeconv>> reports on the settings of the current
48 * This is a minimal implementation, supporting only the required <<``C''>>
49 * value for <[locale]>; strings representing other locales are not
50 * honored. (<<``''>> is also accepted; it represents the default locale
51 * for an implementation, here equivalent to <<``C''>>.)
52 * If you use <<NULL>> as the <[locale]> argument, <<setlocale>> returns
53 * a pointer to the string representing the current locale (always
54 * <<``C''>> in this implementation). The acceptable values for
55 * <[category]> are defined in `<<locale.h>>' as macros beginning with
56 * <<"LC_">>, but this implementation does not check the values you pass
57 * in the <[category]> argument.
58 * <<localeconv>> returns a pointer to a structure (also defined in
59 * `<<locale.h>>') describing the locale-specific conventions currently
61 * <<_localeconv_r>> and <<_setlocale_r>> are reentrant versions of
62 * <<localeconv>> and <<setlocale>> respectively. The extra argument
63 * <[reent]> is a pointer to a reentrancy structure.
65 * <<setlocale>> returns either a pointer to a string naming the locale
66 * currently in effect (always <<``C''>> for this implementation), or, if
67 * the locale request cannot be honored, <<NULL>>.
68 * <<localeconv>> returns a pointer to a structure of type <<lconv>>,
69 * which describes the formatting and collating conventions in effect (in
70 * this implementation, always those of the C locale).
72 * ANSI C requires <<setlocale>>, but the only locale required across all
73 * implementations is the C locale.
74 * No supporting OS subroutines are required.
75 * setlocale, localeconv : internationalize your locale.
76 * (Only "C" or null supported).
88 static const struct lconv lconv =
90 ".", "", "", "", "", "", "", "", "", "",
91 CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX,
92 CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX,
96 The facility defined to condition the execution environment
97 for international collating and formatting information.
98 @return either a pointer to a string naming the locale
99 currently in effect or, if the locale request cannot be honored NULL.
100 @param category Category
103 EXPORT_C char* setlocale (int category, const char *locale)
105 if (locale && strcmp (locale, "C") && strcmp (locale, ""))
111 Reports on the settings of the current locale.
112 @return a pointer to a structure of type lconv,
113 which describes the formatting and collating conventions in effect
115 EXPORT_C struct lconv* localeconv (void)
117 return (struct lconv *) &lconv;