mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-04 02:23:10 +00:00
Implemented stdlib.h
This commit is contained in:
+23
-2
@@ -3,7 +3,28 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void* malloc(const size_t size);
|
||||
void free(const void* ptr);
|
||||
#define EXIT_SUCCESS 0
|
||||
#define EXIT_FAILURE 1
|
||||
#define RAND_MAX 0x7FFFFFF
|
||||
|
||||
/* Memory allocation */
|
||||
void* malloc(size_t size);
|
||||
void* calloc(size_t count, size_t size);
|
||||
void* realloc(void* ptr, size_t size);
|
||||
void free(void* ptr);
|
||||
|
||||
/* Process controll */
|
||||
void _Exit(int status);
|
||||
void exit(int status);
|
||||
|
||||
// TODO: move atoi() here
|
||||
|
||||
/* Random number generator */
|
||||
int rand(void);
|
||||
void srand(unsigned int seed);
|
||||
|
||||
/* Sort & search */
|
||||
void qsort(void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*));
|
||||
void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*));
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user