From 41ee6b43c89ce67808a684ba67f69e964b0636fa Mon Sep 17 00:00:00 2001 From: aqua Date: Sat, 18 Feb 2023 10:12:24 +0200 Subject: Move C stdlib to lib/libk --- lib/libk/stdlib.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/libk/stdlib.h (limited to 'lib/libk/stdlib.h') diff --git a/lib/libk/stdlib.h b/lib/libk/stdlib.h new file mode 100644 index 0000000..84d9b2d --- /dev/null +++ b/lib/libk/stdlib.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +///@defgroup libk libk +///@{ +///@defgroup stdlib stdlib +///@{ + +/** + * Allocate size bytes and return a pointer to the allocated memory + */ +void *malloc(size_t size); + +/** + * Free the memory space pointed to by ptr + */ +void free(void *ptr); + +/** + * Fill the first n bytes of the memory area pointed to by s with the constant byte c. + */ +void *memset(void *s, int c, long unsigned n); + +/** + * Copy n bytes from memory area src to memory area dest. The memory areas must not overlap. + */ +void *memcpy(void *restrict dest, const void *restrict src, long unsigned n); + +///@} +///@} -- cgit v1.2.1