2000-05-28 13:40:48 +00:00
|
|
|
/*
|
|
|
|
* locale.c
|
|
|
|
*
|
|
|
|
* Ullrich von Bassewitz, 11.12.1998
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <locale.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Data */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* For memory efficiency use a separate empty string */
|
2000-08-14 22:16:40 +00:00
|
|
|
static char EmptyString [] = "";
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2000-08-14 22:16:40 +00:00
|
|
|
static struct lconv lc = {
|
2000-05-28 13:40:48 +00:00
|
|
|
EmptyString, /* currency_symbol */
|
|
|
|
".", /* decimal_point */
|
|
|
|
EmptyString, /* grouping */
|
|
|
|
EmptyString, /* int_curr_symbol */
|
|
|
|
EmptyString, /* mon_decimal_point */
|
|
|
|
EmptyString, /* mon_grouping */
|
|
|
|
EmptyString, /* mon_thousands_sep */
|
|
|
|
EmptyString, /* negative_sign */
|
|
|
|
EmptyString, /* positive_sign */
|
|
|
|
EmptyString, /* thousands_sep */
|
|
|
|
CHAR_MAX, /* frac_digits */
|
|
|
|
CHAR_MAX, /* int_frac_digits */
|
|
|
|
CHAR_MAX, /* n_cs_precedes */
|
|
|
|
CHAR_MAX, /* n_sep_by_space */
|
|
|
|
CHAR_MAX, /* n_sign_posn */
|
|
|
|
CHAR_MAX, /* p_cs_precedes */
|
|
|
|
CHAR_MAX, /* p_sep_by_space */
|
|
|
|
CHAR_MAX, /* p_sign_posn */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Code */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct lconv* localeconv (void)
|
|
|
|
{
|
|
|
|
return &lc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char* setlocale (int, const char* locale)
|
|
|
|
{
|
|
|
|
if (locale == 0 || (locale [0] == 'C' && locale [1] == '\0') || locale [0] == '\0') {
|
|
|
|
/* No change, or value already set, our locale is the "C" locale */
|
|
|
|
return "C";
|
|
|
|
} else {
|
|
|
|
/* Cannot set this one */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-08-03 10:45:31 +00:00
|
|
|
|