sys/fanotify.h: update to linux v5.7
[musl] / include / wchar.h
1 #ifndef _WCHAR_H
2 #define _WCHAR_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <features.h>
9
10 #define __NEED_FILE
11 #define __NEED___isoc_va_list
12 #define __NEED_size_t
13 #define __NEED_wchar_t
14 #define __NEED_wint_t
15 #define __NEED_mbstate_t
16
17 #if __STDC_VERSION__ < 201112L
18 #define __NEED_struct__IO_FILE
19 #endif
20
21 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
22  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
23 #define __NEED_locale_t
24 #define __NEED_va_list
25 #endif
26
27 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
28 #define __NEED_wctype_t
29 #endif
30
31 #include <bits/alltypes.h>
32
33 #if L'\0'-1 > 0
34 #define WCHAR_MAX (0xffffffffu+L'\0')
35 #define WCHAR_MIN (0+L'\0')
36 #else
37 #define WCHAR_MAX (0x7fffffff+L'\0')
38 #define WCHAR_MIN (-1-0x7fffffff+L'\0')
39 #endif
40
41 #ifdef __cplusplus
42 #define NULL 0L
43 #else
44 #define NULL ((void*)0)
45 #endif
46
47 #undef WEOF
48 #define WEOF 0xffffffffU
49
50 wchar_t *wcscpy (wchar_t *__restrict, const wchar_t *__restrict);
51 wchar_t *wcsncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
52
53 wchar_t *wcscat (wchar_t *__restrict, const wchar_t *__restrict);
54 wchar_t *wcsncat (wchar_t *__restrict, const wchar_t *__restrict, size_t);
55
56 int wcscmp (const wchar_t *, const wchar_t *);
57 int wcsncmp (const wchar_t *, const wchar_t *, size_t);
58
59 int wcscoll(const wchar_t *, const wchar_t *);
60 size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t);
61
62 wchar_t *wcschr (const wchar_t *, wchar_t);
63 wchar_t *wcsrchr (const wchar_t *, wchar_t);
64
65 size_t wcscspn (const wchar_t *, const wchar_t *);
66 size_t wcsspn (const wchar_t *, const wchar_t *);
67 wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
68
69 wchar_t *wcstok (wchar_t *__restrict, const wchar_t *__restrict, wchar_t **__restrict);
70
71 size_t wcslen (const wchar_t *);
72
73 wchar_t *wcsstr (const wchar_t *__restrict, const wchar_t *__restrict);
74 wchar_t *wcswcs (const wchar_t *, const wchar_t *);
75
76 wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
77 int wmemcmp (const wchar_t *, const wchar_t *, size_t);
78 wchar_t *wmemcpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
79 wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
80 wchar_t *wmemset (wchar_t *, wchar_t, size_t);
81
82 wint_t btowc (int);
83 int wctob (wint_t);
84
85 int mbsinit (const mbstate_t *);
86 size_t mbrtowc (wchar_t *__restrict, const char *__restrict, size_t, mbstate_t *__restrict);
87 size_t wcrtomb (char *__restrict, wchar_t, mbstate_t *__restrict);
88
89 size_t mbrlen (const char *__restrict, size_t, mbstate_t *__restrict);
90
91 size_t mbsrtowcs (wchar_t *__restrict, const char **__restrict, size_t, mbstate_t *__restrict);
92 size_t wcsrtombs (char *__restrict, const wchar_t **__restrict, size_t, mbstate_t *__restrict);
93
94 float wcstof (const wchar_t *__restrict, wchar_t **__restrict);
95 double wcstod (const wchar_t *__restrict, wchar_t **__restrict);
96 long double wcstold (const wchar_t *__restrict, wchar_t **__restrict);
97
98 long wcstol (const wchar_t *__restrict, wchar_t **__restrict, int);
99 unsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, int);
100
101 long long wcstoll (const wchar_t *__restrict, wchar_t **__restrict, int);
102 unsigned long long wcstoull (const wchar_t *__restrict, wchar_t **__restrict, int);
103
104
105
106 int fwide (FILE *, int);
107
108
109 int wprintf (const wchar_t *__restrict, ...);
110 int fwprintf (FILE *__restrict, const wchar_t *__restrict, ...);
111 int swprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, ...);
112
113 int vwprintf (const wchar_t *__restrict, __isoc_va_list);
114 int vfwprintf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
115 int vswprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, __isoc_va_list);
116
117 int wscanf (const wchar_t *__restrict, ...);
118 int fwscanf (FILE *__restrict, const wchar_t *__restrict, ...);
119 int swscanf (const wchar_t *__restrict, const wchar_t *__restrict, ...);
120
121 int vwscanf (const wchar_t *__restrict, __isoc_va_list);
122 int vfwscanf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
123 int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, __isoc_va_list);
124
125 wint_t fgetwc (FILE *);
126 wint_t getwc (FILE *);
127 wint_t getwchar (void);
128
129 wint_t fputwc (wchar_t, FILE *);
130 wint_t putwc (wchar_t, FILE *);
131 wint_t putwchar (wchar_t);
132
133 wchar_t *fgetws (wchar_t *__restrict, int, FILE *__restrict);
134 int fputws (const wchar_t *__restrict, FILE *__restrict);
135
136 wint_t ungetwc (wint_t, FILE *);
137
138 struct tm;
139 size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict);
140
141 #undef iswdigit
142
143 #if defined(_GNU_SOURCE)
144 wint_t fgetwc_unlocked (FILE *);
145 wint_t getwc_unlocked (FILE *);
146 wint_t getwchar_unlocked (void);
147 wint_t fputwc_unlocked (wchar_t, FILE *);
148 wint_t putwc_unlocked (wchar_t, FILE *);
149 wint_t putwchar_unlocked (wchar_t);
150 wchar_t *fgetws_unlocked (wchar_t *__restrict, int, FILE *__restrict);
151 int fputws_unlocked (const wchar_t *__restrict, FILE *__restrict);
152 #endif
153
154 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
155 size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t);
156 #endif
157
158 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
159  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)  || defined(_BSD_SOURCE)
160 FILE *open_wmemstream(wchar_t **, size_t *);
161 size_t mbsnrtowcs(wchar_t *__restrict, const char **__restrict, size_t, size_t, mbstate_t *__restrict);
162 size_t wcsnrtombs(char *__restrict, const wchar_t **__restrict, size_t, size_t, mbstate_t *__restrict);
163 wchar_t *wcsdup(const wchar_t *);
164 size_t wcsnlen (const wchar_t *, size_t);
165 wchar_t *wcpcpy (wchar_t *__restrict, const wchar_t *__restrict);
166 wchar_t *wcpncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
167 int wcscasecmp(const wchar_t *, const wchar_t *);
168 int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
169 int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
170 int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
171 int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
172 size_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t, locale_t);
173 #endif
174
175 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
176 int wcwidth (wchar_t);
177 int wcswidth (const wchar_t *, size_t);
178 int       iswalnum(wint_t);
179 int       iswalpha(wint_t);
180 int       iswblank(wint_t);
181 int       iswcntrl(wint_t);
182 int       iswdigit(wint_t);
183 int       iswgraph(wint_t);
184 int       iswlower(wint_t);
185 int       iswprint(wint_t);
186 int       iswpunct(wint_t);
187 int       iswspace(wint_t);
188 int       iswupper(wint_t);
189 int       iswxdigit(wint_t);
190 int       iswctype(wint_t, wctype_t);
191 wint_t    towlower(wint_t);
192 wint_t    towupper(wint_t);
193 wctype_t  wctype(const char *);
194
195 #ifndef __cplusplus
196 #undef iswdigit
197 #define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10)
198 #endif
199 #endif
200
201 #ifdef __cplusplus
202 }
203 #endif
204
205 #endif