blob: 67d0248f001d57d50d3328b63f3de3ccf1a2047b [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#ifndef _WCHAR_H
2#include <wcsmbs/wchar.h>
3
4# ifndef _ISOMAC
5# ifdef _WCHAR_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;
55libc_hidden_proto (__wcstof_internal)
56libc_hidden_proto (__wcstod_internal)
57libc_hidden_proto (__wcstold_internal)
58libc_hidden_proto (__wcstol_internal)
59libc_hidden_proto (__wcstoll_internal)
60libc_hidden_proto (__wcstoul_internal)
61libc_hidden_proto (__wcstoull_internal)
62libc_hidden_proto (wcstof)
63libc_hidden_proto (wcstod)
64libc_hidden_proto (wcstold)
65libc_hidden_proto (wcstol)
66libc_hidden_proto (wcstoll)
67libc_hidden_proto (wcstoul)
68libc_hidden_proto (wcstoull)
69
70libc_hidden_proto (__wcscasecmp_l)
71libc_hidden_proto (__wcsncasecmp_l)
72
73libc_hidden_proto (__wcscoll_l)
74libc_hidden_proto (__wcsxfrm_l)
75
76libc_hidden_proto (fputws_unlocked)
77libc_hidden_proto (putwc_unlocked)
78libc_hidden_proto (putwc)
79
80libc_hidden_proto (vswscanf)
81
82libc_hidden_proto (mbrtowc)
83libc_hidden_proto (wcrtomb)
84extern int __wcscmp (const wchar_t *__s1, const wchar_t *__s2)
85 __THROW __attribute_pure__;
86libc_hidden_proto (__wcscmp)
87libc_hidden_proto (wcsftime)
88libc_hidden_proto (wcsspn)
89libc_hidden_proto (wcschr)
90/* The C++ overloading of wcschr means we have to repeat the type to
91 declare __wcschr instead of using typeof, to avoid errors in C++
92 tests; in addition, __THROW cannot be used with a function type
93 from typeof in C++. The same applies to __wmemchr and, as regards
94 __THROW, to __wcscmp and __wcscoll. */
95extern wchar_t *__wcschr (const wchar_t *__wcs, wchar_t __wc)
96 __THROW __attribute_pure__;
97libc_hidden_proto (__wcschr)
98extern int __wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW;
99libc_hidden_proto (__wcscoll)
100libc_hidden_proto (wcspbrk)
101
102extern typeof (wmemset) __wmemset;
103extern wchar_t *__wmemchr (const wchar_t *__s, wchar_t __c, size_t __n)
104 __THROW __attribute_pure__;
105libc_hidden_proto (wmemchr)
106libc_hidden_proto (__wmemchr)
107libc_hidden_proto (wmemset)
108libc_hidden_proto (__wmemset)
109
110/* Now define the internal interfaces. */
111extern int __wcscasecmp (const wchar_t *__s1, const wchar_t *__s2)
112 __attribute_pure__;
113extern int __wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2,
114 size_t __n)
115 __attribute_pure__;
116extern size_t __wcslen (const wchar_t *__s) __attribute_pure__;
117extern size_t __wcsnlen (const wchar_t *__s, size_t __maxlen)
118 __attribute_pure__;
119extern wchar_t *__wcscat (wchar_t *dest, const wchar_t *src);
120extern wint_t __btowc (int __c);
121extern int __mbsinit (const __mbstate_t *__ps);
122extern size_t __mbrtowc (wchar_t *__restrict __pwc,
123 const char *__restrict __s, size_t __n,
124 __mbstate_t *__restrict __p);
125libc_hidden_proto (__mbrtowc)
126libc_hidden_proto (__mbrlen)
127extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc,
128 __mbstate_t *__restrict __ps);
129extern size_t __mbsrtowcs (wchar_t *__restrict __dst,
130 const char **__restrict __src,
131 size_t __len, __mbstate_t *__restrict __ps);
132extern size_t __wcsrtombs (char *__restrict __dst,
133 const wchar_t **__restrict __src,
134 size_t __len, __mbstate_t *__restrict __ps);
135extern size_t __mbsnrtowcs (wchar_t *__restrict __dst,
136 const char **__restrict __src, size_t __nmc,
137 size_t __len, __mbstate_t *__restrict __ps);
138extern size_t __wcsnrtombs (char *__restrict __dst,
139 const wchar_t **__restrict __src,
140 size_t __nwc, size_t __len,
141 __mbstate_t *__restrict __ps);
142extern wchar_t *__wcsncpy (wchar_t *__restrict __dest,
143 const wchar_t *__restrict __src, size_t __n);
144extern wchar_t *__wcpcpy (wchar_t *__dest, const wchar_t *__src);
145extern wchar_t *__wcpncpy (wchar_t *__dest, const wchar_t *__src,
146 size_t __n);
147extern wchar_t *__wmemcpy (wchar_t *__s1, const wchar_t *s2,
148 size_t __n);
149extern wchar_t *__wmempcpy (wchar_t *__restrict __s1,
150 const wchar_t *__restrict __s2,
151 size_t __n);
152extern wchar_t *__wmemmove (wchar_t *__s1, const wchar_t *__s2,
153 size_t __n);
154extern wchar_t *__wcschrnul (const wchar_t *__s, wchar_t __wc)
155 __attribute_pure__;
156
157extern int __vfwscanf (__FILE *__restrict __s,
158 const wchar_t *__restrict __format,
159 __gnuc_va_list __arg)
160 /* __attribute__ ((__format__ (__wscanf__, 2, 0)) */;
161extern int __vswprintf (wchar_t *__restrict __s, size_t __n,
162 const wchar_t *__restrict __format,
163 __gnuc_va_list __arg)
164 /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
165extern int __fwprintf (__FILE *__restrict __s,
166 const wchar_t *__restrict __format, ...)
167 /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
168extern int __vfwprintf (__FILE *__restrict __s,
169 const wchar_t *__restrict __format,
170 __gnuc_va_list __arg)
171 /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
172#ifndef __cplusplus
173extern int __vfwprintf_chk (FILE *__restrict __s, int __flag,
174 const wchar_t *__restrict __format,
175 __gnuc_va_list __arg)
176 /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
177extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
178 int __flag, size_t __s_len,
179 const wchar_t *__restrict __format,
180 __gnuc_va_list __arg)
181 /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
182libc_hidden_proto (__vfwprintf_chk)
183libc_hidden_proto (__vswprintf_chk)
184#endif
185
186extern int __isoc99_fwscanf (__FILE *__restrict __stream,
187 const wchar_t *__restrict __format, ...);
188extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...);
189extern int __isoc99_swscanf (const wchar_t *__restrict __s,
190 const wchar_t *__restrict __format, ...)
191 __THROW;
192extern int __isoc99_vfwscanf (__FILE *__restrict __s,
193 const wchar_t *__restrict __format,
194 __gnuc_va_list __arg);
195extern int __isoc99_vwscanf (const wchar_t *__restrict __format,
196 __gnuc_va_list __arg);
197extern int __isoc99_vswscanf (const wchar_t *__restrict __s,
198 const wchar_t *__restrict __format,
199 __gnuc_va_list __arg) __THROW;
200extern int __vswscanf (const wchar_t *__restrict __s,
201 const wchar_t *__restrict __format,
202 __gnuc_va_list __arg) __THROW;
203libc_hidden_proto (__isoc99_vswscanf)
204libc_hidden_proto (__vswscanf)
205libc_hidden_proto (__isoc99_vfwscanf)
206
207/* Internal functions. */
208extern size_t __mbsrtowcs_l (wchar_t *dst, const char **src, size_t len,
209 mbstate_t *ps, __locale_t l) attribute_hidden;
210
211/* Special version. We know that all uses of mbsinit inside the libc
212 have a non-NULL parameter. And certainly we can access the
213 internals of the data structure directly. */
214# define mbsinit(state) ((state)->__count == 0)
215# define __mbsinit(state) ((state)->__count == 0)
216
217# endif
218# endif
219#endif
220
221/* Undefine all __need_* constants in case we are included to get those
222 constants but the whole file was already read. */
223#undef __need_mbstate_t
224#undef __need_wint_t