1 |
39 |
lampret |
/*
|
2 |
|
|
* stdlib.h
|
3 |
|
|
*
|
4 |
|
|
* Definitions for common types, variables, and functions.
|
5 |
|
|
*/
|
6 |
|
|
|
7 |
|
|
#ifndef _STDLIB_H_
|
8 |
|
|
#ifdef __cplusplus
|
9 |
|
|
extern "C" {
|
10 |
|
|
#endif
|
11 |
|
|
#define _STDLIB_H_
|
12 |
|
|
|
13 |
|
|
#include "_ansi.h"
|
14 |
|
|
|
15 |
|
|
#define __need_size_t
|
16 |
|
|
#define __need_wchar_t
|
17 |
|
|
#include <stddef.h>
|
18 |
|
|
|
19 |
|
|
#include <sys/reent.h>
|
20 |
|
|
|
21 |
|
|
typedef struct
|
22 |
|
|
{
|
23 |
|
|
int quot; /* quotient */
|
24 |
|
|
int rem; /* remainder */
|
25 |
|
|
} div_t;
|
26 |
|
|
|
27 |
|
|
typedef struct
|
28 |
|
|
{
|
29 |
|
|
long quot; /* quotient */
|
30 |
|
|
long rem; /* remainder */
|
31 |
|
|
} ldiv_t;
|
32 |
|
|
|
33 |
|
|
#ifndef NULL
|
34 |
56 |
joel |
#define NULL 0
|
35 |
39 |
lampret |
#endif
|
36 |
|
|
|
37 |
|
|
#define EXIT_FAILURE 1
|
38 |
|
|
#define EXIT_SUCCESS 0
|
39 |
|
|
|
40 |
|
|
#define RAND_MAX 0x7fffffff
|
41 |
|
|
|
42 |
56 |
joel |
#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && ! defined(_COMPILING_NEWLIB)
|
43 |
|
|
extern __declspec(dllimport) int __mb_cur_max;
|
44 |
|
|
#else
|
45 |
39 |
lampret |
extern int __mb_cur_max;
|
46 |
56 |
joel |
#endif
|
47 |
|
|
|
48 |
39 |
lampret |
#define MB_CUR_MAX __mb_cur_max
|
49 |
|
|
|
50 |
|
|
_VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
|
51 |
|
|
int _EXFUN(abs,(int));
|
52 |
56 |
joel |
int _EXFUN(atexit,(_VOID (*__func)(_VOID)));
|
53 |
|
|
double _EXFUN(atof,(const char *__nptr));
|
54 |
|
|
#ifndef __STRICT_ANSI__
|
55 |
|
|
float _EXFUN(atoff,(const char *__nptr));
|
56 |
39 |
lampret |
#endif
|
57 |
56 |
joel |
int _EXFUN(atoi,(const char *__nptr));
|
58 |
|
|
long _EXFUN(atol,(const char *__nptr));
|
59 |
|
|
_PTR _EXFUN(bsearch,(const _PTR __key,
|
60 |
|
|
const _PTR __base,
|
61 |
|
|
size_t __nmemb,
|
62 |
|
|
size_t __size,
|
63 |
39 |
lampret |
int _EXFUN((*_compar),(const _PTR, const _PTR))));
|
64 |
56 |
joel |
_PTR _EXFUN(calloc,(size_t __nmemb, size_t __size));
|
65 |
|
|
div_t _EXFUN(div,(int __numer, int __denom));
|
66 |
|
|
_VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((noreturn)));
|
67 |
39 |
lampret |
_VOID _EXFUN(free,(_PTR));
|
68 |
56 |
joel |
char * _EXFUN(getenv,(const char *__string));
|
69 |
|
|
char * _EXFUN(_getenv_r,(struct _reent *, const char *__string));
|
70 |
|
|
char * _EXFUN(_findenv,(_CONST char *, int *));
|
71 |
|
|
char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));
|
72 |
39 |
lampret |
long _EXFUN(labs,(long));
|
73 |
56 |
joel |
ldiv_t _EXFUN(ldiv,(long __numer, long __denom));
|
74 |
|
|
_PTR _EXFUN(malloc,(size_t __size));
|
75 |
39 |
lampret |
int _EXFUN(mblen,(const char *, size_t));
|
76 |
56 |
joel |
int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, int *));
|
77 |
39 |
lampret |
int _EXFUN(mbtowc,(wchar_t *, const char *, size_t));
|
78 |
|
|
int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *, const char *, size_t, int *));
|
79 |
|
|
int _EXFUN(wctomb,(char *, wchar_t));
|
80 |
|
|
int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, int *));
|
81 |
|
|
size_t _EXFUN(mbstowcs,(wchar_t *, const char *, size_t));
|
82 |
|
|
size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *, const char *, size_t, int *));
|
83 |
|
|
size_t _EXFUN(wcstombs,(char *, const wchar_t *, size_t));
|
84 |
|
|
size_t _EXFUN(_wcstombs_r,(struct _reent *, char *, const wchar_t *, size_t, int *));
|
85 |
56 |
joel |
_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR)));
|
86 |
39 |
lampret |
int _EXFUN(rand,(_VOID));
|
87 |
56 |
joel |
_PTR _EXFUN(realloc,(_PTR __r, size_t __size));
|
88 |
|
|
_VOID _EXFUN(srand,(unsigned __seed));
|
89 |
|
|
double _EXFUN(strtod,(const char *__n, char **_end_PTR));
|
90 |
|
|
#ifndef __STRICT_ANSI__
|
91 |
|
|
float _EXFUN(strtodf,(const char *__n, char **_end_PTR));
|
92 |
39 |
lampret |
#endif
|
93 |
56 |
joel |
long _EXFUN(strtol,(const char *__n, char **_end_PTR, int __base));
|
94 |
|
|
unsigned long _EXFUN(strtoul,(const char *_n_PTR, char **_end_PTR, int __base));
|
95 |
|
|
unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *_n_PTR, char **_end_PTR, int __base));
|
96 |
|
|
int _EXFUN(system,(const char *__string));
|
97 |
39 |
lampret |
|
98 |
56 |
joel |
#ifndef __STRICT_ANSI__
|
99 |
39 |
lampret |
_VOID _EXFUN(cfree,(_PTR));
|
100 |
56 |
joel |
int _EXFUN(putenv,(const char *__string));
|
101 |
|
|
int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite));
|
102 |
|
|
int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite));
|
103 |
39 |
lampret |
|
104 |
|
|
char * _EXFUN(gcvt,(double,int,char *));
|
105 |
|
|
char * _EXFUN(gcvtf,(float,int,char *));
|
106 |
|
|
char * _EXFUN(fcvt,(double,int,int *,int *));
|
107 |
|
|
char * _EXFUN(fcvtf,(float,int,int *,int *));
|
108 |
|
|
char * _EXFUN(ecvt,(double,int,int *,int *));
|
109 |
|
|
char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *));
|
110 |
|
|
char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *));
|
111 |
|
|
char * _EXFUN(ecvtf,(float,int,int *,int *));
|
112 |
|
|
char * _EXFUN(dtoa,(double, int, int, int *, int*, char**));
|
113 |
56 |
joel |
int _EXFUN(rand_r,(unsigned *__seed));
|
114 |
39 |
lampret |
|
115 |
|
|
#ifdef __CYGWIN32__
|
116 |
56 |
joel |
char * _EXFUN(realpath,(const char *, char *));
|
117 |
|
|
void _EXFUN(unsetenv,(const char *__string));
|
118 |
|
|
int _EXFUN(random,(_VOID));
|
119 |
|
|
long _EXFUN(srandom,(unsigned __seed));
|
120 |
|
|
char * _EXFUN(ptsname, (int));
|
121 |
|
|
int _EXFUN(grantpt, (int));
|
122 |
|
|
int _EXFUN(unlockpt,(int));
|
123 |
39 |
lampret |
#endif
|
124 |
|
|
|
125 |
56 |
joel |
#endif /* ! __STRICT_ANSI__ */
|
126 |
39 |
lampret |
|
127 |
|
|
char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));
|
128 |
|
|
_PTR _EXFUN(_malloc_r,(struct _reent *, size_t));
|
129 |
|
|
_PTR _EXFUN(_calloc_r,(struct _reent *, size_t, size_t));
|
130 |
|
|
_VOID _EXFUN(_free_r,(struct _reent *, _PTR));
|
131 |
|
|
_PTR _EXFUN(_realloc_r,(struct _reent *, _PTR, size_t));
|
132 |
|
|
_VOID _EXFUN(_mstats_r,(struct _reent *, char *));
|
133 |
|
|
int _EXFUN(_system_r,(struct _reent *, const char *));
|
134 |
|
|
|
135 |
|
|
_VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));
|
136 |
|
|
|
137 |
|
|
#ifdef __cplusplus
|
138 |
|
|
}
|
139 |
|
|
#endif
|
140 |
|
|
#endif /* _STDLIB_H_ */
|