From a10aabfcd52f702057316018cd7847ab2bfe4aa1 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Tue, 26 May 2026 21:32:27 +0000 Subject: we're bringing kjarna back and not doing the crazy stuff with trying to have task management during efi. that was a bit extra. --- lib/api/libc/stdio.h | 20 ++++++++++++++++++++ lib/api/libc/stdlib.h | 9 +++++++++ lib/api/libc/string.h | 14 ++++++++++++++ lib/api/libc/wchar.h | 6 ++++++ 4 files changed, 49 insertions(+) create mode 100644 lib/api/libc/stdio.h create mode 100644 lib/api/libc/stdlib.h create mode 100644 lib/api/libc/string.h create mode 100644 lib/api/libc/wchar.h (limited to 'lib/api') 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 + +#include + +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 + +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 + +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 + +size_t wcslen(const wchar_t *s); +wchar_t *wcsdup(const wchar_t *s); -- cgit v1.3.1-1-g115d