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