Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Data Structures | Macros | Functions
stdlib.h File Reference
#include <stddef.h>
Include dependency graph for stdlib.h:

Go to the source code of this file.

Data Structures

struct  div_t
 
struct  ldiv_t
 
struct  lldiv_t
 

Macros

#define EXIT_SUCCESS   0
 
#define EXIT_FAILURE   1
 
#define RAND_MAX   0x7fffffff
 
#define alloca(size)   __builtin_alloca(size)
 

Functions

void exit (int status)
 To cause task termination. More...
 
void * malloc (size_t size)
 Allocate a memory space. More...
 
void free (void *ptr)
 Free a memory space. More...
 
void * calloc (size_t nmemb, size_t size)
 Allocate and reset a memory space of an array. More...
 
void * realloc (void *ptr, size_t size)
 Resize an allocated memory space, preserving its contents. More...
 
int mkstemp (char *template)
 Create a file no other name stands for and open it. The last six characters of the template must be XXXXXX and are replaced with the name the file was given. More...
 
char * ltoa (long value, char *buffer, int radix)
 
int atoi (const char *nptr)
 
long atol (const char *nptr)
 
long long atoll (const char *nptr)
 
long a64l (const char *str64)
 
int abs (int j)
 
double atof (const char *nptr)
 
void * bsearch (const void *key, const void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
 
div_t div (int numerator, int denominator)
 
int getsubopt (char **optionp, char *const *tokens, char **valuep)
 
char * l64a (long value)
 
long labs (long j)
 
ldiv_t ldiv (long numerator, long denominator)
 
long long llabs (long long j)
 
lldiv_t lldiv (long long numerator, long long denominator)
 
int mblen (const char *s, size_t n)
 
size_t mbstowcs (wchar_t *dest, const char *src, size_t n)
 
int mbtowc (wchar_t *pwc, const char *s, size_t n)
 
void qsort (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
 
char * realpath (const char *path, char *resolved_path)
 
double strtod (const char *nptr, char **endptr)
 
float strtof (const char *nptr, char **endptr)
 
long strtol (const char *nptr, char **endptr, int base)
 
long double strtold (const char *nptr, char **endptr)
 
long long strtoll (const char *nptr, char **endptr, int base)
 
unsigned long strtoul (const char *nptr, char **endptr, int base)
 
unsigned long long strtoull (const char *nptr, char **endptr, int base)
 
size_t wcstombs (char *dest, const wchar_t *src, size_t n)
 
int wctomb (char *s, wchar_t wc)
 

Function Documentation

◆ calloc()

void* calloc ( size_t  nmemb,
size_t  size 
)

Allocate and reset a memory space of an array.

Parameters
nmembSize of the array element.
sizeThe number of array elements.
Return values
void*: The pointer to the allocated memory. If the allocation failed, the function returns NULL.

◆ exit()

void exit ( int  status)

To cause task termination.

Parameters
statusNot used.
Return values
None

◆ free()

void free ( void *  ptr)

Free a memory space.

Parameters
ptrPointer to the allocated memory.
Return values
None

◆ malloc()

void* malloc ( size_t  size)

Allocate a memory space.

Parameters
sizeThe number of bytes for allocating a memory space.
Return values
void*: The pointer to the allocated memory. If the allocation failed, the function returns NULL.

◆ mkstemp()

int mkstemp ( char *  template)

Create a file no other name stands for and open it. The last six characters of the template must be XXXXXX and are replaced with the name the file was given.

Parameters
templateThe name to make unique, ending in XXXXXX.
Return values
intThe descriptor of the new file, and -1 on error with the reason left in errno.

◆ realloc()

void* realloc ( void *  ptr,
size_t  size 
)

Resize an allocated memory space, preserving its contents.

Parameters
ptrPointer to the allocated memory, or NULL to allocate anew.
sizeThe new number of bytes, or zero to free the memory.
Return values
void*: The pointer to the resized memory, which may differ from ptr. If the allocation failed, the function returns NULL and the memory pointed to by ptr is left untouched.