Luna/libc/src/locale.cpp

42 lines
1.0 KiB
C++

#include <limits.h>
#include <locale.h>
static char s_default_locale[] = "C";
static char s_empty_string[] = "";
static char s_decimal_point[] = ".";
static struct lconv s_lconv = {
.decimal_point = s_decimal_point,
.thousands_sep = s_empty_string,
.grouping = s_empty_string,
.int_curr_symbol = s_empty_string,
.currency_symbol = s_empty_string,
.mon_decimal_point = s_empty_string,
.mon_thousands_sep = s_empty_string,
.mon_grouping = s_empty_string,
.positive_sign = s_empty_string,
.negative_sign = s_empty_string,
.int_frac_digits = CHAR_MAX,
.frac_digits = CHAR_MAX,
.p_cs_precedes = CHAR_MAX,
.p_sep_by_space = CHAR_MAX,
.n_cs_precedes = CHAR_MAX,
.n_sep_by_space = CHAR_MAX,
.p_sign_posn = CHAR_MAX,
.n_sign_posn = CHAR_MAX,
};
extern "C"
{
char* setlocale(int, const char*)
{
// FIXME: Set the current locale if <locale> is not NULL.
return s_default_locale;
}
struct lconv* localeconv(void)
{
return &s_lconv;
}
}