Compare commits
3 Commits
d40654a00c
...
dcb8ab569a
Author | SHA1 | Date | |
---|---|---|---|
dcb8ab569a | |||
d467f6257d | |||
5c68d50070 |
@ -19,6 +19,7 @@ set(SOURCES
|
||||
src/env.cpp
|
||||
src/pwd.cpp
|
||||
src/grp.cpp
|
||||
src/locale.cpp
|
||||
src/sys/stat.cpp
|
||||
src/sys/mman.cpp
|
||||
src/sys/wait.cpp
|
||||
|
18
libc/include/bits/locale-cat.h
Normal file
18
libc/include/bits/locale-cat.h
Normal file
@ -0,0 +1,18 @@
|
||||
/* bits/locale-cat.h: Locale categories. */
|
||||
|
||||
#ifndef _BITS_LOCALE_CAT_H
|
||||
#define _BITS_LOCALE_CAT_H
|
||||
|
||||
enum __libc_locale_category
|
||||
{
|
||||
LC_ALL, // Controls all locales.
|
||||
LC_CTYPE, // Character classification and case conversion.
|
||||
LC_COLLATE, // Collation order.
|
||||
LC_MONETARY, // Monetary formatting.
|
||||
LC_NUMERIC, // Numeric, non-monetary formatting.
|
||||
LC_TIME, // Date and time formats.
|
||||
LC_MESSAGES, // Formats of informative and diagnostic messages and interactive responses.
|
||||
__num_locale_categories,
|
||||
};
|
||||
|
||||
#endif
|
20
libc/include/locale.h
Normal file
20
libc/include/locale.h
Normal file
@ -0,0 +1,20 @@
|
||||
/* locale.h: Locale category macros. */
|
||||
|
||||
#ifndef _LOCALE_H
|
||||
#define _LOCALE_H
|
||||
|
||||
#include <bits/locale-cat.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
// Query or set the current locale.
|
||||
char* setlocale(int category, const char* locale);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -31,6 +31,9 @@ typedef struct
|
||||
|
||||
#define RAND_MAX 32767
|
||||
|
||||
#define EXIT_SUCCESS 0
|
||||
#define EXIT_FAILURE 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
@ -93,6 +96,9 @@ extern "C"
|
||||
* endptr if nonnull. */
|
||||
unsigned long strtoul(const char* str, char** endptr, int base);
|
||||
|
||||
#define strtoll strtol
|
||||
#define strtoull strtoul
|
||||
|
||||
/* Return the next pseudorandom number. */
|
||||
int rand();
|
||||
|
||||
|
16
libc/include/sys/param.h
Normal file
16
libc/include/sys/param.h
Normal file
@ -0,0 +1,16 @@
|
||||
/* sys/param.h: Old-style BSD macros. */
|
||||
|
||||
#ifndef _SYS_PARAM_H
|
||||
#define _SYS_PARAM_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#endif
|
12
libc/src/locale.cpp
Normal file
12
libc/src/locale.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include <locale.h>
|
||||
|
||||
static char s_default_locale[] = "C";
|
||||
|
||||
extern "C"
|
||||
{
|
||||
char* setlocale(int, const char*)
|
||||
{
|
||||
// FIXME: Set the current locale if <locale> is not NULL.
|
||||
return s_default_locale;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user