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 RAND_MAX 32767 105 #ifndef CONFIG_DISABLE_ENVIRON 106 #define environ get_environ_ptr() 163 #if defined(__cplusplus) 164 #define EXTERN extern "C" 167 #define EXTERN extern 180 void srand(
unsigned int seed);
192 #ifndef CONFIG_DISABLE_ENVIRON 212 FAR
char *
getenv(FAR
const char *name);
221 int putenv(FAR
const char *
string);
239 int setenv(
const char *name,
const char *value,
int overwrite);
260 void exit(
int status) noreturn_function;
268 void abort(
void) noreturn_function;
269 #ifdef CONFIG_SCHED_ATEXIT 278 int atexit(CODE
void (*func)(
void));
280 #ifdef CONFIG_SCHED_ONEXIT 293 int on_exit(CODE
void (*func)(
int, FAR
void *), FAR
void *arg);
301 void _exit(
int status);
305 #define _Exit(s) _exit(s) 315 long strtol(
const char *,
char **,
int);
323 unsigned long strtoul(
const char *,
char **,
int);
324 #ifdef CONFIG_HAVE_LONG_LONG 332 long long strtoll(
const char *,
char **,
int);
340 unsigned long long strtoull(
const char *,
char **,
int);
349 double_t
strtod(
const char *,
char **);
358 #define atoi(nptr) strtol((nptr), NULL, 10) 366 #define atol(nptr) strtol((nptr), NULL, 10) 367 #ifdef CONFIG_HAVE_LONG_LONG 375 #define atoll(nptr) strtoll((nptr), NULL, 10) 384 #define atof(nptr) strtod((nptr), NULL) 398 char *
itoa(
int value,
char *str,
int base);
416 void free(FAR
void *);
424 FAR
void *
realloc(FAR
void *,
size_t);
453 FAR
void *
calloc(
size_t,
size_t);
471 long int labs(
long int j);
472 #ifdef CONFIG_HAVE_LONG_LONG 480 long long int llabs(
long long int j);
483 #ifdef CONFIG_CAN_PASS_STRUCTS 496 ldiv_t ldiv(
long numer,
long denom);
497 #ifdef CONFIG_HAVE_LONG_LONG 501 lldiv_t lldiv(
long long numer,
long long denom);
512 int mktemp(FAR
char *path_template);
516 int mkstemp(FAR
char *path_template);
529 void qsort(
void *base,
size_t nmemb,
size_t size,
int (*compar)(
const void *,
const void *));
539 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 *));
541 #ifdef CONFIG_CAN_PASS_STRUCTS 563 #if defined(__cplusplus)
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 *))
binary search a sorted table
FAR void * calloc(size_t, size_t)
a memory allocator
int setenv(const char *name, const char *value, int overwrite)
add or change environment variable
struct mallinfo mallinfo(void)
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)
convert a string to an unsigned long
int abs(int j)
return an integer absolute value
int rand(void)
pseudo-random number generator
void abort(void) noreturn_function
generate an abnormal process abort
void free(FAR void *)
free allocated memory
FAR char * get_environ_ptr(size_t *envsize)
Return a pointer to the thread specific environ variable.
int putenv(FAR const char *string)
change or add a value to an environment
void exit(int status) noreturn_function
terminate a process
unsigned long strtoul(const char *, char **, int)
convert a string to an unsigned long
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)
convert a string to a long integer
int atexit(CODE void(*func)(void))
register a function to run at process termination
long long int llabs(long long int j)
return a long integer absolute value
void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
sort a table of data
FAR void * realloc(FAR void *, size_t)
memory reallocator
FAR void * malloc(size_t)
a memory allocator
int unsetenv(const char *name)
remove an environment variable
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.
div_t div(int numer, int denom)
compute the quotient and remainder of an integer division
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)
return a long integer absolute value
FAR char * getenv(FAR const char *name)
get value of an environment variable
structure of memory information
long strtol(const char *, char **, int)
convert a string to a long integer
double_t strtod(const char *, char **)
convert a string to a double-precision number