diff options
Diffstat (limited to 'src/init/stdlib.h')
-rw-r--r-- | src/init/stdlib.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/init/stdlib.h b/src/init/stdlib.h index 1d7efdf..f8ab6c0 100644 --- a/src/init/stdlib.h +++ b/src/init/stdlib.h @@ -1,7 +1,18 @@ #pragma once #include <shared/mem.h> +#include <stdbool.h> #include <stddef.h> -extern int __stdin, __stdout; - int printf(const char *fmt, ...); + +typedef struct { + int fd; + int pos; + bool eof; +} libc_file; +int file_open(libc_file*, const char *path); // TODO return a libc_file* +int file_read(libc_file*, char *buf, size_t len); +int file_write(libc_file*, const char *buf, size_t len); +void file_close(libc_file*); + +extern libc_file __stdin, __stdout; |