GBDK 2020 Docs  4.2.0
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_mos6502) && !defined(__SDCC_mos65c02) && !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) OLDCALL;
18 
19 #if 0
22 int getkey(void) OLDCALL;
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 
77 char *itoa(int n, char *s, unsigned char radix) OLDCALL;
78 
90 char *uitoa(unsigned int n, char *s, unsigned char radix) OLDCALL;
91 
103 char *ltoa(long n, char *s, unsigned char radix) OLDCALL;
104 
116 char *ultoa(unsigned long n, char *s, unsigned char radix) OLDCALL;
117 
118 
121 void *calloc (size_t nmemb, size_t size);
122 void *malloc (size_t size);
123 void *realloc (void *ptr, size_t size);
124 #if __STDC_VERSION__ >= 201112L
125 inline void *aligned_alloc(size_t alignment, size_t size)
126 {
127  (void)alignment;
128  return malloc(size);
129 }
130 #endif
131 extern void free (void * ptr);
132 
133 /* Searching and sorting utilities (ISO C11 7.22.5) */
144 extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) __reentrant);
145 
146 
153 extern void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) __reentrant);
154 
155 #endif
#define OLDCALL
Definition: types.h:21
void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *) __reentrant)
void * realloc(void *ptr, size_t size)
void exit(int status) OLDCALL
int atoi(const char *s)
char * uitoa(unsigned int n, char *s, unsigned char radix) OLDCALL
int abs(int i) OLDCALL
void * calloc(size_t nmemb, size_t size)
char * ltoa(long n, char *s, unsigned char radix) OLDCALL
void * malloc(size_t size)
long atol(const char *s)
#define __reentrant
Definition: stdlib.h:10
long labs(long num) OLDCALL
char * itoa(int n, char *s, unsigned char radix) OLDCALL
void * bsearch(const void *key, const void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *) __reentrant)
char * ultoa(unsigned long n, char *s, unsigned char radix) OLDCALL
void free(void *ptr)