Implement locale.h header
This commit is contained in:
parent
e8b05994e3
commit
aef11763b2
|
@ -3,10 +3,10 @@ $c_SRCDIR = $(TREE_PATH)/$c/src
|
|||
$c_HEADERDIR := $(TREE_PATH)/$c/include
|
||||
$c_OBJDIR := $(BUILD_PATH)/$c/obj
|
||||
|
||||
$c_HEADERS := assert.h ctype.h errno.h signal.h stdio.h stdlib.h string.h time.h \
|
||||
$c_HEADERS := assert.h ctype.h errno.h locale.h signal.h stdio.h stdlib.h string.h time.h \
|
||||
mlibc/ensure.h
|
||||
|
||||
$c_OBJECTS := assert.o ctype.o signal.o stdio.o stdlib.o string.o time.o
|
||||
$c_OBJECTS := assert.o ctype.o locale.o signal.o stdio.o stdlib.o string.o time.o
|
||||
$c_OBJECT_PATHS := $(addprefix $($c_OBJDIR)/,$($c_OBJECTS))
|
||||
|
||||
$c_CXX := x86_64-managarm-g++
|
||||
|
|
58
libc/generic/ansi/include/locale.h
Normal file
58
libc/generic/ansi/include/locale.h
Normal file
|
@ -0,0 +1,58 @@
|
|||
|
||||
#ifndef _LOCALE_H
|
||||
#define _LOCALE_H
|
||||
|
||||
#include <mlibc/null.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct lconv {
|
||||
char *decimal_point;
|
||||
char *thousands_sep;
|
||||
char *grouping;
|
||||
char *mon_decimal_point;
|
||||
char *mon_thousands_sep;
|
||||
char *mon_grouping;
|
||||
char *positive_sign;
|
||||
char *negative_sign;
|
||||
char *currency_symbol;
|
||||
char frac_digits;
|
||||
char p_cs_precedes;
|
||||
char n_cs_precedes;
|
||||
char p_sep_by_space;
|
||||
char n_sep_by_space;
|
||||
char p_sign_posn;
|
||||
char n_sign_posn;
|
||||
char *int_curr_symbol;
|
||||
char int_frac_digits;
|
||||
char int_p_cs_precedes;
|
||||
char int_n_cs_precedes;
|
||||
char int_p_sep_by_space;
|
||||
char int_n_sep_by_space;
|
||||
char int_p_sign_posn;
|
||||
char int_n_sign_posn;
|
||||
};
|
||||
|
||||
#define LC_ALL 1
|
||||
#define LC_COLLATE 2
|
||||
#define LC_CTYPE 3
|
||||
#define LC_MONETARY 4
|
||||
#define LC_NUMERIC 5
|
||||
#define LC_TIME 6
|
||||
|
||||
// [C11/7.11.1] setlocale() function
|
||||
|
||||
char *setlocale(int category, const char *locale);
|
||||
|
||||
// [C11/7.11.2] Locale inquiry function
|
||||
|
||||
struct lconv *localeconv(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _LOCALE_H
|
||||
|
15
libc/generic/ansi/src/locale.cpp
Normal file
15
libc/generic/ansi/src/locale.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
#include <locale.h>
|
||||
|
||||
#include <mlibc/ensure.h>
|
||||
|
||||
char *setlocale(int category, const char *locale) {
|
||||
__ensure(!"Not implemented");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
struct lconv *localeconv(void) {
|
||||
__ensure(!"Not implemented");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
Loading…
Reference in a new issue