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