diff options
| author | Ada Christine <adachristine18@gmail.com> | 2026-05-26 21:32:27 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2026-05-26 21:32:27 +0000 |
| commit | a10aabfcd52f702057316018cd7847ab2bfe4aa1 (patch) | |
| tree | cc4652d2b602798934e8a48b4939cfb20eda1989 /lib/api/libc | |
| parent | 90c29fdde317c39384011a6ba97077c138f13ad6 (diff) | |
we're bringing kjarna back and not doing the crazy stuff with trying to have task management during efi. that was a bit extra.kjarna
Diffstat (limited to 'lib/api/libc')
| -rw-r--r-- | lib/api/libc/stdio.h | 20 | ||||
| -rw-r--r-- | lib/api/libc/stdlib.h | 9 | ||||
| -rw-r--r-- | lib/api/libc/string.h | 14 | ||||
| -rw-r--r-- | lib/api/libc/wchar.h | 6 |
4 files changed, 49 insertions, 0 deletions
diff --git a/lib/api/libc/stdio.h b/lib/api/libc/stdio.h new file mode 100644 index 0000000..81ee462 --- /dev/null +++ b/lib/api/libc/stdio.h @@ -0,0 +1,20 @@ +#pragma once + +#include <libc/string.h> + +#include <stdarg.h> + +typedef struct FILE FILE; + +extern FILE *stdout; +extern FILE *stderr; + +extern int fputc(int c, FILE *f); + +int vfprintf(FILE *f, const char *restrict format, va_list arguments); +int fprintf(FILE *f, const char *restrict format, ...); +int vprintf(const char *restrict format, va_list arguments); +int printf(const char *restrict format, ...); +int vsprintf(char *s, const char *restrict format, va_list arguments); +int sprintf(char *s, const char *restrict format, ...); + diff --git a/lib/api/libc/stdlib.h b/lib/api/libc/stdlib.h new file mode 100644 index 0000000..d1f3d3b --- /dev/null +++ b/lib/api/libc/stdlib.h @@ -0,0 +1,9 @@ +#pragma once + +#include <stddef.h> + +size_t mbstowcs(wchar_t *dst, const char *src, size_t length); +void *malloc(size_t size); +void *calloc(size_t count, size_t size); +void free(void *block); + diff --git a/lib/api/libc/string.h b/lib/api/libc/string.h new file mode 100644 index 0000000..c28e17c --- /dev/null +++ b/lib/api/libc/string.h @@ -0,0 +1,14 @@ +#pragma once + +#include <stddef.h> + +void *memcpy(void *dest, const void *src, size_t size); +void *memmove(void *dest, const void *src, size_t size); +void *memset(void *dest, int val, size_t size); +int memcmp(const void *str1, const void *str2, size_t count); +size_t strlen(const char *s); +unsigned long long strtoull( + const char *restrict begin, + char **restrict end, + int base); + diff --git a/lib/api/libc/wchar.h b/lib/api/libc/wchar.h new file mode 100644 index 0000000..350c209 --- /dev/null +++ b/lib/api/libc/wchar.h @@ -0,0 +1,6 @@ +#pragma once + +#include <stddef.h> + +size_t wcslen(const wchar_t *s); +wchar_t *wcsdup(const wchar_t *s); |
