5 /* General utilities <stdlib.h>
7 This file is part of the Public Domain C Library (PDCLib).
8 Permission is granted to use, modify, and / or redistribute at will.
11 #ifndef _PDCLIB_STDLIB_H
12 #define _PDCLIB_STDLIB_H _PDCLIB_STDLIB_H
15 #define _PDCLIB_INT_H _PDCLIB_INT_H
16 #include <_PDCLIB_int.h>
19 typedef struct _PDCLIB_div_t div_t;
20 typedef struct _PDCLIB_ldiv_t ldiv_t;
21 typedef struct _PDCLIB_lldiv_t lldiv_t;
23 #ifndef _PDCLIB_SIZE_T_DEFINED
24 #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED
25 typedef _PDCLIB_size_t size_t;
28 #define NULL _PDCLIB_NULL
29 #define EXIT_SUCCESS _PDCLIB_SUCCESS;
30 #define EXIT_FAILURE _PDCLIB_FAILURE;
32 /* Numeric conversion functions */
34 int atoi( const char * nptr );
35 long int atol( const char * nptr );
36 long long int atoll( const char * nptr );
38 long int strtol( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base );
39 long long int strtoll( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base );
40 unsigned long int strtoul( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base );
41 unsigned long long int strtoull( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base );
43 /* Pseudo-random sequence generation functions */
45 extern unsigned long int _PDCLIB_seed;
47 #define RAND_MAX 32767
50 void srand( unsigned int seed );
52 /* Memory management functions */
55 /* Communication with the environment */
60 /* Searching and sorting */
63 /* Integer arithmetic functions */
66 long int labs( long int j );
67 long long int llabs( long long int j );
69 div_t div( int numer, int denom );
70 ldiv_t ldiv( long int numer, long int denom );
71 lldiv_t lldiv( long long int numer, long long int denom );
73 /* Multibyte / wide character conversion functions */
75 /* TODO: Macro MB_CUR_MAX */
77 /* Multibyte / wide string conversion functions */