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
17 /* TODO: Documentation */
19 /* ----------------------------------------------------------------------------
21 * --------------------------------------------------------------------------*/
25 #define EXIT_FAILURE /* TODO */
26 #define EXIT_SUCCESS /* TODO */
27 #define MB_CUR_MAX /* TODO */
28 #define RAND_MAX /* TODO */
30 /* ----------------------------------------------------------------------------
32 * --------------------------------------------------------------------------*/
52 #define _SIZE_T _SIZE_T
53 typedef __size_t size_t
57 #define _WCHAR_T _WCHAR_T
58 typedef __wchar_t wchar_t
61 /* ----------------------------------------------------------------------------
63 * --------------------------------------------------------------------------*/
66 long long llabs( long long i );
69 div_t div( int numer, int denom );
70 lldiv_t lldiv( long long numer, long long denom );
71 ldiv_t ldiv( long numer, long denom );
74 void srand( unsigned int seed );
76 double atof( const char * s );
77 int atoi( const char * s );
78 long atol( const char * s );
79 long long atoll( const char * s);
81 double strtod( const char * restrict s, char * * restrict endptr );
82 float strtof( const char * restrict s, char * * restrict endptr );
83 long double strtold( const char * restrict s, char * * restrict endptr );
85 long long strtoll( const char * restrict s, char * * restrict endptr, int base );
86 unsigned long long strtoull( const char * restrict s, char * * restrict endptr, int base);
88 long strtol( const char * restrict s, char * * restrict endptr, int base );
89 unsigned long strtoul( const char * restrict s, char * * restrict endptr, int base);
91 void * calloc( size_t nelem, size_t size );
92 void free( void * ptr );
93 void * malloc( size_t size );
94 void * realloc( void * ptr, size_t size );
96 int mblen( const char * s, size_t n );
97 size_t mbstowcs( wchar_t * restrict wcs, const char * restrict s, size_t n );
98 int mbtowc( wchar_t * restrict pwc, const char * restrict s, size_t n );
99 size_t wcstombs( char * restrict s, const wchar_t * restrict wcs, size_t n );
100 int wctomb( char * s, wchar_t wchar );
102 void _Exit( int status );
103 void exit( int status );
105 char * getenv( const char * name );
106 int system( const char * s );
108 int atexit( void (*func) ( void ) );
109 void * bsearch( const void * key, const void * base, size_t nelem, size_t size, int (*cmp) ( const void * ck, const void * ce) );
110 void qsort( void * base, size_t nelem, size_t size, int (*cmp) ( const void * e1, const void * e2) );
112 #endif /* _STDLIB_H */