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