]> git.saurik.com Git - apple/xnu.git/blob - libsa/libsa/stdlib.h
304f0807e8c3033c7a7713a744f407d5ae7c1381
[apple/xnu.git] / libsa / libsa / stdlib.h
1 #ifndef _LIBSA_STDLIB_H_
2 #define _LIBSA_STDLIB_H_
3
4 #include <sys/cdefs.h>
5 #include <sys/_types.h>
6
7 #ifndef _SIZE_T
8 #define _SIZE_T
9 typedef __darwin_size_t size_t;
10 #endif
11
12 #ifndef NULL
13 #if defined (__cplusplus)
14 #define NULL 0
15 #else
16 #define NULL ((void *)0)
17 #endif
18 #endif
19
20
21 __private_extern__ const char *kld_basefile_name;
22
23
24 __BEGIN_DECLS
25
26
27 __private_extern__ void * malloc(size_t size);
28 __private_extern__ void free(void * address);
29 __private_extern__ void free_all(void); // "Free" all memory blocks
30 __private_extern__ void malloc_reset(void); // Destroy all memory regions
31 __private_extern__ void * realloc(void * address, size_t new_size);
32
33 __private_extern__ char * strrchr(const char *cp, int ch);
34 __private_extern__ char * strstr(const char *in, const char *str);
35
36 __private_extern__ void qsort(
37 void * array,
38 size_t nmembers,
39 size_t member_size,
40 int (*)(const void *, const void *));
41
42 __private_extern__ const void * bsearch(
43 register const void *key,
44 const void *base0,
45 size_t nmemb,
46 register size_t size,
47 register int (*compar)(const void *, const void *));
48
49 __END_DECLS
50
51 #endif /* _LIBSA_STDLIB_H_ */