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) || defined(_BSD_SOURCE) 144 size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t); 145 #endif 146 147 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 148 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 149 FILE *open_wmemstream(wchar_t **, size_t *); 150 size_t mbsnrtowcs(wchar_t *__restrict, const char **__restrict, size_t, size_t, mbstate_t *__restrict); 151 size_t wcsnrtombs(char *__restrict, const wchar_t **__restrict, size_t, size_t, mbstate_t *__restrict); 152 wchar_t *wcsdup(const wchar_t *); 153 size_t wcsnlen (const wchar_t *, size_t); 154 wchar_t *wcpcpy (wchar_t *__restrict, const wchar_t *__restrict); 155 wchar_t *wcpncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t); 156 int wcscasecmp(const wchar_t *, const wchar_t *); 157 int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); 158 int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); 159 int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); 160 int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); 161 size_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t, locale_t); 162 #endif 163 164 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 165 int wcwidth (wchar_t); 166 int wcswidth (const wchar_t *, size_t); 167 int iswalnum(wint_t); 168 int iswalpha(wint_t); 169 int iswblank(wint_t); 170 int iswcntrl(wint_t); 171 int iswdigit(wint_t); 172 int iswgraph(wint_t); 173 int iswlower(wint_t); 174 int iswprint(wint_t); 175 int iswpunct(wint_t); 176 int iswspace(wint_t); 177 int iswupper(wint_t); 178 int iswxdigit(wint_t); 179 int iswctype(wint_t, wctype_t); 180 wint_t towlower(wint_t); 181 wint_t towupper(wint_t); 182 wctype_t wctype(const char *); 183 184 #ifndef __cplusplus 185 #undef iswdigit 186 #define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10) 187 #endif 188 #endif 189 190 #ifdef __cplusplus 191 } 192 #endif 193 194 #endif 195