X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=bootcensus;a=blobdiff_plain;f=src%2Flibc%2Fstdlib.h;fp=src%2Flibc%2Fstdlib.h;h=981cf6975694c8aed0348d827dd473b96ea92e64;hp=9a0eab4c56c66db4b1d5932feed21bf918f9934d;hb=81c11bdd80190ec319a82b0402173cfb65fcbf72;hpb=7dcd5071e600f8cf48174d1fddb3dba57ec9476d diff --git a/src/libc/stdlib.h b/src/libc/stdlib.h index 9a0eab4..981cf69 100644 --- a/src/libc/stdlib.h +++ b/src/libc/stdlib.h @@ -1,6 +1,6 @@ /* pcboot - bootable PC demo/game kernel -Copyright (C) 2018 John Tsiombikas +Copyright (C) 2018-2019 John Tsiombikas This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,10 +18,11 @@ along with this program. If not, see . #ifndef STDLIB_H_ #define STDLIB_H_ -#include +#include -typedef int32_t ssize_t; -typedef uint32_t size_t; +#define RAND_MAX 2147483647 + +#define abs(x) __builtin_abs(x) int atoi(const char *str); long atol(const char *str); @@ -30,6 +31,19 @@ long strtol(const char *str, char **endp, int base); void itoa(int val, char *buf, int base); void utoa(unsigned int val, char *buf, int base); +double atof(const char *str); +double strtod(const char *str, char **endp); + +int atexit(void (*func)(void)); + +void abort(void); + +void qsort(void *arr, size_t count, size_t size, int (*cmp)(const void*, const void*)); + +int rand(void); +int rand_r(unsigned int *seedp); +void srand(unsigned int seed); + /* defined in malloc.c */ void *malloc(size_t sz); void *calloc(size_t num, size_t sz);