ladybird/Userland/Libraries/LibC/locale.cpp

60 lines
1.2 KiB
C++
Raw Normal View History

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <assert.h>
2019-06-07 11:49:03 +02:00
#include <locale.h>
#include <stdio.h>
#include <string.h>
extern "C" {
2019-06-22 14:32:59 +02:00
static char default_decimal_point[] = ".";
static char default_thousands_sep[] = ",";
static char default_grouping[] = "\x03\x03";
static char default_empty_string[] = "";
static char default_empty_value = 127;
static struct lconv default_locale = {
2019-06-22 14:32:59 +02:00
default_decimal_point,
default_thousands_sep,
default_grouping,
default_empty_string,
default_empty_string,
default_empty_string,
default_empty_string,
default_empty_string,
default_empty_string,
default_empty_string,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value,
default_empty_value
};
2021-02-11 23:31:21 +01:00
char* setlocale(int, const char*)
{
static char locale[2];
memcpy(locale, "C", 2);
return locale;
}
struct lconv* localeconv()
{
return &default_locale;
}
}