Rev 6099 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6099 | Rev 6536 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * stdlib.h |
2 | * stdlib.h |
3 | * |
3 | * |
4 | * Definitions for common types, variables, and functions. |
4 | * Definitions for common types, variables, and functions. |
5 | */ |
5 | */ |
6 | 6 | ||
7 | #ifndef _STDLIB_H_ |
7 | #ifndef _STDLIB_H_ |
8 | #define _STDLIB_H_ |
8 | #define _STDLIB_H_ |
9 | 9 | ||
10 | #include |
10 | #include |
11 | #include "_ansi.h" |
11 | #include "_ansi.h" |
12 | 12 | ||
13 | #define __need_size_t |
13 | #define __need_size_t |
14 | #define __need_wchar_t |
14 | #define __need_wchar_t |
15 | #define __need_NULL |
15 | #define __need_NULL |
16 | #include |
16 | #include |
17 | 17 | ||
18 | #include |
18 | #include |
19 | #include |
19 | #include |
20 | #include |
20 | #include |
21 | #ifndef __STRICT_ANSI__ |
21 | #ifndef __STRICT_ANSI__ |
22 | #include |
22 | #include |
23 | #endif |
23 | #endif |
24 | 24 | ||
25 | #ifdef __CYGWIN__ |
25 | #ifdef __CYGWIN__ |
26 | #include |
26 | #include |
27 | #endif |
27 | #endif |
28 | 28 | ||
29 | _BEGIN_STD_C |
29 | _BEGIN_STD_C |
30 | 30 | ||
31 | typedef struct |
31 | typedef struct |
32 | { |
32 | { |
33 | int quot; /* quotient */ |
33 | int quot; /* quotient */ |
34 | int rem; /* remainder */ |
34 | int rem; /* remainder */ |
35 | } div_t; |
35 | } div_t; |
36 | 36 | ||
37 | typedef struct |
37 | typedef struct |
38 | { |
38 | { |
39 | long quot; /* quotient */ |
39 | long quot; /* quotient */ |
40 | long rem; /* remainder */ |
40 | long rem; /* remainder */ |
41 | } ldiv_t; |
41 | } ldiv_t; |
42 | 42 | ||
43 | #if !defined(__STRICT_ANSI__) || \ |
- | |
44 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ |
- | |
45 | (defined(__cplusplus) && __cplusplus >= 201103L) |
43 | #if __ISO_C_VISIBLE >= 1999 |
46 | typedef struct |
44 | typedef struct |
47 | { |
45 | { |
48 | long long int quot; /* quotient */ |
46 | long long int quot; /* quotient */ |
49 | long long int rem; /* remainder */ |
47 | long long int rem; /* remainder */ |
50 | } lldiv_t; |
48 | } lldiv_t; |
51 | #endif |
49 | #endif |
52 | 50 | ||
53 | #ifndef __compar_fn_t_defined |
51 | #ifndef __compar_fn_t_defined |
54 | #define __compar_fn_t_defined |
52 | #define __compar_fn_t_defined |
55 | typedef int (*__compar_fn_t) (const _PTR, const _PTR); |
53 | typedef int (*__compar_fn_t) (const _PTR, const _PTR); |
56 | #endif |
54 | #endif |
57 | 55 | ||
58 | #define EXIT_FAILURE 1 |
56 | #define EXIT_FAILURE 1 |
59 | #define EXIT_SUCCESS 0 |
57 | #define EXIT_SUCCESS 0 |
60 | 58 | ||
61 | #define RAND_MAX __RAND_MAX |
59 | #define RAND_MAX __RAND_MAX |
62 | 60 | ||
63 | int _EXFUN(__locale_mb_cur_max,(_VOID)); |
61 | int _EXFUN(__locale_mb_cur_max,(_VOID)); |
64 | 62 | ||
65 | #define MB_CUR_MAX __locale_mb_cur_max() |
63 | #define MB_CUR_MAX __locale_mb_cur_max() |
66 | 64 | ||
67 | _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((__noreturn__))); |
65 | _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((__noreturn__))); |
68 | int _EXFUN(abs,(int)); |
66 | int _EXFUN(abs,(int)); |
- | 67 | #if __BSD_VISIBLE |
|
- | 68 | __uint32_t _EXFUN(arc4random, (void)); |
|
- | 69 | __uint32_t _EXFUN(arc4random_uniform, (__uint32_t)); |
|
- | 70 | void _EXFUN(arc4random_buf, (void *, size_t)); |
|
- | 71 | #endif |
|
69 | int _EXFUN(atexit,(_VOID (*__func)(_VOID))); |
72 | int _EXFUN(atexit,(_VOID (*__func)(_VOID))); |
70 | double _EXFUN(atof,(const char *__nptr)); |
73 | double _EXFUN(atof,(const char *__nptr)); |
71 | #ifndef __STRICT_ANSI__ |
74 | #if __MISC_VISIBLE |
72 | float _EXFUN(atoff,(const char *__nptr)); |
75 | float _EXFUN(atoff,(const char *__nptr)); |
73 | #endif |
76 | #endif |
74 | int _EXFUN(atoi,(const char *__nptr)); |
77 | int _EXFUN(atoi,(const char *__nptr)); |
75 | int _EXFUN(_atoi_r,(struct _reent *, const char *__nptr)); |
78 | int _EXFUN(_atoi_r,(struct _reent *, const char *__nptr)); |
76 | long _EXFUN(atol,(const char *__nptr)); |
79 | long _EXFUN(atol,(const char *__nptr)); |
77 | long _EXFUN(_atol_r,(struct _reent *, const char *__nptr)); |
80 | long _EXFUN(_atol_r,(struct _reent *, const char *__nptr)); |
78 | _PTR _EXFUN(bsearch,(const _PTR __key, |
81 | _PTR _EXFUN(bsearch,(const _PTR __key, |
79 | const _PTR __base, |
82 | const _PTR __base, |
80 | size_t __nmemb, |
83 | size_t __nmemb, |
81 | size_t __size, |
84 | size_t __size, |
82 | __compar_fn_t _compar)); |
85 | __compar_fn_t _compar)); |
83 | _PTR _EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size)); |
86 | _PTR _EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size)); |
84 | div_t _EXFUN(div,(int __numer, int __denom)); |
87 | div_t _EXFUN(div,(int __numer, int __denom)); |
85 | _VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((__noreturn__))); |
88 | _VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((__noreturn__))); |
86 | _VOID _EXFUN_NOTHROW(free,(_PTR)); |
89 | _VOID _EXFUN_NOTHROW(free,(_PTR)); |
87 | char * _EXFUN(getenv,(const char *__string)); |
90 | char * _EXFUN(getenv,(const char *__string)); |
88 | char * _EXFUN(_getenv_r,(struct _reent *, const char *__string)); |
91 | char * _EXFUN(_getenv_r,(struct _reent *, const char *__string)); |
89 | char * _EXFUN(_findenv,(_CONST char *, int *)); |
92 | char * _EXFUN(_findenv,(_CONST char *, int *)); |
90 | char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *)); |
93 | char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *)); |
91 | #ifndef __STRICT_ANSI__ |
94 | #if __POSIX_VISIBLE >= 200809 |
92 | extern char *suboptarg; /* getsubopt(3) external variable */ |
95 | extern char *suboptarg; /* getsubopt(3) external variable */ |
93 | int _EXFUN(getsubopt,(char **, char * const *, char **)); |
96 | int _EXFUN(getsubopt,(char **, char * const *, char **)); |
94 | #endif |
97 | #endif |
95 | long _EXFUN(labs,(long)); |
98 | long _EXFUN(labs,(long)); |
96 | ldiv_t _EXFUN(ldiv,(long __numer, long __denom)); |
99 | ldiv_t _EXFUN(ldiv,(long __numer, long __denom)); |
97 | _PTR _EXFUN_NOTHROW(malloc,(size_t __size)); |
100 | _PTR _EXFUN_NOTHROW(malloc,(size_t __size)); |
98 | int _EXFUN(mblen,(const char *, size_t)); |
101 | int _EXFUN(mblen,(const char *, size_t)); |
99 | int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *)); |
102 | int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *)); |
100 | int _EXFUN(mbtowc,(wchar_t *__restrict, const char *__restrict, size_t)); |
103 | int _EXFUN(mbtowc,(wchar_t *__restrict, const char *__restrict, size_t)); |
101 | int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); |
104 | int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); |
102 | int _EXFUN(wctomb,(char *, wchar_t)); |
105 | int _EXFUN(wctomb,(char *, wchar_t)); |
103 | int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *)); |
106 | int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *)); |
104 | size_t _EXFUN(mbstowcs,(wchar_t *__restrict, const char *__restrict, size_t)); |
107 | size_t _EXFUN(mbstowcs,(wchar_t *__restrict, const char *__restrict, size_t)); |
105 | size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); |
108 | size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); |
106 | size_t _EXFUN(wcstombs,(char *__restrict, const wchar_t *__restrict, size_t)); |
109 | size_t _EXFUN(wcstombs,(char *__restrict, const wchar_t *__restrict, size_t)); |
107 | size_t _EXFUN(_wcstombs_r,(struct _reent *, char *__restrict, const wchar_t *__restrict, size_t, _mbstate_t *)); |
110 | size_t _EXFUN(_wcstombs_r,(struct _reent *, char *__restrict, const wchar_t *__restrict, size_t, _mbstate_t *)); |
108 | #ifndef __STRICT_ANSI__ |
- | |
109 | #ifndef _REENT_ONLY |
111 | #ifndef _REENT_ONLY |
- | 112 | #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 |
|
110 | char * _EXFUN(mkdtemp,(char *)); |
113 | char * _EXFUN(mkdtemp,(char *)); |
- | 114 | #endif |
|
- | 115 | #if __GNU_VISIBLE |
|
111 | int _EXFUN(mkostemp,(char *, int)); |
116 | int _EXFUN(mkostemp,(char *, int)); |
112 | int _EXFUN(mkostemps,(char *, int, int)); |
117 | int _EXFUN(mkostemps,(char *, int, int)); |
- | 118 | #endif |
|
- | 119 | #if __MISC_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 4 |
|
113 | int _EXFUN(mkstemp,(char *)); |
120 | int _EXFUN(mkstemp,(char *)); |
- | 121 | #endif |
|
- | 122 | #if __MISC_VISIBLE |
|
114 | int _EXFUN(mkstemps,(char *, int)); |
123 | int _EXFUN(mkstemps,(char *, int)); |
- | 124 | #endif |
|
- | 125 | #if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112) |
|
115 | char * _EXFUN(mktemp,(char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead")))); |
126 | char * _EXFUN(mktemp,(char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead")))); |
116 | #endif |
127 | #endif |
- | 128 | #endif /* !_REENT_ONLY */ |
|
117 | char * _EXFUN(_mkdtemp_r, (struct _reent *, char *)); |
129 | char * _EXFUN(_mkdtemp_r, (struct _reent *, char *)); |
118 | int _EXFUN(_mkostemp_r, (struct _reent *, char *, int)); |
130 | int _EXFUN(_mkostemp_r, (struct _reent *, char *, int)); |
119 | int _EXFUN(_mkostemps_r, (struct _reent *, char *, int, int)); |
131 | int _EXFUN(_mkostemps_r, (struct _reent *, char *, int, int)); |
120 | int _EXFUN(_mkstemp_r, (struct _reent *, char *)); |
132 | int _EXFUN(_mkstemp_r, (struct _reent *, char *)); |
121 | int _EXFUN(_mkstemps_r, (struct _reent *, char *, int)); |
133 | int _EXFUN(_mkstemps_r, (struct _reent *, char *, int)); |
122 | char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead")))); |
134 | char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead")))); |
123 | #endif |
- | |
124 | _VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar)); |
135 | _VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar)); |
125 | int _EXFUN(rand,(_VOID)); |
136 | int _EXFUN(rand,(_VOID)); |
126 | _PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size)); |
137 | _PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size)); |
127 | #ifndef __STRICT_ANSI__ |
138 | #if __BSD_VISIBLE |
128 | _PTR _EXFUN(reallocf,(_PTR __r, size_t __size)); |
139 | _PTR _EXFUN(reallocf,(_PTR __r, size_t __size)); |
- | 140 | #endif |
|
- | 141 | #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 |
|
129 | char * _EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path)); |
142 | char * _EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path)); |
- | 143 | #endif |
|
- | 144 | #if __BSD_VISIBLE |
|
130 | int _EXFUN(rpmatch, (const char *response)); |
145 | int _EXFUN(rpmatch, (const char *response)); |
131 | #endif |
146 | #endif |
132 | _VOID _EXFUN(srand,(unsigned __seed)); |
147 | _VOID _EXFUN(srand,(unsigned __seed)); |
133 | double _EXFUN(strtod,(const char *__restrict __n, char **__restrict __end_PTR)); |
148 | double _EXFUN(strtod,(const char *__restrict __n, char **__restrict __end_PTR)); |
134 | double _EXFUN(_strtod_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR)); |
149 | double _EXFUN(_strtod_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR)); |
135 | #if !defined(__STRICT_ANSI__) || \ |
150 | #if __ISO_C_VISIBLE >= 1999 |
136 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ |
- | |
137 | (defined(__cplusplus) && __cplusplus >= 201103L) |
- | |
138 | float _EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR)); |
151 | float _EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR)); |
139 | #endif |
152 | #endif |
140 | #ifndef __STRICT_ANSI__ |
153 | #if __MISC_VISIBLE |
141 | /* the following strtodf interface is deprecated...use strtof instead */ |
154 | /* the following strtodf interface is deprecated...use strtof instead */ |
142 | # ifndef strtodf |
155 | # ifndef strtodf |
143 | # define strtodf strtof |
156 | # define strtodf strtof |
144 | # endif |
157 | # endif |
145 | #endif |
158 | #endif |
146 | long _EXFUN(strtol,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
159 | long _EXFUN(strtol,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
147 | long _EXFUN(_strtol_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
160 | long _EXFUN(_strtol_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
148 | unsigned long _EXFUN(strtoul,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
161 | unsigned long _EXFUN(strtoul,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
149 | unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
162 | unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
150 | 163 | ||
151 | int _EXFUN(system,(const char *__string)); |
164 | int _EXFUN(system,(const char *__string)); |
152 | 165 | ||
153 | #ifndef __STRICT_ANSI__ |
166 | #if __SVID_VISIBLE || __XSI_VISIBLE >= 4 |
154 | long _EXFUN(a64l,(const char *__input)); |
167 | long _EXFUN(a64l,(const char *__input)); |
155 | char * _EXFUN(l64a,(long __input)); |
168 | char * _EXFUN(l64a,(long __input)); |
156 | char * _EXFUN(_l64a_r,(struct _reent *,long __input)); |
169 | char * _EXFUN(_l64a_r,(struct _reent *,long __input)); |
- | 170 | #endif |
|
- | 171 | #if __MISC_VISIBLE |
|
157 | int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg)); |
172 | int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg)); |
158 | #endif /* ! __STRICT_ANSI__ */ |
173 | #endif |
159 | #if !defined(__STRICT_ANSI__) || \ |
174 | #if __ISO_C_VISIBLE >= 1999 |
160 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ |
- | |
161 | (defined(__cplusplus) && __cplusplus >= 201103L) |
- | |
162 | _VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((__noreturn__))); |
175 | _VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((__noreturn__))); |
163 | #endif |
176 | #endif |
164 | #ifndef __STRICT_ANSI__ |
177 | #if __SVID_VISIBLE || __XSI_VISIBLE |
165 | int _EXFUN(putenv,(char *__string)); |
178 | int _EXFUN(putenv,(char *__string)); |
- | 179 | #endif |
|
166 | int _EXFUN(_putenv_r,(struct _reent *, char *__string)); |
180 | int _EXFUN(_putenv_r,(struct _reent *, char *__string)); |
167 | _PTR _EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t)); |
181 | _PTR _EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t)); |
- | 182 | #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 |
|
168 | int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite)); |
183 | int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite)); |
- | 184 | #endif |
|
169 | int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite)); |
185 | int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite)); |
- | 186 | ||
170 | 187 | #if __XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112 |
|
171 | char * _EXFUN(gcvt,(double,int,char *)); |
188 | char * _EXFUN(gcvt,(double,int,char *)); |
172 | char * _EXFUN(gcvtf,(float,int,char *)); |
189 | char * _EXFUN(gcvtf,(float,int,char *)); |
173 | char * _EXFUN(fcvt,(double,int,int *,int *)); |
190 | char * _EXFUN(fcvt,(double,int,int *,int *)); |
174 | char * _EXFUN(fcvtf,(float,int,int *,int *)); |
191 | char * _EXFUN(fcvtf,(float,int,int *,int *)); |
175 | char * _EXFUN(ecvt,(double,int,int *,int *)); |
192 | char * _EXFUN(ecvt,(double,int,int *,int *)); |
176 | char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *)); |
193 | char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *)); |
177 | char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *)); |
194 | char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *)); |
178 | char * _EXFUN(ecvtf,(float,int,int *,int *)); |
195 | char * _EXFUN(ecvtf,(float,int,int *,int *)); |
179 | char * _EXFUN(dtoa,(double, int, int, int *, int*, char**)); |
- | |
180 | #endif |
196 | #endif |
181 | char * _EXFUN(__itoa,(int, char *, int)); |
197 | char * _EXFUN(__itoa,(int, char *, int)); |
182 | char * _EXFUN(__utoa,(unsigned, char *, int)); |
198 | char * _EXFUN(__utoa,(unsigned, char *, int)); |
183 | #ifndef __STRICT_ANSI__ |
199 | #if __MISC_VISIBLE |
184 | char * _EXFUN(itoa,(int, char *, int)); |
200 | char * _EXFUN(itoa,(int, char *, int)); |
185 | char * _EXFUN(utoa,(unsigned, char *, int)); |
201 | char * _EXFUN(utoa,(unsigned, char *, int)); |
- | 202 | #endif |
|
- | 203 | #if __POSIX_VISIBLE |
|
186 | int _EXFUN(rand_r,(unsigned *__seed)); |
204 | int _EXFUN(rand_r,(unsigned *__seed)); |
- | 205 | #endif |
|
- | 206 | ||
187 | 207 | #if __SVID_VISIBLE || __XSI_VISIBLE |
|
188 | double _EXFUN(drand48,(_VOID)); |
208 | double _EXFUN(drand48,(_VOID)); |
189 | double _EXFUN(_drand48_r,(struct _reent *)); |
209 | double _EXFUN(_drand48_r,(struct _reent *)); |
190 | double _EXFUN(erand48,(unsigned short [3])); |
210 | double _EXFUN(erand48,(unsigned short [3])); |
191 | double _EXFUN(_erand48_r,(struct _reent *, unsigned short [3])); |
211 | double _EXFUN(_erand48_r,(struct _reent *, unsigned short [3])); |
192 | long _EXFUN(jrand48,(unsigned short [3])); |
212 | long _EXFUN(jrand48,(unsigned short [3])); |
193 | long _EXFUN(_jrand48_r,(struct _reent *, unsigned short [3])); |
213 | long _EXFUN(_jrand48_r,(struct _reent *, unsigned short [3])); |
194 | _VOID _EXFUN(lcong48,(unsigned short [7])); |
214 | _VOID _EXFUN(lcong48,(unsigned short [7])); |
195 | _VOID _EXFUN(_lcong48_r,(struct _reent *, unsigned short [7])); |
215 | _VOID _EXFUN(_lcong48_r,(struct _reent *, unsigned short [7])); |
196 | long _EXFUN(lrand48,(_VOID)); |
216 | long _EXFUN(lrand48,(_VOID)); |
197 | long _EXFUN(_lrand48_r,(struct _reent *)); |
217 | long _EXFUN(_lrand48_r,(struct _reent *)); |
198 | long _EXFUN(mrand48,(_VOID)); |
218 | long _EXFUN(mrand48,(_VOID)); |
199 | long _EXFUN(_mrand48_r,(struct _reent *)); |
219 | long _EXFUN(_mrand48_r,(struct _reent *)); |
200 | long _EXFUN(nrand48,(unsigned short [3])); |
220 | long _EXFUN(nrand48,(unsigned short [3])); |
201 | long _EXFUN(_nrand48_r,(struct _reent *, unsigned short [3])); |
221 | long _EXFUN(_nrand48_r,(struct _reent *, unsigned short [3])); |
202 | unsigned short * |
222 | unsigned short * |
203 | _EXFUN(seed48,(unsigned short [3])); |
223 | _EXFUN(seed48,(unsigned short [3])); |
204 | unsigned short * |
224 | unsigned short * |
205 | _EXFUN(_seed48_r,(struct _reent *, unsigned short [3])); |
225 | _EXFUN(_seed48_r,(struct _reent *, unsigned short [3])); |
206 | _VOID _EXFUN(srand48,(long)); |
226 | _VOID _EXFUN(srand48,(long)); |
207 | _VOID _EXFUN(_srand48_r,(struct _reent *, long)); |
227 | _VOID _EXFUN(_srand48_r,(struct _reent *, long)); |
208 | #endif /* ! __STRICT_ANSI__ */ |
228 | #endif /* __SVID_VISIBLE || __XSI_VISIBLE */ |
209 | #if !defined(__STRICT_ANSI__) || \ |
229 | #if __SVID_VISIBLE || __XSI_VISIBLE >= 4 || __BSD_VISIBLE |
210 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ |
230 | char * _EXFUN(initstate,(unsigned, char *, size_t)); |
- | 231 | long _EXFUN(random,(_VOID)); |
|
- | 232 | char * _EXFUN(setstate,(char *)); |
|
- | 233 | _VOID _EXFUN(srandom,(unsigned)); |
|
- | 234 | #endif |
|
211 | (defined(__cplusplus) && __cplusplus >= 201103L) |
235 | #if __ISO_C_VISIBLE >= 1999 |
212 | long long _EXFUN(atoll,(const char *__nptr)); |
236 | long long _EXFUN(atoll,(const char *__nptr)); |
213 | #endif |
237 | #endif |
214 | #ifndef __STRICT_ANSI__ |
- | |
215 | long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr)); |
238 | long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr)); |
216 | #endif /* ! __STRICT_ANSI__ */ |
- | |
217 | #if !defined(__STRICT_ANSI__) || \ |
239 | #if __ISO_C_VISIBLE >= 1999 |
218 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ |
- | |
219 | (defined(__cplusplus) && __cplusplus >= 201103L) |
- | |
220 | long long _EXFUN(llabs,(long long)); |
240 | long long _EXFUN(llabs,(long long)); |
221 | lldiv_t _EXFUN(lldiv,(long long __numer, long long __denom)); |
241 | lldiv_t _EXFUN(lldiv,(long long __numer, long long __denom)); |
222 | long long _EXFUN(strtoll,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
242 | long long _EXFUN(strtoll,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
223 | #endif |
243 | #endif |
224 | #ifndef __STRICT_ANSI__ |
- | |
225 | long long _EXFUN(_strtoll_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
244 | long long _EXFUN(_strtoll_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
226 | #endif /* ! __STRICT_ANSI__ */ |
- | |
227 | #if !defined(__STRICT_ANSI__) || \ |
245 | #if __ISO_C_VISIBLE >= 1999 |
228 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ |
- | |
229 | (defined(__cplusplus) && __cplusplus >= 201103L) |
- | |
230 | unsigned long long _EXFUN(strtoull,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
246 | unsigned long long _EXFUN(strtoull,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
231 | #endif |
247 | #endif |
232 | #ifndef __STRICT_ANSI__ |
- | |
233 | unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
248 | unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); |
234 | 249 | ||
235 | #ifndef __CYGWIN__ |
250 | #ifndef __CYGWIN__ |
- | 251 | #if __MISC_VISIBLE |
|
236 | _VOID _EXFUN(cfree,(_PTR)); |
252 | _VOID _EXFUN(cfree,(_PTR)); |
- | 253 | #endif |
|
- | 254 | #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 |
|
237 | int _EXFUN(unsetenv,(const char *__string)); |
255 | int _EXFUN(unsetenv,(const char *__string)); |
238 | int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); |
- | |
239 | #endif |
256 | #endif |
- | 257 | int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); |
|
- | 258 | #endif /* !__CYGWIN__ */ |
|
240 | 259 | ||
241 | #ifdef __rtems__ |
260 | #if __POSIX_VISIBLE >= 200112 |
242 | int _EXFUN(posix_memalign,(void **, size_t, size_t)); |
261 | int _EXFUN(__nonnull (1) posix_memalign,(void **, size_t, size_t)); |
243 | #endif |
- | |
244 | - | ||
245 | #endif /* ! __STRICT_ANSI__ */ |
262 | #endif |
246 | 263 | ||
247 | char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**)); |
264 | char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**)); |
248 | #ifndef __CYGWIN__ |
265 | #ifndef __CYGWIN__ |
249 | _PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t)); |
266 | _PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t)); |
250 | _PTR _EXFUN_NOTHROW(_calloc_r,(struct _reent *, size_t, size_t)); |
267 | _PTR _EXFUN_NOTHROW(_calloc_r,(struct _reent *, size_t, size_t)); |
251 | _VOID _EXFUN_NOTHROW(_free_r,(struct _reent *, _PTR)); |
268 | _VOID _EXFUN_NOTHROW(_free_r,(struct _reent *, _PTR)); |
252 | _PTR _EXFUN_NOTHROW(_realloc_r,(struct _reent *, _PTR, size_t)); |
269 | _PTR _EXFUN_NOTHROW(_realloc_r,(struct _reent *, _PTR, size_t)); |
253 | _VOID _EXFUN(_mstats_r,(struct _reent *, char *)); |
270 | _VOID _EXFUN(_mstats_r,(struct _reent *, char *)); |
254 | #endif |
271 | #endif |
255 | int _EXFUN(_system_r,(struct _reent *, const char *)); |
272 | int _EXFUN(_system_r,(struct _reent *, const char *)); |
256 | 273 | ||
257 | _VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *)); |
274 | _VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *)); |
258 | 275 | ||
259 | /* There are two common qsort_r variants. If you request |
276 | /* There are two common qsort_r variants. If you request |
260 | _BSD_SOURCE, you get the BSD version; otherwise you get the GNU |
277 | _BSD_SOURCE, you get the BSD version; otherwise you get the GNU |
261 | version. We want that #undef qsort_r will still let you |
278 | version. We want that #undef qsort_r will still let you |
262 | invoke the underlying function, but that requires gcc support. */ |
279 | invoke the underlying function, but that requires gcc support. */ |
- | 280 | #if __GNU_VISIBLE |
|
- | 281 | _VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, int (*_compar)(const _PTR, const _PTR, _PTR), _PTR __thunk)); |
|
263 | #ifdef _BSD_SOURCE |
282 | #elif __BSD_VISIBLE |
264 | # ifdef __GNUC__ |
283 | # ifdef __GNUC__ |
265 | _VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))) |
284 | _VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))) |
266 | __asm__ (__ASMNAME ("__bsd_qsort_r")); |
285 | __asm__ (__ASMNAME ("__bsd_qsort_r")); |
267 | # else |
286 | # else |
268 | _VOID _EXFUN(__bsd_qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))); |
287 | _VOID _EXFUN(__bsd_qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))); |
269 | # define qsort_r __bsd_qsort_r |
288 | # define qsort_r __bsd_qsort_r |
270 | # endif |
289 | # endif |
271 | #elif __GNU_VISIBLE |
- | |
272 | _VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, int (*_compar)(const _PTR, const _PTR, _PTR), _PTR __thunk)); |
- | |
273 | #endif |
290 | #endif |
274 | 291 | ||
275 | /* On platforms where long double equals double. */ |
292 | /* On platforms where long double equals double. */ |
276 | #ifdef _HAVE_LONG_DOUBLE |
293 | #ifdef _HAVE_LONG_DOUBLE |
277 | extern long double _strtold_r (struct _reent *, const char *__restrict, char **__restrict); |
294 | extern long double _strtold_r (struct _reent *, const char *__restrict, char **__restrict); |
278 | #if !defined(__STRICT_ANSI__) || \ |
295 | #if __ISO_C_VISIBLE >= 1999 |
279 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ |
- | |
280 | (defined(__cplusplus) && __cplusplus >= 201103L) |
- | |
281 | extern long double strtold (const char *__restrict, char **__restrict); |
296 | extern long double strtold (const char *__restrict, char **__restrict); |
282 | #endif |
297 | #endif |
283 | #endif /* _HAVE_LONG_DOUBLE */ |
298 | #endif /* _HAVE_LONG_DOUBLE */ |
284 | 299 | ||
285 | /* |
300 | /* |
286 | * If we're in a mode greater than C99, expose C11 functions. |
301 | * If we're in a mode greater than C99, expose C11 functions. |
287 | */ |
302 | */ |
288 | #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L |
303 | #if __ISO_C_VISIBLE >= 2011 |
289 | void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) |
304 | void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) |
290 | __alloc_size(2); |
305 | __alloc_size(2); |
291 | int at_quick_exit(void (*)(void)); |
306 | int at_quick_exit(void (*)(void)); |
292 | _Noreturn void |
307 | _Noreturn void |
293 | quick_exit(int); |
308 | quick_exit(int); |
294 | #endif /* __ISO_C_VISIBLE >= 2011 */ |
309 | #endif /* __ISO_C_VISIBLE >= 2011 */ |
295 | 310 | ||
296 | _END_STD_C |
311 | _END_STD_C |
297 | 312 | ||
298 | #endif /* _STDLIB_H_ */ |
313 | #endif /* _STDLIB_H_ */>> |