first attempt at enabling stack protector support
[musl.git] / include / wchar.h
blob12ddd4f49a632cc7a5b7bace935258a522be9615
1 #ifndef _WCHAR_H
2 #define _WCHAR_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 #define __NEED_FILE
9 #define __NEED_va_list
10 #define __NEED_size_t
11 #define __NEED_wchar_t
12 #define __NEED_wint_t
14 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
15 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
16 #define __NEED_locale_t
17 #endif
19 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
20 #define __NEED_wctype_t
21 #endif
23 #include <bits/alltypes.h>
25 #include <bits/wchar.h>
27 #undef NULL
28 #ifdef __cplusplus
29 #define NULL 0
30 #else
31 #define NULL ((void*)0)
32 #endif
34 #undef WEOF
35 #define WEOF (-1)
37 typedef struct
39 unsigned __opaque1, __opaque2;
40 } mbstate_t;
42 wchar_t *wcscpy (wchar_t *, const wchar_t *);
43 wchar_t *wcsncpy (wchar_t *, const wchar_t *, size_t);
45 wchar_t *wcscat (wchar_t *, const wchar_t *);
46 wchar_t *wcsncat (wchar_t *, const wchar_t *, size_t);
48 int wcscmp (const wchar_t *, const wchar_t *);
49 int wcsncmp (const wchar_t *, const wchar_t *, size_t);
51 int wcscoll(const wchar_t *, const wchar_t *);
52 size_t wcsxfrm (wchar_t *, const wchar_t *, size_t n);
54 wchar_t *wcschr (const wchar_t *, wchar_t);
55 wchar_t *wcsrchr (const wchar_t *, wchar_t);
57 size_t wcscspn (const wchar_t *, const wchar_t *);
58 size_t wcsspn (const wchar_t *, const wchar_t *);
59 wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
61 wchar_t *wcstok (wchar_t *, const wchar_t *, wchar_t **);
63 size_t wcslen (const wchar_t *);
65 wchar_t *wcsstr (const wchar_t *, const wchar_t *);
66 wchar_t *wcswcs (const wchar_t *, const wchar_t *);
68 wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
69 int wmemcmp (const wchar_t *, const wchar_t *, size_t);
70 wchar_t *wmemcpy (wchar_t *, const wchar_t *, size_t);
71 wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
72 wchar_t *wmemset (wchar_t *, wchar_t, size_t);
74 wint_t btowc (int);
75 int wctob (wint_t);
77 int mbsinit (const mbstate_t *);
78 size_t mbrtowc (wchar_t *, const char *, size_t, mbstate_t *);
79 size_t wcrtomb (char *, wchar_t, mbstate_t *);
81 size_t mbrlen (const char *, size_t, mbstate_t *);
83 size_t mbsrtowcs (wchar_t *, const char **, size_t, mbstate_t *);
84 size_t wcsrtombs (char *, const wchar_t **, size_t, mbstate_t *);
86 float wcstof (const wchar_t *, wchar_t **);
87 double wcstod (const wchar_t *, wchar_t **);
88 long double wcstold (const wchar_t *, wchar_t **);
90 long wcstol (const wchar_t *, wchar_t **, int);
91 unsigned long wcstoul (const wchar_t *, wchar_t **, int);
93 long long wcstoll (const wchar_t *, wchar_t **, int);
94 unsigned long long wcstoull (const wchar_t *, wchar_t **, int);
98 int fwide (FILE *, int);
101 int wprintf (const wchar_t *, ...);
102 int fwprintf (FILE *, const wchar_t *, ...);
103 int swprintf (wchar_t *, size_t, const wchar_t *, ...);
105 int vwprintf (const wchar_t *, va_list);
106 int vfwprintf (FILE *, const wchar_t *, va_list);
107 int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
109 int wscanf (const wchar_t *, ...);
110 int fwscanf (FILE *, const wchar_t *, ...);
111 int swscanf (const wchar_t *, const wchar_t *, ...);
113 int vwscanf (const wchar_t *, va_list);
114 int vfwscanf (FILE *, const wchar_t *, va_list);
115 int vswscanf (const wchar_t *, const wchar_t *, va_list);
117 wint_t fgetwc (FILE *);
118 wint_t getwc (FILE *);
119 wint_t getwchar (void);
121 wint_t fputwc (wchar_t, FILE *);
122 wint_t putwc (wchar_t, FILE *);
123 wint_t putwchar (wchar_t);
125 wchar_t *fgetws (wchar_t *, int, FILE *);
126 int fputws (const wchar_t *, FILE *);
128 wint_t ungetwc (wint_t, FILE *);
130 struct tm;
131 size_t wcsftime (wchar_t *, size_t, const wchar_t *, const struct tm *);
133 #undef iswdigit
135 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
136 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
137 FILE *open_wmemstream(wchar_t **, size_t *);
138 size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, mbstate_t *);
139 size_t wcsnrtombs(char *, const wchar_t **, size_t, size_t, mbstate_t *);
140 wchar_t *wcsdup(const wchar_t *);
141 size_t wcsnlen (const wchar_t *, size_t);
142 wchar_t *wcpcpy (wchar_t *, const wchar_t *);
143 wchar_t *wcpncpy (wchar_t *, const wchar_t *, size_t);
144 int wcscasecmp(const wchar_t *, const wchar_t *);
145 int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
146 int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
147 int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
148 int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
149 size_t wcsxfrm_l(wchar_t *, const wchar_t *, size_t n, locale_t);
150 #endif
152 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
153 int wcwidth (wchar_t);
154 int wcswidth (const wchar_t *, size_t);
155 int iswalnum(wint_t);
156 int iswalpha(wint_t);
157 int iswblank(wint_t);
158 int iswcntrl(wint_t);
159 int iswdigit(wint_t);
160 int iswgraph(wint_t);
161 int iswlower(wint_t);
162 int iswprint(wint_t);
163 int iswpunct(wint_t);
164 int iswspace(wint_t);
165 int iswupper(wint_t);
166 int iswxdigit(wint_t);
167 int iswctype(wint_t, wctype_t);
168 wint_t towlower(wint_t);
169 wint_t towupper(wint_t);
170 wctype_t wctype(const char *);
171 #undef iswdigit
172 #define iswdigit(a) ((unsigned)(a)-'0' < 10)
173 #endif
175 #ifdef __cplusplus
177 #endif
179 #endif