2 # include <wcsmbs/wchar.h>
5 #include <bits/floatn.h>
7 extern __typeof (wcscasecmp_l
) __wcscasecmp_l
;
8 extern __typeof (wcsncasecmp_l
) __wcsncasecmp_l
;
9 extern __typeof (wcscoll_l
) __wcscoll_l
;
10 extern __typeof (wcsxfrm_l
) __wcsxfrm_l
;
11 extern __typeof (wcstol_l
) __wcstol_l
;
12 extern __typeof (wcstoul_l
) __wcstoul_l
;
13 extern __typeof (wcstoll_l
) __wcstoll_l
;
14 extern __typeof (wcstoull_l
) __wcstoull_l
;
15 extern __typeof (wcstod_l
) __wcstod_l
;
16 extern __typeof (wcstof_l
) __wcstof_l
;
17 extern __typeof (wcstold_l
) __wcstold_l
;
18 extern __typeof (wcsftime_l
) __wcsftime_l
;
19 libc_hidden_proto (__wcstol_l
)
20 libc_hidden_proto (__wcstoul_l
)
21 libc_hidden_proto (__wcstoll_l
)
22 libc_hidden_proto (__wcstoull_l
)
23 libc_hidden_proto (__wcstod_l
)
24 libc_hidden_proto (__wcstof_l
)
25 libc_hidden_proto (__wcstold_l
)
26 libc_hidden_proto (__wcsftime_l
)
29 extern double __wcstod_internal (const wchar_t *__restrict __nptr
,
30 wchar_t **__restrict __endptr
, int __group
)
32 extern float __wcstof_internal (const wchar_t *__restrict __nptr
,
33 wchar_t **__restrict __endptr
, int __group
)
35 extern long double __wcstold_internal (const wchar_t *__restrict __nptr
,
36 wchar_t **__restrict __endptr
,
38 extern long int __wcstol_internal (const wchar_t *__restrict __nptr
,
39 wchar_t **__restrict __endptr
,
40 int __base
, int __group
) __THROW
;
41 extern unsigned long int __wcstoul_internal (const wchar_t *__restrict __npt
,
42 wchar_t **__restrict __endptr
,
43 int __base
, int __group
) __THROW
;
45 extern long long int __wcstoll_internal (const wchar_t *__restrict __nptr
,
46 wchar_t **__restrict __endptr
,
47 int __base
, int __group
) __THROW
;
49 extern unsigned long long int __wcstoull_internal (const wchar_t *
55 extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
58 libc_hidden_proto (__wcstof_internal
)
59 libc_hidden_proto (__wcstod_internal
)
60 libc_hidden_proto (__wcstold_internal
)
61 libc_hidden_proto (__wcstol_internal
)
62 libc_hidden_proto (__wcstoll_internal
)
63 libc_hidden_proto (__wcstoul_internal
)
64 libc_hidden_proto (__wcstoull_internal
)
65 libc_hidden_proto (wcstof
)
66 libc_hidden_proto (wcstod
)
67 libc_hidden_proto (wcstold
)
68 libc_hidden_proto (wcstol
)
69 libc_hidden_proto (wcstoll
)
70 libc_hidden_proto (wcstoul
)
71 libc_hidden_proto (wcstoull
)
73 extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,
74 locale_t
) attribute_hidden
;
75 extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int,
76 locale_t
) attribute_hidden
;
77 extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **,
78 int, locale_t
) attribute_hidden
;
79 extern long int ____wcstol_l_internal (const wchar_t *, wchar_t **, int,
80 int, locale_t
) attribute_hidden
;
81 extern unsigned long int ____wcstoul_l_internal (const wchar_t *,
85 extern long long int ____wcstoll_l_internal (const wchar_t *, wchar_t **,
88 extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
93 #if __HAVE_DISTINCT_FLOAT128
94 extern __typeof (wcstof128_l
) __wcstof128_l
;
95 libc_hidden_proto (__wcstof128_l
)
96 extern _Float128
__wcstof128_internal (const wchar_t *__restrict __nptr
,
97 wchar_t **__restrict __endptr
,
100 extern _Float128
____wcstof128_l_internal (const wchar_t *, wchar_t **, int,
101 locale_t
) attribute_hidden
;
103 libc_hidden_proto (__wcstof128_internal
)
104 libc_hidden_proto (wcstof128
)
107 libc_hidden_proto (__wcscasecmp_l
)
108 libc_hidden_proto (__wcsncasecmp_l
)
110 libc_hidden_proto (__wcscoll_l
)
111 libc_hidden_proto (__wcsxfrm_l
)
113 libc_hidden_proto (fputws_unlocked
)
114 libc_hidden_proto (putwc_unlocked
)
115 libc_hidden_proto (putwc
)
117 libc_hidden_proto (vswscanf
)
119 libc_hidden_proto (mbrtowc
)
120 libc_hidden_proto (wcrtomb
)
121 extern int __wcscmp (const wchar_t *__s1
, const wchar_t *__s2
)
122 __THROW __attribute_pure__
;
123 libc_hidden_proto (__wcscmp
)
124 libc_hidden_proto (wcsftime
)
125 libc_hidden_proto (wcsspn
)
126 libc_hidden_proto (wcschr
)
127 /* The C++ overloading of wcschr means we have to repeat the type to
128 declare __wcschr instead of using typeof, to avoid errors in C++
129 tests; in addition, __THROW cannot be used with a function type
130 from typeof in C++. The same applies to __wmemchr and, as regards
131 __THROW, to __wcscmp and __wcscoll. */
132 extern wchar_t *__wcschr (const wchar_t *__wcs
, wchar_t __wc
)
133 __THROW __attribute_pure__
;
134 libc_hidden_proto (__wcschr
)
135 extern int __wcscoll (const wchar_t *__s1
, const wchar_t *__s2
) __THROW
;
136 libc_hidden_proto (__wcscoll
)
137 libc_hidden_proto (wcspbrk
)
139 extern __typeof (wmemset
) __wmemset
;
140 extern wchar_t *__wmemchr (const wchar_t *__s
, wchar_t __c
, size_t __n
)
141 __THROW __attribute_pure__
;
142 libc_hidden_proto (wmemchr
)
143 libc_hidden_proto (__wmemchr
)
144 libc_hidden_proto (wmemset
)
145 libc_hidden_proto (__wmemset
)
147 /* Now define the internal interfaces. */
148 extern int __wcscasecmp (const wchar_t *__s1
, const wchar_t *__s2
)
150 extern int __wcsncasecmp (const wchar_t *__s1
, const wchar_t *__s2
,
153 extern size_t __wcslen (const wchar_t *__s
) __attribute_pure__
;
154 extern size_t __wcsnlen (const wchar_t *__s
, size_t __maxlen
)
155 attribute_hidden __attribute_pure__
;
156 extern wchar_t *__wcscat (wchar_t *dest
, const wchar_t *src
)
158 extern wint_t __btowc (int __c
) attribute_hidden
;
159 extern int __mbsinit (const __mbstate_t
*__ps
);
160 extern size_t __mbrtowc (wchar_t *__restrict __pwc
,
161 const char *__restrict __s
, size_t __n
,
162 __mbstate_t
*__restrict __p
);
163 libc_hidden_proto (__mbrtowc
)
164 libc_hidden_proto (__mbrlen
)
165 extern size_t __wcrtomb (char *__restrict __s
, wchar_t __wc
,
166 __mbstate_t
*__restrict __ps
) attribute_hidden
;
167 extern size_t __mbsrtowcs (wchar_t *__restrict __dst
,
168 const char **__restrict __src
,
169 size_t __len
, __mbstate_t
*__restrict __ps
)
171 extern size_t __wcsrtombs (char *__restrict __dst
,
172 const wchar_t **__restrict __src
,
173 size_t __len
, __mbstate_t
*__restrict __ps
)
175 extern size_t __mbsnrtowcs (wchar_t *__restrict __dst
,
176 const char **__restrict __src
, size_t __nmc
,
177 size_t __len
, __mbstate_t
*__restrict __ps
)
179 extern size_t __wcsnrtombs (char *__restrict __dst
,
180 const wchar_t **__restrict __src
,
181 size_t __nwc
, size_t __len
,
182 __mbstate_t
*__restrict __ps
)
184 extern wchar_t *__wcsncpy (wchar_t *__restrict __dest
,
185 const wchar_t *__restrict __src
, size_t __n
)
187 extern wchar_t *__wcpcpy (wchar_t *__dest
, const wchar_t *__src
);
188 extern wchar_t *__wcpncpy (wchar_t *__dest
, const wchar_t *__src
,
189 size_t __n
) attribute_hidden
;
190 extern wchar_t *__wmemcpy (wchar_t *__s1
, const wchar_t *s2
,
191 size_t __n
) attribute_hidden
;
192 extern wchar_t *__wmempcpy (wchar_t *__restrict __s1
,
193 const wchar_t *__restrict __s2
,
194 size_t __n
) attribute_hidden
;
195 extern wchar_t *__wmemmove (wchar_t *__s1
, const wchar_t *__s2
,
196 size_t __n
) attribute_hidden
;
197 extern wchar_t *__wcschrnul (const wchar_t *__s
, wchar_t __wc
)
198 attribute_hidden __attribute_pure__
;
200 extern wchar_t *__wmemset_chk (wchar_t *__s
, wchar_t __c
, size_t __n
,
201 size_t __ns
) __THROW
;
203 extern int __vfwscanf (__FILE
*__restrict __s
,
204 const wchar_t *__restrict __format
,
205 __gnuc_va_list __arg
)
207 /* __attribute__ ((__format__ (__wscanf__, 2, 0)) */;
208 extern int __vswprintf (wchar_t *__restrict __s
, size_t __n
,
209 const wchar_t *__restrict __format
,
210 __gnuc_va_list __arg
)
212 /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
213 extern int __fwprintf (__FILE
*__restrict __s
,
214 const wchar_t *__restrict __format
, ...)
216 /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
217 extern int __vfwprintf (__FILE
*__restrict __s
,
218 const wchar_t *__restrict __format
,
219 __gnuc_va_list __arg
)
221 /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
222 extern int __vfwprintf_chk (FILE *__restrict __s
, int __flag
,
223 const wchar_t *__restrict __format
,
224 __gnuc_va_list __arg
)
225 /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
226 extern int __vswprintf_chk (wchar_t *__restrict __s
, size_t __n
,
227 int __flag
, size_t __s_len
,
228 const wchar_t *__restrict __format
,
229 __gnuc_va_list __arg
)
230 /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
231 libc_hidden_proto (__vfwprintf_chk
)
232 libc_hidden_proto (__vswprintf_chk
)
234 extern int __isoc99_fwscanf (__FILE
*__restrict __stream
,
235 const wchar_t *__restrict __format
, ...);
236 extern int __isoc99_wscanf (const wchar_t *__restrict __format
, ...);
237 extern int __isoc99_swscanf (const wchar_t *__restrict __s
,
238 const wchar_t *__restrict __format
, ...)
240 extern int __isoc99_vfwscanf (__FILE
*__restrict __s
,
241 const wchar_t *__restrict __format
,
242 __gnuc_va_list __arg
);
243 extern int __isoc99_vwscanf (const wchar_t *__restrict __format
,
244 __gnuc_va_list __arg
);
245 extern int __isoc99_vswscanf (const wchar_t *__restrict __s
,
246 const wchar_t *__restrict __format
,
247 __gnuc_va_list __arg
) __THROW
;
248 extern int __vswscanf (const wchar_t *__restrict __s
,
249 const wchar_t *__restrict __format
,
250 __gnuc_va_list __arg
) __THROW
;
251 libc_hidden_proto (__isoc99_vswscanf
)
252 libc_hidden_proto (__vswscanf
)
253 libc_hidden_proto (__isoc99_vfwscanf
)
255 /* Internal functions. */
256 extern size_t __mbsrtowcs_l (wchar_t *dst
, const char **src
, size_t len
,
257 mbstate_t *ps
, locale_t l
) attribute_hidden
;
259 /* Special version. We know that all uses of mbsinit inside the libc
260 have a non-NULL parameter. And certainly we can access the
261 internals of the data structure directly. */
262 # define mbsinit(state) ((state)->__count == 0)
263 # define __mbsinit(state) ((state)->__count == 0)