2020-01-18 05:38:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2019-02-07 23:38:21 -02:00
|
|
|
#include <assert.h>
|
2019-06-07 06:49:03 -03:00
|
|
|
#include <locale.h>
|
2019-02-07 23:38:21 -02:00
|
|
|
#include <stdio.h>
|
2021-06-04 18:19:56 -03:00
|
|
|
#include <string.h>
|
2019-02-07 23:38:21 -02:00
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
2019-06-22 09:32:59 -03:00
|
|
|
static char default_decimal_point[] = ".";
|
|
|
|
|
static char default_thousands_sep[] = ",";
|
|
|
|
|
static char default_grouping[] = "\x03\x03";
|
|
|
|
|
|
2019-11-16 05:26:18 -03:00
|
|
|
static char default_empty_string[] = "";
|
|
|
|
|
static char default_empty_value = 127;
|
|
|
|
|
|
2019-04-22 08:00:59 -03:00
|
|
|
static struct lconv default_locale = {
|
2019-06-22 09:32:59 -03:00
|
|
|
default_decimal_point,
|
|
|
|
|
default_thousands_sep,
|
|
|
|
|
default_grouping,
|
2019-11-16 05:26:18 -03:00
|
|
|
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
|
2019-04-22 08:00:59 -03:00
|
|
|
};
|
|
|
|
|
|
2021-02-11 19:31:21 -03:00
|
|
|
char* setlocale(int, const char*)
|
2019-02-07 23:38:21 -02:00
|
|
|
{
|
2021-06-04 18:19:56 -03:00
|
|
|
static char locale[2];
|
|
|
|
|
memcpy(locale, "C", 2);
|
|
|
|
|
return locale;
|
2019-02-07 23:38:21 -02:00
|
|
|
}
|
|
|
|
|
|
2019-02-26 08:57:02 -03:00
|
|
|
struct lconv* localeconv()
|
|
|
|
|
{
|
2019-04-22 08:00:59 -03:00
|
|
|
return &default_locale;
|
2019-02-26 08:57:02 -03:00
|
|
|
}
|
2019-02-07 23:38:21 -02:00
|
|
|
}
|