Implement locale.h header

This commit is contained in:
avdgrinten 2015-11-28 20:33:36 +01:00
parent e8b05994e3
commit aef11763b2
3 changed files with 75 additions and 2 deletions

View file

@ -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++

View 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

View 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();
}