tcp.h: add SOL_TCP, analoguous to udp.h
[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_va_list
12 #define __NEED_size_t
13 #define __NEED_wchar_t
14 #define __NEED_wint_t
15
16 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
17  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
18 #define __NEED_locale_t
19 #endif
20
21 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
22 #define __NEED_wctype_t
23 #endif
24
25 #include <bits/alltypes.h>
26
27 #include <bits/wchar.h>
28
29 #undef NULL
30 #ifdef __cplusplus
31 #define NULL 0
32 #else
33 #define NULL ((void*)0)
34 #endif
35
36 #undef WEOF
37 #define WEOF (-1)
38
39 typedef struct
40 {
41         unsigned __opaque1, __opaque2;
42 } mbstate_t;
43
44 wchar_t *wcscpy (wchar_t *__restrict, const wchar_t *__restrict);
45 wchar_t *wcsncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
46
47 wchar_t *wcscat (wchar_t *__restrict, const wchar_t *__restrict);
48 wchar_t *wcsncat (wchar_t *__restrict, const wchar_t *__restrict, size_t);
49
50 int wcscmp (const wchar_t *, const wchar_t *);
51 int wcsncmp (const wchar_t *, const wchar_t *, size_t);
52
53 int wcscoll(const wchar_t *, const wchar_t *);
54 size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t n);
55
56 wchar_t *wcschr (const wchar_t *, wchar_t);
57 wchar_t *wcsrchr (const wchar_t *, wchar_t);
58
59 size_t wcscspn (const wchar_t *, const wchar_t *);
60 size_t wcsspn (const wchar_t *, const wchar_t *);
61 wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
62
63 wchar_t *wcstok (wchar_t *__restrict, const wchar_t *__restrict, wchar_t **__restrict);
64
65 size_t wcslen (const wchar_t *);
66
67 wchar_t *wcsstr (const wchar_t *__restrict, const wchar_t *__restrict);
68 wchar_t *wcswcs (const wchar_t *, const wchar_t *);
69
70 wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
71 int wmemcmp (const wchar_t *, const wchar_t *, size_t);
72 wchar_t *wmemcpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
73 wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
74 wchar_t *wmemset (wchar_t *, wchar_t, size_t);
75
76 wint_t btowc (int);
77 int wctob (wint_t);
78
79 int mbsinit (const mbstate_t *);
80 size_t mbrtowc (wchar_t *__restrict, const char *__restrict, size_t, mbstate_t *__restrict);
81 size_t wcrtomb (char *__restrict, wchar_t, mbstate_t *__restrict);
82
83 size_t mbrlen (const char *__restrict, size_t, mbstate_t *__restrict);
84
85 size_t mbsrtowcs (wchar_t *__restrict, const char **__restrict, size_t, mbstate_t *__restrict);
86 size_t wcsrtombs (char *__restrict, const wchar_t **__restrict, size_t, mbstate_t *__restrict);
87
88 float wcstof (const wchar_t *__restrict, wchar_t **__restrict);
89 double wcstod (const wchar_t *__restrict, wchar_t **__restrict);
90 long double wcstold (const wchar_t *__restrict, wchar_t **__restrict);
91
92 long wcstol (const wchar_t *__restrict, wchar_t **__restrict, int);
93 unsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, int);
94
95 long long wcstoll (const wchar_t *__restrict, wchar_t **__restrict, int);
96 unsigned long long wcstoull (const wchar_t *__restrict, wchar_t **__restrict, int);
97
98
99
100 int fwide (FILE *, int);
101
102
103 int wprintf (const wchar_t *__restrict, ...);
104 int fwprintf (FILE *__restrict, const wchar_t *__restrict, ...);
105 int swprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, ...);
106
107 int vwprintf (const wchar_t *__restrict, va_list);
108 int vfwprintf (FILE *__restrict, const wchar_t *__restrict, va_list);
109 int vswprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, va_list);
110
111 int wscanf (const wchar_t *__restrict, ...);
112 int fwscanf (FILE *__restrict, const wchar_t *__restrict, ...);
113 int swscanf (const wchar_t *__restrict, const wchar_t *__restrict, ...);
114
115 int vwscanf (const wchar_t *__restrict, va_list);
116 int vfwscanf (FILE *__restrict, const wchar_t *__restrict, va_list);
117 int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, va_list);
118
119 wint_t fgetwc (FILE *);
120 wint_t getwc (FILE *);
121 wint_t getwchar (void);
122
123 wint_t fputwc (wchar_t, FILE *);
124 wint_t putwc (wchar_t, FILE *);
125 wint_t putwchar (wchar_t);
126
127 wchar_t *fgetws (wchar_t *__restrict, int, FILE *__restrict);
128 int fputws (const wchar_t *__restrict, FILE *__restrict);
129
130 wint_t ungetwc (wint_t, FILE *);
131
132 struct tm;
133 size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict);
134
135 #undef iswdigit
136
137 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
138  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
139 FILE *open_wmemstream(wchar_t **, size_t *);
140 size_t mbsnrtowcs(wchar_t *__restrict, const char **__restrict, size_t, size_t, mbstate_t *__restrict);
141 size_t wcsnrtombs(char *__restrict, const wchar_t **__restrict, size_t, size_t, mbstate_t *__restrict);
142 wchar_t *wcsdup(const wchar_t *);
143 size_t wcsnlen (const wchar_t *, size_t);
144 wchar_t *wcpcpy (wchar_t *__restrict, const wchar_t *__restrict);
145 wchar_t *wcpncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
146 int wcscasecmp(const wchar_t *, const wchar_t *);
147 int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
148 int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
149 int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
150 int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
151 size_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t n, locale_t);
152 #endif
153
154 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
155 int wcwidth (wchar_t);
156 int wcswidth (const wchar_t *, size_t);
157 int       iswalnum(wint_t);
158 int       iswalpha(wint_t);
159 int       iswblank(wint_t);
160 int       iswcntrl(wint_t);
161 int       iswdigit(wint_t);
162 int       iswgraph(wint_t);
163 int       iswlower(wint_t);
164 int       iswprint(wint_t);
165 int       iswpunct(wint_t);
166 int       iswspace(wint_t);
167 int       iswupper(wint_t);
168 int       iswxdigit(wint_t);
169 int       iswctype(wint_t, wctype_t);
170 wint_t    towlower(wint_t);
171 wint_t    towupper(wint_t);
172 wctype_t  wctype(const char *);
173 #undef iswdigit
174 #define iswdigit(a) ((unsigned)(a)-'0' < 10)
175 #endif
176
177 #ifdef __cplusplus
178 }
179 #endif
180
181 #endif