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