diff options
Diffstat (limited to 'src/user/lib/include')
-rw-r--r-- | src/user/lib/include/bits/file.h | 4 | ||||
-rw-r--r-- | src/user/lib/include/errno.h | 3 | ||||
-rw-r--r-- | src/user/lib/include/stdio.h | 14 |
3 files changed, 12 insertions, 9 deletions
diff --git a/src/user/lib/include/bits/file.h b/src/user/lib/include/bits/file.h index d37b7de..74a8c17 100644 --- a/src/user/lib/include/bits/file.h +++ b/src/user/lib/include/bits/file.h @@ -1,9 +1,9 @@ #pragma once #include <stdbool.h> // TODO make opaque -struct libc_file { +struct FILE { int fd; int pos; bool eof; }; -typedef struct libc_file libc_file; +typedef struct FILE FILE; diff --git a/src/user/lib/include/errno.h b/src/user/lib/include/errno.h new file mode 100644 index 0000000..6686a01 --- /dev/null +++ b/src/user/lib/include/errno.h @@ -0,0 +1,3 @@ +#pragma once +#include <camellia/errno.h> +extern int errno; diff --git a/src/user/lib/include/stdio.h b/src/user/lib/include/stdio.h index 291a194..2b1d8ed 100644 --- a/src/user/lib/include/stdio.h +++ b/src/user/lib/include/stdio.h @@ -8,11 +8,11 @@ int snprintf(char *str, size_t len, const char *fmt, ...); int _klogf(const char *fmt, ...); // for kernel debugging only -extern libc_file *const stdin, *const stdout; +extern FILE *const stdin, *const stdout; -libc_file *file_open(const char *path, int flags); -libc_file *file_reopen(libc_file*, const char *path, int flags); -libc_file *file_clone(const 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*); +FILE *fopen(const char *path, const char *mode); +FILE *freopen(const char *path, const char *mode, FILE*); +FILE *file_clone(const FILE*); +int file_read(FILE*, char *buf, size_t len); +int file_write(FILE*, const char *buf, size_t len); +void file_close(FILE*); |