* Makerules: Define build-module-asneeded.
[glibc.git] / include / stdlib.h
blob89bee37c0a3471bd9d5b01fc8f99809147a026eb
1 #ifndef _STDLIB_H
3 #ifdef __need_malloc_and_calloc
4 #define __Need_M_And_C
5 #endif
7 #include <stddef.h>
8 #include <stdlib/stdlib.h>
10 /* Now define the internal interfaces. */
11 #ifndef __Need_M_And_C
13 __BEGIN_DECLS
15 extern __typeof (strtol_l) __strtol_l;
16 extern __typeof (strtoul_l) __strtoul_l;
17 extern __typeof (strtoll_l) __strtoll_l;
18 extern __typeof (strtoull_l) __strtoull_l;
19 extern __typeof (strtod_l) __strtod_l;
20 extern __typeof (strtof_l) __strtof_l;
21 extern __typeof (strtold_l) __strtold_l;
23 libc_hidden_proto (exit)
24 libc_hidden_proto (abort)
25 libc_hidden_proto (getenv)
26 libc_hidden_proto (bsearch)
27 libc_hidden_proto (qsort)
28 libc_hidden_proto (ecvt_r)
29 libc_hidden_proto (fcvt_r)
30 libc_hidden_proto (qecvt_r)
31 libc_hidden_proto (qfcvt_r)
32 libc_hidden_proto (lrand48_r)
33 libc_hidden_proto (wctomb)
34 libc_hidden_proto (__secure_getenv)
35 libc_hidden_proto (__strtof_internal)
36 libc_hidden_proto (__strtod_internal)
37 libc_hidden_proto (__strtold_internal)
38 libc_hidden_proto (__strtol_internal)
39 libc_hidden_proto (__strtoll_internal)
40 libc_hidden_proto (__strtoul_internal)
41 libc_hidden_proto (__strtoull_internal)
43 extern long int __random (void);
44 extern void __srandom (unsigned int __seed);
45 extern char *__initstate (unsigned int __seed, char *__statebuf,
46 size_t __statelen);
47 extern char *__setstate (char *__statebuf);
48 extern int __random_r (struct random_data *__buf, int32_t *__result);
49 extern int __srandom_r (unsigned int __seed, struct random_data *__buf);
50 extern int __initstate_r (unsigned int __seed, char *__statebuf,
51 size_t __statelen, struct random_data *__buf);
52 extern int __setstate_r (char *__statebuf, struct random_data *__buf);
53 extern int __rand_r (unsigned int *__seed);
54 extern int __erand48_r (unsigned short int __xsubi[3],
55 struct drand48_data *__buffer, double *__result);
56 extern int __nrand48_r (unsigned short int __xsubi[3],
57 struct drand48_data *__buffer,
58 long int *__result);
59 extern int __jrand48_r (unsigned short int __xsubi[3],
60 struct drand48_data *__buffer,
61 long int *__result);
62 extern int __srand48_r (long int __seedval,
63 struct drand48_data *__buffer);
64 extern int __seed48_r (unsigned short int __seed16v[3],
65 struct drand48_data *__buffer);
66 extern int __lcong48_r (unsigned short int __param[7],
67 struct drand48_data *__buffer);
69 /* Internal function to compute next state of the generator. */
70 extern int __drand48_iterate (unsigned short int __xsubi[3],
71 struct drand48_data *__buffer);
73 /* Global state for non-reentrant functions. Defined in drand48-iter.c. */
74 extern struct drand48_data __libc_drand48_data attribute_hidden;
76 extern int __setenv (__const char *__name, __const char *__value,
77 int __replace);
78 extern int __unsetenv (__const char *__name);
79 extern int __clearenv (void);
80 extern char *__canonicalize_file_name (__const char *__name);
81 extern char *__realpath (__const char *__name, char *__resolved);
82 extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
83 extern int __getpt (void);
84 extern int __posix_openpt (int __oflag);
86 extern int __add_to_environ (const char *name, const char *value,
87 const char *combines, int replace);
89 extern void _quicksort (void *const pbase, size_t total_elems,
90 size_t size, __compar_fn_t cmp);
92 extern int __on_exit (void (*__func) (int __status, void *__arg), void *__arg);
94 extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
95 extern int __cxa_atexit_internal (void (*func) (void *), void *arg, void *d)
96 attribute_hidden;
98 extern void __cxa_finalize (void *d);
100 extern int __posix_memalign (void **memptr, size_t alignment, size_t size);
102 extern void *__libc_memalign (size_t alignment, size_t size)
103 __attribute_malloc__;
105 extern int __libc_system (const char *line);
107 extern double ____strtod_l_internal (__const char *__restrict __nptr,
108 char **__restrict __endptr, int __group,
109 __locale_t __loc);
110 extern float ____strtof_l_internal (__const char *__restrict __nptr,
111 char **__restrict __endptr, int __group,
112 __locale_t __loc);
113 extern long double ____strtold_l_internal (__const char *__restrict __nptr,
114 char **__restrict __endptr,
115 int __group, __locale_t __loc);
116 extern long int ____strtol_l_internal (__const char *__restrict __nptr,
117 char **__restrict __endptr,
118 int __base, int __group,
119 __locale_t __loc);
120 extern unsigned long int ____strtoul_l_internal (__const char *
121 __restrict __nptr,
122 char **__restrict __endptr,
123 int __base, int __group,
124 __locale_t __loc);
125 __extension__
126 extern long long int ____strtoll_l_internal (__const char *__restrict __nptr,
127 char **__restrict __endptr,
128 int __base, int __group,
129 __locale_t __loc);
130 __extension__
131 extern unsigned long long int ____strtoull_l_internal (__const char *
132 __restrict __nptr,
133 char **
134 __restrict __endptr,
135 int __base, int __group,
136 __locale_t __loc);
138 libc_hidden_proto (____strtof_l_internal)
139 libc_hidden_proto (____strtod_l_internal)
140 libc_hidden_proto (____strtold_l_internal)
141 libc_hidden_proto (____strtol_l_internal)
142 libc_hidden_proto (____strtoll_l_internal)
143 libc_hidden_proto (____strtoul_l_internal)
144 libc_hidden_proto (____strtoull_l_internal)
146 extern __inline double
147 __NTH (__strtod_l (__const char *__restrict __nptr, char **__restrict __endptr,
148 __locale_t __loc))
150 return ____strtod_l_internal (__nptr, __endptr, 0, __loc);
152 extern __inline long int
153 __NTH (__strtol_l (__const char *__restrict __nptr, char **__restrict __endptr,
154 int __base, __locale_t __loc))
156 return ____strtol_l_internal (__nptr, __endptr, __base, 0, __loc);
158 extern __inline unsigned long int
159 __NTH (__strtoul_l (__const char *__restrict __nptr,
160 char **__restrict __endptr, int __base, __locale_t __loc))
162 return ____strtoul_l_internal (__nptr, __endptr, __base, 0, __loc);
164 extern __inline float
165 __NTH (__strtof_l (__const char *__restrict __nptr, char **__restrict __endptr,
166 __locale_t __loc))
168 return ____strtof_l_internal (__nptr, __endptr, 0, __loc);
170 extern __inline long double
171 __NTH (__strtold_l (__const char *__restrict __nptr,
172 char **__restrict __endptr, __locale_t __loc))
174 return ____strtold_l_internal (__nptr, __endptr, 0, __loc);
176 __extension__ extern __inline long long int
177 __NTH (__strtoll_l (__const char *__restrict __nptr,
178 char **__restrict __endptr, int __base, __locale_t __loc))
180 return ____strtoll_l_internal (__nptr, __endptr, __base, 0, __loc);
182 __extension__ extern __inline unsigned long long int
183 __NTH (__strtoull_l (__const char * __restrict __nptr,
184 char **__restrict __endptr, int __base, __locale_t __loc))
186 return ____strtoull_l_internal (__nptr, __endptr, __base, 0, __loc);
190 # ifndef NOT_IN_libc
191 # undef MB_CUR_MAX
192 # define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
194 # define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
195 # endif
197 #endif
199 extern void *__default_morecore (ptrdiff_t) __THROW;
200 libc_hidden_proto (__default_morecore)
202 __END_DECLS
204 #undef __Need_M_And_C
206 #endif /* include/stdlib.h */