1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
8 // ----------------------------------------------------------------------------
11 #define __STDLIB_H __STDLIB_H
13 // TODO: Documentation
15 // ----------------------------------------------------------------------------
20 #define EXIT_FAILURE // TODO
21 #define EXIT_SUCCESS // TODO
22 #define MB_CUR_MAX // TODO
23 #define RAND_MAX // TODO
25 // ----------------------------------------------------------------------------
46 #include "__wchar_t.h"
48 // ----------------------------------------------------------------------------
52 long long llabs( long long i );
55 div_t div( int numer, int denom );
56 lldiv_t lldiv( long long numer, long long denom );
57 ldiv_t ldiv( long numer, long denom );
60 void srand( unsigned int seed );
62 double atof( const char * s );
63 int atoi( const char * s );
64 long atol( const char * s );
65 long long atoll( const char * s);
67 double strtod( const char * restrict s, char * * restrict endptr );
68 float strtof( const char * restrict s, char * * restrict endptr );
69 long double strtold( const char * restrict s, char * * restrict endptr );
71 long long strtoll( const char * restrict s, char * * restrict endptr, int base );
72 unsigned long long strtoull( const char * restrict s, char * * restrict endptr, int base);
74 long strtol( const char * restrict s, char * * restrict endptr, int base );
75 unsigned long strtoul( const char * restrict s, char * * restrict endptr, int base);
77 void * calloc( size_t nelem, size_t size );
78 void free( void * ptr );
79 void * malloc( size_t size );
80 void * realloc( void * ptr, size_t size );
82 int mblen( const char * s, size_t n );
83 size_t mbstowcs( wchar_t * restrict wcs, const char * restrict s, size_t n );
84 int mbtowc( wchar_t * restrict pwc, const char * restrict s, size_t n );
85 size_t wcstombs( char * restrict s, const wchar_t * restrict wcs, size_t n );
86 int wctomb( char * s, wchar_t wchar );
88 void _Exit( int status );
89 void exit( int status );
91 char * getenv( const char * name );
92 int system( const char * s );
94 int atexit( void (*func) ( void ) );
95 void * bsearch( const void * key, const void * base, size_t nelem, size_t size, int (*cmp) ( const void * ck, const void * ce) );
96 void qsort( void * base, size_t nelem, size_t size, int (*cmp) ( const void * e1, const void * e2) );