2000-05-28 13:40:48 +00:00
|
|
|
/*
|
2014-06-30 09:10:35 +00:00
|
|
|
** locale.c
|
|
|
|
**
|
|
|
|
** Ullrich von Bassewitz, 11.12.1998
|
|
|
|
*/
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <locale.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Data */
|
2000-05-28 13:40:48 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 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 = {
|
2013-05-09 11:56:54 +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 */
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Code */
|
2000-05-28 13:40:48 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct lconv* localeconv (void)
|
|
|
|
{
|
|
|
|
return &lc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-10-02 21:44:56 +00:00
|
|
|
char* __fastcall__ setlocale (int, const char* locale)
|
2000-05-28 13:40:48 +00:00
|
|
|
{
|
|
|
|
if (locale == 0 || (locale [0] == 'C' && locale [1] == '\0') || locale [0] == '\0') {
|
2013-05-09 11:56:54 +00:00
|
|
|
/* No change, or value already set, our locale is the "C" locale */
|
|
|
|
return "C";
|
2000-05-28 13:40:48 +00:00
|
|
|
} else {
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Cannot set this one */
|
|
|
|
return 0;
|
2000-05-28 13:40:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-08-03 10:45:31 +00:00
|
|
|
|