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

source code of glibc/include/wchar.h