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 | |
| 8 | #define __NEED_FILE |
| 9 | #define __NEED_va_list |
| 10 | #define __NEED_size_t |
| 11 | #define __NEED_wchar_t |
| 12 | #define __NEED_wint_t |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 13 | |
Rich Felker | e0614f7 | 2012-03-01 23:24:45 -0500 | [diff] [blame^] | 14 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ |
| 15 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
| 16 | #define __NEED_locale_t |
| 17 | #endif |
| 18 | |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 19 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 20 | #define __NEED_wctype_t |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 21 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 22 | |
| 23 | #include <bits/alltypes.h> |
| 24 | |
Rich Felker | 224c7a3 | 2011-09-19 17:39:51 -0400 | [diff] [blame] | 25 | #include <bits/wchar.h> |
| 26 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 27 | #undef NULL |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 28 | #ifdef __cplusplus |
| 29 | #define NULL 0 |
| 30 | #else |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 31 | #define NULL ((void*)0) |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 32 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 33 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 34 | #undef WEOF |
| 35 | #define WEOF (-1) |
| 36 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 37 | typedef struct |
| 38 | { |
| 39 | unsigned __opaque1, __opaque2; |
| 40 | } mbstate_t; |
| 41 | |
| 42 | wchar_t *wcscpy (wchar_t *, const wchar_t *); |
| 43 | wchar_t *wcsncpy (wchar_t *, const wchar_t *, size_t); |
| 44 | |
| 45 | wchar_t *wcscat (wchar_t *, const wchar_t *); |
| 46 | wchar_t *wcsncat (wchar_t *, const wchar_t *, size_t); |
| 47 | |
| 48 | int wcscmp (const wchar_t *, const wchar_t *); |
| 49 | int wcsncmp (const wchar_t *, const wchar_t *, size_t); |
| 50 | |
Rich Felker | 1c1aa32 | 2011-03-29 18:30:27 -0400 | [diff] [blame] | 51 | int wcscoll(const wchar_t *, const wchar_t *); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 52 | size_t wcsxfrm (wchar_t *, const wchar_t *, size_t n); |
| 53 | |
| 54 | wchar_t *wcschr (const wchar_t *, wchar_t); |
| 55 | wchar_t *wcsrchr (const wchar_t *, wchar_t); |
| 56 | |
| 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 *); |
| 60 | |
| 61 | wchar_t *wcstok (wchar_t *, const wchar_t *, wchar_t **); |
| 62 | |
| 63 | size_t wcslen (const wchar_t *); |
| 64 | |
| 65 | wchar_t *wcsstr (const wchar_t *, const wchar_t *); |
| 66 | wchar_t *wcswcs (const wchar_t *, const wchar_t *); |
| 67 | |
| 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); |
| 73 | |
| 74 | wint_t btowc (int); |
| 75 | int wctob (wint_t); |
| 76 | |
| 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 *); |
| 80 | |
| 81 | size_t mbrlen (const char *, size_t, mbstate_t *); |
| 82 | |
| 83 | size_t mbsrtowcs (wchar_t *, const char **, size_t, mbstate_t *); |
| 84 | size_t wcsrtombs (char *, const wchar_t **, size_t, mbstate_t *); |
| 85 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 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 **); |
| 89 | |
| 90 | long wcstol (const wchar_t *, wchar_t **, int); |
| 91 | unsigned long wcstoul (const wchar_t *, wchar_t **, int); |
| 92 | |
| 93 | long long wcstoll (const wchar_t *, wchar_t **, int); |
| 94 | unsigned long long wcstoull (const wchar_t *, wchar_t **, int); |
| 95 | |
| 96 | |
| 97 | |
| 98 | int fwide (FILE *, int); |
| 99 | |
| 100 | |
| 101 | int wprintf (const wchar_t *, ...); |
| 102 | int fwprintf (FILE *, const wchar_t *, ...); |
Rich Felker | e18b563 | 2011-03-18 09:19:09 -0400 | [diff] [blame] | 103 | int swprintf (wchar_t *, size_t, const wchar_t *, ...); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 104 | |
| 105 | int vwprintf (const wchar_t *, va_list); |
| 106 | int vfwprintf (FILE *, const wchar_t *, va_list); |
Rich Felker | e18b563 | 2011-03-18 09:19:09 -0400 | [diff] [blame] | 107 | int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 108 | |
| 109 | int wscanf (const wchar_t *, ...); |
| 110 | int fwscanf (FILE *, const wchar_t *, ...); |
| 111 | int swscanf (const wchar_t *, const wchar_t *, ...); |
| 112 | |
| 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); |
| 116 | |
| 117 | wint_t fgetwc (FILE *); |
| 118 | wint_t getwc (FILE *); |
| 119 | wint_t getwchar (void); |
| 120 | |
| 121 | wint_t fputwc (wchar_t, FILE *); |
| 122 | wint_t putwc (wchar_t, FILE *); |
| 123 | wint_t putwchar (wchar_t); |
| 124 | |
| 125 | wchar_t *fgetws (wchar_t *, int, FILE *); |
| 126 | int fputws (const wchar_t *, FILE *); |
| 127 | |
| 128 | wint_t ungetwc (wint_t, FILE *); |
| 129 | |
| 130 | struct tm; |
| 131 | size_t wcsftime (wchar_t *, size_t, const wchar_t *, const struct tm *); |
| 132 | |
| 133 | #undef iswdigit |
| 134 | |
Rich Felker | c74d306 | 2011-05-30 13:32:40 -0400 | [diff] [blame] | 135 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ |
| 136 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
Rich Felker | 1461e02 | 2011-09-03 19:49:46 -0400 | [diff] [blame] | 137 | FILE *open_wmemstream(wchar_t **, size_t *); |
Rich Felker | c74d306 | 2011-05-30 13:32:40 -0400 | [diff] [blame] | 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 *); |
Rich Felker | e0614f7 | 2012-03-01 23:24:45 -0500 | [diff] [blame^] | 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); |
Rich Felker | c74d306 | 2011-05-30 13:32:40 -0400 | [diff] [blame] | 150 | #endif |
| 151 | |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 152 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) |
| 153 | int wcwidth (wchar_t); |
| 154 | int wcswidth (const wchar_t *, size_t); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 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 *); |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 171 | #undef iswdigit |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 172 | #define iswdigit(a) ((unsigned)(a)-'0' < 10) |
Rich Felker | c247ebd | 2011-02-14 19:33:11 -0500 | [diff] [blame] | 173 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 174 | |
| 175 | #ifdef __cplusplus |
| 176 | } |
| 177 | #endif |
| 178 | |
| 179 | #endif |