1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-08 13:04:52 +00:00
cc65/libsrc/common/locale.c
cuz dcc0fe91a2 Several type qualifier fixes
git-svn-id: svn://svn.cc65.org/cc65/trunk@283 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-14 22:16:40 +00:00

73 lines
1.6 KiB
C

/*
* locale.c
*
* Ullrich von Bassewitz, 11.12.1998
*/
#include <locale.h>
#include <limits.h>
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* For memory efficiency use a separate empty string */
static char EmptyString [] = "";
static struct lconv lc = {
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;
}
}