Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _WCHAR_H |
| 2 | #define _WCHAR_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Rich Felker | c1a9658 | 2012-09-07 23:13:55 -0400 | [diff] [blame] | 8 | #include <features.h> |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 9 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 10 | #define __NEED_FILE |
| 11 | #define __NEED_va_list |
| 12 | #define __NEED_size_t |
| 13 | #define __NEED_wchar_t |
| 14 | #define __NEED_wint_t |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 15 | |
Rich Felker | e0614f7 | 2012-03-01 23:24:45 -0500 | [diff] [blame] | 16 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ |
| 17 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
| 18 | #define __NEED_locale_t |
| 19 | #endif |
| 20 | |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 21 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 22 | #define __NEED_wctype_t |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 23 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 24 | |
| 25 | #include <bits/alltypes.h> |
| 26 | |
Rich Felker | 224c7a3 | 2011-09-19 17:39:51 -0400 | [diff] [blame] | 27 | #include <bits/wchar.h> |
| 28 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 29 | #undef NULL |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 30 | #ifdef __cplusplus |
| 31 | #define NULL 0 |
| 32 | #else |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 33 | #define NULL ((void*)0) |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 34 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 35 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 36 | #undef WEOF |
| 37 | #define WEOF (-1) |
| 38 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 39 | typedef struct |
| 40 | { |
| 41 | unsigned __opaque1, __opaque2; |
| 42 | } mbstate_t; |
| 43 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 44 | wchar_t *wcscpy (wchar_t *__restrict, const wchar_t *__restrict); |
| 45 | wchar_t *wcsncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 46 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 47 | wchar_t *wcscat (wchar_t *__restrict, const wchar_t *__restrict); |
| 48 | wchar_t *wcsncat (wchar_t *__restrict, const wchar_t *__restrict, size_t); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 49 | |
| 50 | int wcscmp (const wchar_t *, const wchar_t *); |
| 51 | int wcsncmp (const wchar_t *, const wchar_t *, size_t); |
| 52 | |
Rich Felker | 1c1aa32 | 2011-03-29 18:30:27 -0400 | [diff] [blame] | 53 | int wcscoll(const wchar_t *, const wchar_t *); |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 54 | size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t n); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 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 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 63 | wchar_t *wcstok (wchar_t *__restrict, const wchar_t *__restrict, wchar_t **__restrict); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 64 | |
| 65 | size_t wcslen (const wchar_t *); |
| 66 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 67 | wchar_t *wcsstr (const wchar_t *__restrict, const wchar_t *__restrict); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 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); |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 72 | wchar_t *wmemcpy (wchar_t *__restrict, const wchar_t *__restrict, size_t); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 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 *); |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 82 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 83 | size_t mbrlen (const char *__restrict, size_t, mbstate_t *__restrict); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 84 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 87 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 91 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 92 | long wcstol (const wchar_t *__restrict, wchar_t **__restrict, int); |
| 93 | unsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, int); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 94 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 97 | |
| 98 | |
| 99 | |
| 100 | int fwide (FILE *, int); |
| 101 | |
| 102 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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, ...); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 106 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 110 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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, ...); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 114 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 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 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 127 | wchar_t *fgetws (wchar_t *__restrict, int, FILE *__restrict); |
| 128 | int fputws (const wchar_t *__restrict, FILE *__restrict); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 129 | |
| 130 | wint_t ungetwc (wint_t, FILE *); |
| 131 | |
| 132 | struct tm; |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 133 | size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 134 | |
| 135 | #undef iswdigit |
| 136 | |
Rich Felker | c74d306 | 2011-05-30 13:32:40 -0400 | [diff] [blame] | 137 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ |
| 138 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
Rich Felker | 1461e02 | 2011-09-03 19:49:46 -0400 | [diff] [blame] | 139 | FILE *open_wmemstream(wchar_t **, size_t *); |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 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); |
Rich Felker | e0614f7 | 2012-03-01 23:24:45 -0500 | [diff] [blame] | 142 | wchar_t *wcsdup(const wchar_t *); |
| 143 | size_t wcsnlen (const wchar_t *, size_t); |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 144 | wchar_t *wcpcpy (wchar_t *__restrict, const wchar_t *__restrict); |
| 145 | wchar_t *wcpncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t); |
Rich Felker | e0614f7 | 2012-03-01 23:24:45 -0500 | [diff] [blame] | 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); |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 151 | size_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t n, locale_t); |
Rich Felker | c74d306 | 2011-05-30 13:32:40 -0400 | [diff] [blame] | 152 | #endif |
| 153 | |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 154 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
| 155 | int wcwidth (wchar_t); |
| 156 | int wcswidth (const wchar_t *, size_t); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 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 *); |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 173 | #undef iswdigit |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 174 | #define iswdigit(a) ((unsigned)(a)-'0' < 10) |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 175 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 176 | |
| 177 | #ifdef __cplusplus |
| 178 | } |
| 179 | #endif |
| 180 | |
| 181 | #endif |