summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-28 14:51:54 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-28 14:51:54 -0500
commit668c8803705c119997968b00d4c53778df4a0908 (patch)
tree5b948c423de5e7133ef0b3b7b68adcd8b4efd906
parentfcb4d41937f446172f804f86a59801994120938b (diff)
add FILE_STREAM and LOAD_LOCALE
-rw-r--r--src/nonstd/__libc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nonstd/__libc.c b/src/nonstd/__libc.c
index d48d6714..168ad32c 100644
--- a/src/nonstd/__libc.c
+++ b/src/nonstd/__libc.c
@@ -4,16 +4,18 @@
#include "nonstd/locale.h"
#include "_printf.h"
+#include "_scanf.h"
+#include "_locale.h"
#include "_syscall.h"
void *__libc(LIBC_INTERNAL variable)
{
extern void *__libc_per_thread(LIBC_INTERNAL __variable);
+ static struct __locale_t locale;
+ static struct __FILE file_streams[FOPEN_MAX];
void *r = (void*)0;
- static struct __locale_t locale;
-
switch (variable) {
case ERRNO:
return __libc_per_thread(ERRNO);
@@ -45,6 +47,14 @@ void *__libc(LIBC_INTERNAL variable)
r = (void*)(__printf);
break;
+ case FILE_STREAMS:
+ r = file_streams;
+ break;
+
+ case LOAD_LOCALE:
+ r = (void*)(__load_locale);
+ break;
+
default:
break;
}