foo
[mdlife] / src / libc / stdlib.h
1 #ifndef STDLIB_H_
2 #define STDLIB_H_
3
4 #include <stddef.h>
5
6 #define RAND_MAX        2147483647
7
8 #define abs(x)  __builtin_abs(x)
9
10 int atoi(const char *str);
11 long atol(const char *str);
12 long strtol(const char *str, char **endp, int base);
13
14 void itoa(int val, char *buf, int base);
15 void utoa(unsigned int val, char *buf, int base);
16
17 void qsort(void *arr, size_t count, size_t size, int (*cmp)(const void*, const void*));
18
19 int rand(void);
20 int rand_r(unsigned int *seedp);
21 void srand(unsigned int seed);
22
23 /* defined in malloc.c */
24 /*void *malloc(size_t sz);
25 void *calloc(size_t num, size_t sz);
26 void *realloc(void *ptr, size_t sz);
27 void free(void *ptr);
28 */
29
30 #endif  /* STDLIB_H_ */