62 #ifndef __INCLUDE_STDLIB_H 63 #define __INCLUDE_STDLIB_H 69 #include <tinyara/config.h> 70 #include <tinyara/compiler.h> 71 #include <sys/types.h> 83 #define EXIT_SUCCESS 0 84 #define EXIT_FAILURE 1 92 #define MAX_RAND 32767 105 #ifndef CONFIG_DISABLE_ENIVRON 106 #define environ get_environ_ptr() 162 #if defined(__cplusplus) 163 #define EXTERN extern "C" 166 #define EXTERN extern 178 void srand(
unsigned int seed);
188 #ifndef CONFIG_DISABLE_ENIVRON 203 FAR
char *
getenv(FAR
const char *name);
210 int putenv(FAR
const char *
string);
225 int setenv(
const char *name,
const char *value,
int overwrite);
242 void exit(
int status) noreturn_function;
248 void abort(
void) noreturn_function;
249 #ifdef CONFIG_SCHED_ATEXIT 256 int atexit(CODE
void (*func)(
void));
258 #ifdef CONFIG_SCHED_ONEXIT 270 int on_exit(CODE
void (*func)(
int, FAR
void *), FAR
void *arg);
278 void _exit(
int status);
282 #define _Exit(s) _exit(s) 290 long strtol(
const char *,
char **,
int);
296 unsigned long strtoul(
const char *,
char **,
int);
297 #ifdef CONFIG_HAVE_LONG_LONG 303 long long strtoll(
const char *,
char **,
int);
309 unsigned long long strtoull(
const char *,
char **,
int);
316 double_t
strtod(
const char *,
char **);
323 #define atoi(nptr) strtol((nptr), NULL, 10) 329 #define atol(nptr) strtol((nptr), NULL, 10) 330 #ifdef CONFIG_HAVE_LONG_LONG 336 #define atoll(nptr) strtoll((nptr), NULL, 10) 343 #define atof(nptr) strtod((nptr), NULL) 356 char *
itoa(
int value,
char *str,
int base);
370 void free(FAR
void *);
376 FAR
void *
realloc(FAR
void *,
size_t);
401 FAR
void *
calloc(
size_t,
size_t);
415 long int labs(
long int j);
416 #ifdef CONFIG_HAVE_LONG_LONG 422 long long int llabs(
long long int j);
425 #ifdef CONFIG_CAN_PASS_STRUCTS 430 div_t div(
int numer,
int denom);
434 ldiv_t ldiv(
long numer,
long denom);
435 #ifdef CONFIG_HAVE_LONG_LONG 439 lldiv_t lldiv(
long long numer,
long long denom);
450 int mktemp(FAR
char *path_template);
454 int mkstemp(FAR
char *path_template);
465 void qsort(
void *base,
size_t nmemb,
size_t size,
int (*compar)(
const void *,
const void *));
472 FAR
void *bsearch(FAR
const void *key, FAR
const void *base,
size_t nel,
size_t width, CODE
int (*compar)(FAR
const void *, FAR
const void *));
477 #ifdef CONFIG_CAN_PASS_STRUCTS 497 #if defined(__cplusplus)
FAR void * calloc(size_t, size_t)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int setenv(const char *name, const char *value, int overwrite)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int mallinfo(struct mallinfo *info)
returns a copy of updated current heap information for the user heap
int on_exit(CODE void(*func)(int, FAR void *), FAR void *arg)
register a function to be called at program exit
unsigned long long strtoull(const char *, char **, int)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int abs(int j)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int rand(void)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
void abort(void) noreturn_function
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
void free(FAR void *)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
FAR char * get_environ_ptr(size_t *envsize)
Return a pointer to the thread specific environ variable.
int putenv(FAR const char *string)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
void exit(int status) noreturn_function
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
unsigned long strtoul(const char *, char **, int)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
FAR void * memalign(size_t, size_t)
allocates size bytes and returns a pointer to the allocated memory
void srand(unsigned int seed)
initialize random number generator
long long strtoll(const char *, char **, int)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int atexit(CODE void(*func)(void))
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
long long int llabs(long long int j)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
FAR void * realloc(FAR void *, size_t)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
FAR void * malloc(size_t)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int unsetenv(const char *name)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
char * itoa(int value, char *str, int base)
convert integer to string
FAR void * zalloc(size_t)
Allocate and zero memory from the user heap.
int clearenv(void)
clears the environment of all name-value pairs and sets the value of the external variable environ to...
long int labs(long int j)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
FAR char * getenv(FAR const char *name)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
structure of memory information
long strtol(const char *, char **, int)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
double_t strtod(const char *, char **)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)