GBDK 2020 Docs  4.0.6
API Documentation for GBDK 2020
stdlib.h
Go to the documentation of this file.
1 
4 #ifndef STDLIB_INCLUDE
5 #define STDLIB_INCLUDE
6 
7 #include <types.h>
8 
9 #if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_ds400) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk13) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
10 #define __reentrant
11 #endif
12 
17 void exit(int status);
18 
19 #if 0
20 
22 int getkey(void);
23 #endif
24 
30 int abs(int i) OLDCALL;
31 
32 
37 long labs(long num) OLDCALL;
38 
39 
55 int atoi(const char *s);
56 
57 
64 long atol(const char *s);
65 
74 char *itoa(int n, char *s, unsigned char radix) OLDCALL;
75 
84 char *uitoa(unsigned int n, char *s, unsigned char radix) OLDCALL;
85 
94 char *ltoa(long n, char *s, unsigned char radix) OLDCALL;
95 
104 char *ultoa(unsigned long n, char *s, unsigned char radix) OLDCALL;
105 
106 
109 void *calloc (size_t nmemb, size_t size);
110 void *malloc (size_t size);
111 void *realloc (void *ptr, size_t size);
112 #if __STDC_VERSION__ >= 201112L
113 inline void *aligned_alloc(size_t alignment, size_t size)
114 {
115  (void)alignment;
116  return malloc(size);
117 }
118 #endif
119 extern void free (void * ptr);
120 
121 /* Searching and sorting utilities (ISO C11 7.22.5) */
132 extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) __reentrant);
133 
134 
141 extern void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) __reentrant);
142 
143 #endif
types.h
realloc
void * realloc(void *ptr, size_t size)
labs
long labs(long num) OLDCALL
abs
int abs(int i) OLDCALL
free
void free(void *ptr)
malloc
void * malloc(size_t size)
calloc
void * calloc(size_t nmemb, size_t size)
atoi
int atoi(const char *s)
bsearch
void * bsearch(const void *key, const void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *) __reentrant)
atol
long atol(const char *s)
OLDCALL
#define OLDCALL
Definition: types.h:19
qsort
void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *) __reentrant)
exit
void exit(int status)
itoa
char * itoa(int n, char *s, unsigned char radix) OLDCALL
ltoa
char * ltoa(long n, char *s, unsigned char radix) OLDCALL
ultoa
char * ultoa(unsigned long n, char *s, unsigned char radix) OLDCALL
__reentrant
#define __reentrant
Definition: stdlib.h:10
uitoa
char * uitoa(unsigned int n, char *s, unsigned char radix) OLDCALL