]> git.ipfire.org Git - thirdparty/glibc.git/blame - include/stdlib.h
C++11 thread_local destructors support
[thirdparty/glibc.git] / include / stdlib.h
CommitLineData
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
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;
773e305e
RM
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)
da4cfe38 32
a757607d 33libc_hidden_proto (exit)
509d1b68 34libc_hidden_proto (abort)
a757607d 35libc_hidden_proto (getenv)
84b3fd84
FW
36extern __typeof (secure_getenv) __libc_secure_getenv;
37libc_hidden_proto (__libc_secure_getenv)
a757607d 38libc_hidden_proto (bsearch)
284128f6 39libc_hidden_proto (qsort)
e458144c 40libc_hidden_proto (qsort_r)
c41f555e 41libc_hidden_proto (lrand48_r)
e2ec9b4d 42libc_hidden_proto (wctomb)
37ba7d66 43
344be96a 44extern long int __random (void);
c19559b0 45extern void __srandom (unsigned int __seed);
6484a17f 46extern char *__initstate (unsigned int __seed, char *__statebuf,
c19559b0 47 size_t __statelen);
6484a17f 48extern char *__setstate (char *__statebuf);
c19559b0
UD
49extern int __random_r (struct random_data *__buf, int32_t *__result);
50extern int __srandom_r (unsigned int __seed, struct random_data *__buf);
d653aacd 51extern int __initstate_r (unsigned int __seed, char *__statebuf,
c19559b0 52 size_t __statelen, struct random_data *__buf);
d653aacd 53extern int __setstate_r (char *__statebuf, struct random_data *__buf);
c19559b0 54extern int __rand_r (unsigned int *__seed);
fe559c5e 55extern int __erand48_r (unsigned short int __xsubi[3],
c19559b0 56 struct drand48_data *__buffer, double *__result);
fe559c5e
UD
57extern int __nrand48_r (unsigned short int __xsubi[3],
58 struct drand48_data *__buffer,
c19559b0 59 long int *__result);
fe559c5e
UD
60extern int __jrand48_r (unsigned short int __xsubi[3],
61 struct drand48_data *__buffer,
c19559b0 62 long int *__result);
fe559c5e 63extern int __srand48_r (long int __seedval,
c19559b0 64 struct drand48_data *__buffer);
fe559c5e 65extern int __seed48_r (unsigned short int __seed16v[3],
c19559b0 66 struct drand48_data *__buffer);
fe559c5e 67extern 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 71extern 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. */
75extern struct drand48_data __libc_drand48_data attribute_hidden;
76
a784e502
UD
77extern int __setenv (const char *__name, const char *__value, int __replace);
78extern int __unsetenv (const char *__name);
c19559b0 79extern int __clearenv (void);
cfa8054f 80extern char *__mktemp (char *__template) __THROW __nonnull ((1));
a784e502
UD
81extern char *__canonicalize_file_name (const char *__name);
82extern char *__realpath (const char *__name, char *__resolved);
c19559b0 83extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
63de5ef7 84# ifndef _ISOMAC
aa989023
UD
85extern int __ptsname_internal (int fd, char *buf, size_t buflen,
86 struct stat64 *stp);
63de5ef7 87# endif
c19559b0 88extern int __getpt (void);
0101a56f 89extern int __posix_openpt (int __oflag);
de4a40d0
UD
90
91extern int __add_to_environ (const char *name, const char *value,
92 const char *combines, int replace);
061d137b
UD
93
94extern 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
97extern int __on_exit (void (*__func) (int __status, void *__arg), void *__arg);
98
a6a478e9 99extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
6b87a564
UD
100extern int __cxa_atexit_internal (void (*func) (void *), void *arg, void *d)
101 attribute_hidden;
a6a478e9 102
ba384f6e
SP
103extern int __cxa_thread_atexit_impl (void (*func) (void *), void *arg,
104 void *d);
105extern void __call_tls_dtors (void);
106libc_hidden_proto (__call_tls_dtors);
107
03bac9ac
AJ
108extern void __cxa_finalize (void *d);
109
5bcbe69f
AJ
110extern int __posix_memalign (void **memptr, size_t alignment, size_t size);
111
aed283dd
UD
112extern void *__libc_memalign (size_t alignment, size_t size)
113 __attribute_malloc__;
0758ea0c 114
03bac9ac
AJ
115extern int __libc_system (const char *line);
116
9b2e9577 117
a784e502 118extern double __strtod_internal (const char *__restrict __nptr,
9b2e9577
UD
119 char **__restrict __endptr, int __group)
120 __THROW __nonnull ((1)) __wur;
a784e502 121extern float __strtof_internal (const char *__restrict __nptr,
9b2e9577
UD
122 char **__restrict __endptr, int __group)
123 __THROW __nonnull ((1)) __wur;
a784e502 124extern long double __strtold_internal (const char *__restrict __nptr,
9b2e9577
UD
125 char **__restrict __endptr,
126 int __group)
127 __THROW __nonnull ((1)) __wur;
a784e502 128extern 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 132extern 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 137extern 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 142extern 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;
147libc_hidden_proto (__strtof_internal)
148libc_hidden_proto (__strtod_internal)
149libc_hidden_proto (__strtold_internal)
150libc_hidden_proto (__strtol_internal)
151libc_hidden_proto (__strtoll_internal)
152libc_hidden_proto (__strtoul_internal)
153libc_hidden_proto (__strtoull_internal)
154
a784e502 155extern double ____strtod_l_internal (const char *__restrict __nptr,
bf1fd594 156 char **__restrict __endptr, int __group,
2ef4aac7 157 __locale_t __loc);
a784e502 158extern float ____strtof_l_internal (const char *__restrict __nptr,
bf1fd594 159 char **__restrict __endptr, int __group,
2ef4aac7 160 __locale_t __loc);
a784e502 161extern long double ____strtold_l_internal (const char *__restrict __nptr,
bf1fd594 162 char **__restrict __endptr,
2ef4aac7 163 int __group, __locale_t __loc);
a784e502 164extern 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 168extern 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 174extern 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 179extern 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
186libc_hidden_proto (____strtof_l_internal)
187libc_hidden_proto (____strtod_l_internal)
188libc_hidden_proto (____strtold_l_internal)
189libc_hidden_proto (____strtol_l_internal)
190libc_hidden_proto (____strtoll_l_internal)
191libc_hidden_proto (____strtoul_l_internal)
192libc_hidden_proto (____strtoull_l_internal)
193
773e305e
RM
194libc_hidden_proto (strtof)
195libc_hidden_proto (strtod)
196libc_hidden_proto (strtold)
197libc_hidden_proto (strtol)
198libc_hidden_proto (strtoll)
199libc_hidden_proto (strtoul)
200libc_hidden_proto (strtoull)
bf1fd594 201
c6251f03
RM
202extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt,
203 int *__restrict __sign);
204extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt,
205 int *__restrict __sign);
206extern char *__gcvt (double __value, int __ndigit, char *__buf);
207extern int __ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
208 int *__restrict __sign, char *__restrict __buf,
209 size_t __len);
210extern int __fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
211 int *__restrict __sign, char *__restrict __buf,
212 size_t __len);
213extern char *__qecvt (long double __value, int __ndigit,
214 int *__restrict __decpt, int *__restrict __sign);
215extern char *__qfcvt (long double __value, int __ndigit,
216 int *__restrict __decpt, int *__restrict __sign);
217extern char *__qgcvt (long double __value, int __ndigit, char *__buf);
218extern int __qecvt_r (long double __value, int __ndigit,
219 int *__restrict __decpt, int *__restrict __sign,
220 char *__restrict __buf, size_t __len);
221extern 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 232extern void *__default_morecore (ptrdiff_t) __THROW;
230491f0
UD
233libc_hidden_proto (__default_morecore)
234
f8a3b5bf
UD
235struct abort_msg_s
236{
237 unsigned int size;
238 char msg[0];
239};
240extern struct abort_msg_s *__abort_msg;
48dcd0ba
UD
241libc_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 */