PatchworkOS  da8a090
A non-POSIX operating system.
Loading...
Searching...
No Matches
stdlib.h File Reference
#include "_internal/NULL.h"
#include "_internal/config.h"
#include "_internal/size_t.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 ltoa(number, str, base)   lltoa(number, str, base)
 
#define itoa(number, str, base)   lltoa(number, str, base)
 
#define ultoa(number, str, base)   lltoa(number, str, base)
 
#define uitoa(number, str, base)   lltoa(number, str, base)
 
#define strtol(nptr, endptr, base)   ((long int)strtoll(nptr, endptr, base))
 
#define atol(nptr)   ((long)atoll(nptr))
 
#define atoi(nptr)   ((int)atoll(nptr))
 
#define RAND_MAX   32767
 
#define EXIT_SUCCESS   0
 
#define EXIT_FAILURE   -1
 

Functions

_PUBLIC char * lltoa (long long number, char *str, int base)
 
_PUBLIC char * ulltoa (unsigned long long number, char *str, int base)
 
_PUBLIC double atof (const char *nptr)
 
_PUBLIC double strtod (const char *_RESTRICT nptr, char **_RESTRICT endptr)
 
_PUBLIC float strtof (const char *_RESTRICT nptr, char **_RESTRICT endptr)
 
_PUBLIC long double strtold (const char *_RESTRICT nptr, char **_RESTRICT endptr)
 
_PUBLIC long long int strtoll (const char *_RESTRICT nptr, char **_RESTRICT endptr, int base)
 
_PUBLIC unsigned long int strtoul (const char *_RESTRICT nptr, char **_RESTRICT endptr, int base)
 
_PUBLIC unsigned long long int strtoull (const char *_RESTRICT nptr, char **_RESTRICT endptr, int base)
 
_PUBLIC long long int atoll (const char *nptr)
 
_PUBLIC int rand (void)
 
_PUBLIC void srand (unsigned int seed)
 
_PUBLIC void * malloc (size_t size)
 
_PUBLIC void * calloc (size_t nmemb, size_t size)
 
_PUBLIC void free (void *ptr)
 
_PUBLIC void * realloc (void *ptr, size_t size)
 
_PUBLIC _NORETURN void abort (void)
 
_PUBLIC int at_quick_exit (void(*func)(void))
 
_PUBLIC int atexit (void(*func)(void))
 
_PUBLIC _NORETURN void exit (int status)
 
_PUBLIC _NORETURN void quick_exit (int status)
 
_PUBLIC _NORETURN void _Exit (int status)
 
_PUBLIC char * getenv (const char *name)
 
_PUBLIC int system (const char *string)
 
_PUBLIC void * bsearch (const void *key, const void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
 
_PUBLIC void qsort (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
 
_PUBLIC int abs (int j)
 
_PUBLIC long int labs (long int j)
 
_PUBLIC long long int llabs (long long int j)
 
_PUBLIC div_t div (int numer, int denom)
 
_PUBLIC ldiv_t ldiv (long int numer, long int denom)
 
_PUBLIC lldiv_t lldiv (long long int numer, long long int denom)
 

Macro Definition Documentation

◆ ltoa

#define ltoa (   number,
  str,
  base 
)    lltoa(number, str, base)

Definition at line 14 of file stdlib.h.

◆ itoa

#define itoa (   number,
  str,
  base 
)    lltoa(number, str, base)

Definition at line 15 of file stdlib.h.

◆ ultoa

#define ultoa (   number,
  str,
  base 
)    lltoa(number, str, base)

Definition at line 18 of file stdlib.h.

◆ uitoa

#define uitoa (   number,
  str,
  base 
)    lltoa(number, str, base)

Definition at line 19 of file stdlib.h.

◆ strtol

#define strtol (   nptr,
  endptr,
  base 
)    ((long int)strtoll(nptr, endptr, base))

Definition at line 27 of file stdlib.h.

◆ atol

#define atol (   nptr)    ((long)atoll(nptr))

Definition at line 33 of file stdlib.h.

◆ atoi

#define atoi (   nptr)    ((int)atoll(nptr))

Definition at line 34 of file stdlib.h.

◆ RAND_MAX

#define RAND_MAX   32767

Definition at line 36 of file stdlib.h.

◆ EXIT_SUCCESS

#define EXIT_SUCCESS   0

Definition at line 46 of file stdlib.h.

◆ EXIT_FAILURE

#define EXIT_FAILURE   -1

Definition at line 47 of file stdlib.h.

Function Documentation

◆ lltoa()

_PUBLIC char * lltoa ( long long  number,
char *  str,
int  base 
)

◆ ulltoa()

_PUBLIC char * ulltoa ( unsigned long long  number,
char *  str,
int  base 
)

Definition at line 5 of file ulltoa.c.

Here is the caller graph for this function:

◆ atof()

_PUBLIC double atof ( const char *  nptr)
Todo:
Finish this implementation, missing NAN, INF 0x/0X handling.

Definition at line 7 of file atof.c.

Here is the call graph for this function:

◆ strtod()

_PUBLIC double strtod ( const char *_RESTRICT  nptr,
char **_RESTRICT  endptr 
)

◆ strtof()

_PUBLIC float strtof ( const char *_RESTRICT  nptr,
char **_RESTRICT  endptr 
)

◆ strtold()

_PUBLIC long double strtold ( const char *_RESTRICT  nptr,
char **_RESTRICT  endptr 
)

◆ strtoll()

_PUBLIC long long int strtoll ( const char *_RESTRICT  nptr,
char **_RESTRICT  endptr,
int  base 
)
Here is the caller graph for this function:

◆ strtoul()

_PUBLIC unsigned long int strtoul ( const char *_RESTRICT  nptr,
char **_RESTRICT  endptr,
int  base 
)

◆ strtoull()

_PUBLIC unsigned long long int strtoull ( const char *_RESTRICT  nptr,
char **_RESTRICT  endptr,
int  base 
)

◆ atoll()

_PUBLIC long long int atoll ( const char *  nptr)

Definition at line 8 of file atoll.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rand()

_PUBLIC int rand ( void  )

Definition at line 5 of file rand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ srand()

_PUBLIC void srand ( unsigned int  seed)
Here is the caller graph for this function:

◆ malloc()

_PUBLIC void * malloc ( size_t  size)

Definition at line 5 of file malloc.c.

Here is the call graph for this function:

◆ calloc()

_PUBLIC void * calloc ( size_t  nmemb,
size_t  size 
)

Definition at line 6 of file calloc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

_PUBLIC void free ( void *  ptr)

Definition at line 11 of file free.c.

Here is the call graph for this function:

◆ realloc()

_PUBLIC void * realloc ( void *  ptr,
size_t  size 
)

Definition at line 13 of file realloc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ abort()

_PUBLIC _NORETURN void abort ( void  )

Definition at line 7 of file abort.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ at_quick_exit()

_PUBLIC int at_quick_exit ( void(*)(void)  func)

◆ atexit()

_PUBLIC int atexit ( void(*)(void)  func)

◆ exit()

_PUBLIC _NORETURN void exit ( int  status)

Definition at line 7 of file exit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quick_exit()

_PUBLIC _NORETURN void quick_exit ( int  status)

◆ _Exit()

_PUBLIC _NORETURN void _Exit ( int  status)

◆ getenv()

_PUBLIC char * getenv ( const char *  name)

◆ system()

int system ( const char *  string)

Definition at line 6 of file system.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsearch()

_PUBLIC void * bsearch ( const void *  key,
const void *  base,
size_t  nmemb,
size_t  size,
int(*)(const void *, const void *)  compar 
)

◆ qsort()

_PUBLIC void qsort ( void *  base,
size_t  nmemb,
size_t  size,
int(*)(const void *, const void *)  compar 
)

Definition at line 47 of file qsort.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ abs()

_PUBLIC int abs ( int  j)

Definition at line 3 of file abs.c.

Here is the caller graph for this function:

◆ labs()

_PUBLIC long int labs ( long int  j)

Definition at line 3 of file labs.c.

◆ llabs()

_PUBLIC long long int llabs ( long long int  j)

Definition at line 3 of file llabs.c.

◆ div()

_PUBLIC div_t div ( int  numer,
int  denom 
)

Definition at line 3 of file div.c.

Here is the caller graph for this function:

◆ ldiv()

_PUBLIC ldiv_t ldiv ( long int  numer,
long int  denom 
)

◆ lldiv()

_PUBLIC lldiv_t lldiv ( long long int  numer,
long long int  denom 
)