]>
Commit | Line | Data |
---|---|---|
6796bc80 | 1 | #ifndef _STDLIB_H |
7ef90c15 UD |
2 | |
3 | #ifdef __need_malloc_and_calloc | |
4 | #define __Need_M_And_C | |
5 | #endif | |
6 | ||
31341567 UD |
7 | #ifndef _ISOMAC |
8 | # include <stddef.h> | |
9 | #endif | |
28f540f4 | 10 | #include <stdlib/stdlib.h> |
bdbf022d UD |
11 | |
12 | /* Now define the internal interfaces. */ | |
31341567 UD |
13 | #if !defined __Need_M_And_C && !defined _ISOMAC |
14 | # include <sys/stat.h> | |
37ba7d66 | 15 | |
7735afa2 UD |
16 | __BEGIN_DECLS |
17 | ||
da4cfe38 RM |
18 | extern __typeof (strtol_l) __strtol_l; |
19 | extern __typeof (strtoul_l) __strtoul_l; | |
20 | extern __typeof (strtoll_l) __strtoll_l; | |
21 | extern __typeof (strtoull_l) __strtoull_l; | |
22 | extern __typeof (strtod_l) __strtod_l; | |
23 | extern __typeof (strtof_l) __strtof_l; | |
24 | extern __typeof (strtold_l) __strtold_l; | |
773e305e RM |
25 | libc_hidden_proto (__strtol_l) |
26 | libc_hidden_proto (__strtoul_l) | |
27 | libc_hidden_proto (__strtoll_l) | |
28 | libc_hidden_proto (__strtoull_l) | |
29 | libc_hidden_proto (__strtod_l) | |
30 | libc_hidden_proto (__strtof_l) | |
31 | libc_hidden_proto (__strtold_l) | |
da4cfe38 | 32 | |
a757607d | 33 | libc_hidden_proto (exit) |
509d1b68 | 34 | libc_hidden_proto (abort) |
a757607d | 35 | libc_hidden_proto (getenv) |
84b3fd84 FW |
36 | extern __typeof (secure_getenv) __libc_secure_getenv; |
37 | libc_hidden_proto (__libc_secure_getenv) | |
a757607d | 38 | libc_hidden_proto (bsearch) |
284128f6 | 39 | libc_hidden_proto (qsort) |
e458144c | 40 | libc_hidden_proto (qsort_r) |
c41f555e | 41 | libc_hidden_proto (lrand48_r) |
e2ec9b4d | 42 | libc_hidden_proto (wctomb) |
37ba7d66 | 43 | |
344be96a | 44 | extern long int __random (void); |
c19559b0 | 45 | extern void __srandom (unsigned int __seed); |
6484a17f | 46 | extern char *__initstate (unsigned int __seed, char *__statebuf, |
c19559b0 | 47 | size_t __statelen); |
6484a17f | 48 | extern char *__setstate (char *__statebuf); |
c19559b0 UD |
49 | extern int __random_r (struct random_data *__buf, int32_t *__result); |
50 | extern int __srandom_r (unsigned int __seed, struct random_data *__buf); | |
d653aacd | 51 | extern int __initstate_r (unsigned int __seed, char *__statebuf, |
c19559b0 | 52 | size_t __statelen, struct random_data *__buf); |
d653aacd | 53 | extern int __setstate_r (char *__statebuf, struct random_data *__buf); |
c19559b0 | 54 | extern int __rand_r (unsigned int *__seed); |
fe559c5e | 55 | extern int __erand48_r (unsigned short int __xsubi[3], |
c19559b0 | 56 | struct drand48_data *__buffer, double *__result); |
fe559c5e UD |
57 | extern int __nrand48_r (unsigned short int __xsubi[3], |
58 | struct drand48_data *__buffer, | |
c19559b0 | 59 | long int *__result); |
fe559c5e UD |
60 | extern int __jrand48_r (unsigned short int __xsubi[3], |
61 | struct drand48_data *__buffer, | |
c19559b0 | 62 | long int *__result); |
fe559c5e | 63 | extern int __srand48_r (long int __seedval, |
c19559b0 | 64 | struct drand48_data *__buffer); |
fe559c5e | 65 | extern int __seed48_r (unsigned short int __seed16v[3], |
c19559b0 | 66 | struct drand48_data *__buffer); |
fe559c5e | 67 | extern int __lcong48_r (unsigned short int __param[7], |
c19559b0 | 68 | struct drand48_data *__buffer); |
bdbf022d UD |
69 | |
70 | /* Internal function to compute next state of the generator. */ | |
fe559c5e | 71 | extern int __drand48_iterate (unsigned short int __xsubi[3], |
c19559b0 | 72 | struct drand48_data *__buffer); |
bdbf022d | 73 | |
aa32f798 UD |
74 | /* Global state for non-reentrant functions. Defined in drand48-iter.c. */ |
75 | extern struct drand48_data __libc_drand48_data attribute_hidden; | |
76 | ||
a784e502 UD |
77 | extern int __setenv (const char *__name, const char *__value, int __replace); |
78 | extern int __unsetenv (const char *__name); | |
c19559b0 | 79 | extern int __clearenv (void); |
cfa8054f | 80 | extern char *__mktemp (char *__template) __THROW __nonnull ((1)); |
a784e502 UD |
81 | extern char *__canonicalize_file_name (const char *__name); |
82 | extern char *__realpath (const char *__name, char *__resolved); | |
c19559b0 | 83 | extern int __ptsname_r (int __fd, char *__buf, size_t __buflen); |
63de5ef7 | 84 | # ifndef _ISOMAC |
aa989023 UD |
85 | extern int __ptsname_internal (int fd, char *buf, size_t buflen, |
86 | struct stat64 *stp); | |
63de5ef7 | 87 | # endif |
c19559b0 | 88 | extern int __getpt (void); |
0101a56f | 89 | extern int __posix_openpt (int __oflag); |
de4a40d0 UD |
90 | |
91 | extern int __add_to_environ (const char *name, const char *value, | |
92 | const char *combines, int replace); | |
061d137b UD |
93 | |
94 | extern void _quicksort (void *const pbase, size_t total_elems, | |
e458144c | 95 | size_t size, __compar_d_fn_t cmp, void *arg); |
061d137b | 96 | |
bd7f30a9 AJ |
97 | extern int __on_exit (void (*__func) (int __status, void *__arg), void *__arg); |
98 | ||
a6a478e9 | 99 | extern int __cxa_atexit (void (*func) (void *), void *arg, void *d); |
6b87a564 UD |
100 | extern int __cxa_atexit_internal (void (*func) (void *), void *arg, void *d) |
101 | attribute_hidden; | |
a6a478e9 | 102 | |
ba384f6e SP |
103 | extern int __cxa_thread_atexit_impl (void (*func) (void *), void *arg, |
104 | void *d); | |
105 | extern void __call_tls_dtors (void); | |
106 | libc_hidden_proto (__call_tls_dtors); | |
107 | ||
03bac9ac AJ |
108 | extern void __cxa_finalize (void *d); |
109 | ||
5bcbe69f AJ |
110 | extern int __posix_memalign (void **memptr, size_t alignment, size_t size); |
111 | ||
aed283dd UD |
112 | extern void *__libc_memalign (size_t alignment, size_t size) |
113 | __attribute_malloc__; | |
0758ea0c | 114 | |
03bac9ac AJ |
115 | extern int __libc_system (const char *line); |
116 | ||
9b2e9577 | 117 | |
a784e502 | 118 | extern double __strtod_internal (const char *__restrict __nptr, |
9b2e9577 UD |
119 | char **__restrict __endptr, int __group) |
120 | __THROW __nonnull ((1)) __wur; | |
a784e502 | 121 | extern float __strtof_internal (const char *__restrict __nptr, |
9b2e9577 UD |
122 | char **__restrict __endptr, int __group) |
123 | __THROW __nonnull ((1)) __wur; | |
a784e502 | 124 | extern long double __strtold_internal (const char *__restrict __nptr, |
9b2e9577 UD |
125 | char **__restrict __endptr, |
126 | int __group) | |
127 | __THROW __nonnull ((1)) __wur; | |
a784e502 | 128 | extern long int __strtol_internal (const char *__restrict __nptr, |
9b2e9577 UD |
129 | char **__restrict __endptr, |
130 | int __base, int __group) | |
131 | __THROW __nonnull ((1)) __wur; | |
a784e502 | 132 | extern unsigned long int __strtoul_internal (const char *__restrict __nptr, |
9b2e9577 UD |
133 | char **__restrict __endptr, |
134 | int __base, int __group) | |
135 | __THROW __nonnull ((1)) __wur; | |
136 | __extension__ | |
a784e502 | 137 | extern long long int __strtoll_internal (const char *__restrict __nptr, |
9b2e9577 UD |
138 | char **__restrict __endptr, |
139 | int __base, int __group) | |
140 | __THROW __nonnull ((1)) __wur; | |
141 | __extension__ | |
a784e502 | 142 | extern unsigned long long int __strtoull_internal (const char * |
9b2e9577 UD |
143 | __restrict __nptr, |
144 | char **__restrict __endptr, | |
145 | int __base, int __group) | |
146 | __THROW __nonnull ((1)) __wur; | |
147 | libc_hidden_proto (__strtof_internal) | |
148 | libc_hidden_proto (__strtod_internal) | |
149 | libc_hidden_proto (__strtold_internal) | |
150 | libc_hidden_proto (__strtol_internal) | |
151 | libc_hidden_proto (__strtoll_internal) | |
152 | libc_hidden_proto (__strtoul_internal) | |
153 | libc_hidden_proto (__strtoull_internal) | |
154 | ||
a784e502 | 155 | extern double ____strtod_l_internal (const char *__restrict __nptr, |
bf1fd594 | 156 | char **__restrict __endptr, int __group, |
2ef4aac7 | 157 | __locale_t __loc); |
a784e502 | 158 | extern float ____strtof_l_internal (const char *__restrict __nptr, |
bf1fd594 | 159 | char **__restrict __endptr, int __group, |
2ef4aac7 | 160 | __locale_t __loc); |
a784e502 | 161 | extern long double ____strtold_l_internal (const char *__restrict __nptr, |
bf1fd594 | 162 | char **__restrict __endptr, |
2ef4aac7 | 163 | int __group, __locale_t __loc); |
a784e502 | 164 | extern long int ____strtol_l_internal (const char *__restrict __nptr, |
bf1fd594 UD |
165 | char **__restrict __endptr, |
166 | int __base, int __group, | |
2ef4aac7 | 167 | __locale_t __loc); |
a784e502 | 168 | extern unsigned long int ____strtoul_l_internal (const char * |
bf1fd594 UD |
169 | __restrict __nptr, |
170 | char **__restrict __endptr, | |
171 | int __base, int __group, | |
2ef4aac7 | 172 | __locale_t __loc); |
bf1fd594 | 173 | __extension__ |
a784e502 | 174 | extern long long int ____strtoll_l_internal (const char *__restrict __nptr, |
bf1fd594 UD |
175 | char **__restrict __endptr, |
176 | int __base, int __group, | |
2ef4aac7 | 177 | __locale_t __loc); |
bf1fd594 | 178 | __extension__ |
a784e502 | 179 | extern unsigned long long int ____strtoull_l_internal (const char * |
bf1fd594 UD |
180 | __restrict __nptr, |
181 | char ** | |
182 | __restrict __endptr, | |
183 | int __base, int __group, | |
2ef4aac7 | 184 | __locale_t __loc); |
bf1fd594 | 185 | |
509d1b68 RM |
186 | libc_hidden_proto (____strtof_l_internal) |
187 | libc_hidden_proto (____strtod_l_internal) | |
188 | libc_hidden_proto (____strtold_l_internal) | |
189 | libc_hidden_proto (____strtol_l_internal) | |
190 | libc_hidden_proto (____strtoll_l_internal) | |
191 | libc_hidden_proto (____strtoul_l_internal) | |
192 | libc_hidden_proto (____strtoull_l_internal) | |
193 | ||
773e305e RM |
194 | libc_hidden_proto (strtof) |
195 | libc_hidden_proto (strtod) | |
196 | libc_hidden_proto (strtold) | |
197 | libc_hidden_proto (strtol) | |
198 | libc_hidden_proto (strtoll) | |
199 | libc_hidden_proto (strtoul) | |
200 | libc_hidden_proto (strtoull) | |
bf1fd594 | 201 | |
c6251f03 RM |
202 | extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt, |
203 | int *__restrict __sign); | |
204 | extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt, | |
205 | int *__restrict __sign); | |
206 | extern char *__gcvt (double __value, int __ndigit, char *__buf); | |
207 | extern int __ecvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
208 | int *__restrict __sign, char *__restrict __buf, | |
209 | size_t __len); | |
210 | extern int __fcvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
211 | int *__restrict __sign, char *__restrict __buf, | |
212 | size_t __len); | |
213 | extern char *__qecvt (long double __value, int __ndigit, | |
214 | int *__restrict __decpt, int *__restrict __sign); | |
215 | extern char *__qfcvt (long double __value, int __ndigit, | |
216 | int *__restrict __decpt, int *__restrict __sign); | |
217 | extern char *__qgcvt (long double __value, int __ndigit, char *__buf); | |
218 | extern int __qecvt_r (long double __value, int __ndigit, | |
219 | int *__restrict __decpt, int *__restrict __sign, | |
220 | char *__restrict __buf, size_t __len); | |
221 | extern int __qfcvt_r (long double __value, int __ndigit, | |
222 | int *__restrict __decpt, int *__restrict __sign, | |
223 | char *__restrict __buf, size_t __len); | |
4c93a54c | 224 | |
403e0597 | 225 | # ifndef NOT_IN_libc |
4c93a54c UD |
226 | # undef MB_CUR_MAX |
227 | # define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX)) | |
6b87a564 UD |
228 | |
229 | # define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d) | |
4c93a54c UD |
230 | # endif |
231 | ||
db59b28b | 232 | extern void *__default_morecore (ptrdiff_t) __THROW; |
230491f0 UD |
233 | libc_hidden_proto (__default_morecore) |
234 | ||
f8a3b5bf UD |
235 | struct abort_msg_s |
236 | { | |
237 | unsigned int size; | |
238 | char msg[0]; | |
239 | }; | |
240 | extern struct abort_msg_s *__abort_msg; | |
48dcd0ba UD |
241 | libc_hidden_proto (__abort_msg) |
242 | ||
7735afa2 UD |
243 | __END_DECLS |
244 | ||
f8a3b5bf UD |
245 | #endif |
246 | ||
7ef90c15 UD |
247 | #undef __Need_M_And_C |
248 | ||
249 | #endif /* include/stdlib.h */ |