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