1#ifndef _WCHAR_H 2#define _WCHAR_H 3 4#ifdef __cplusplus 5extern "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#define __NEED_off_t 17 18#if __STDC_VERSION__ < 201112L 19#define __NEED_off_t 20#define __NEED_struct__IO_FILE 21#endif 22 23#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 24 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 25#define __NEED_locale_t 26#define __NEED_va_list 27#endif 28 29#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 30#define __NEED_wctype_t 31#endif 32 33#include <bits/alltypes.h> 34 35#if L'\0'-1 > 0 36#define WCHAR_MAX (0xffffffffu+L'\0') 37#define WCHAR_MIN (0+L'\0') 38#else 39#define WCHAR_MAX (0x7fffffff+L'\0') 40#define WCHAR_MIN (-1-0x7fffffff+L'\0') 41#endif 42 43#ifdef __cplusplus 44#define NULL 0L 45#else 46#define NULL ((void*)0) 47#endif 48 49#undef WEOF 50#define WEOF 0xffffffffU 51 52wchar_t *wcscpy (wchar_t *__restrict, const wchar_t *__restrict); 53wchar_t *wcsncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t); 54 55wchar_t *wcscat (wchar_t *__restrict, const wchar_t *__restrict); 56wchar_t *wcsncat (wchar_t *__restrict, const wchar_t *__restrict, size_t); 57 58int wcscmp (const wchar_t *, const wchar_t *); 59int wcsncmp (const wchar_t *, const wchar_t *, size_t); 60 61int wcscoll(const wchar_t *, const wchar_t *); 62size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t); 63 64wchar_t *wcschr (const wchar_t *, wchar_t); 65wchar_t *wcsrchr (const wchar_t *, wchar_t); 66 67size_t wcscspn (const wchar_t *, const wchar_t *); 68size_t wcsspn (const wchar_t *, const wchar_t *); 69wchar_t *wcspbrk (const wchar_t *, const wchar_t *); 70 71wchar_t *wcstok (wchar_t *__restrict, const wchar_t *__restrict, wchar_t **__restrict); 72 73size_t wcslen (const wchar_t *); 74 75wchar_t *wcsstr (const wchar_t *__restrict, const wchar_t *__restrict); 76wchar_t *wcswcs (const wchar_t *, const wchar_t *); 77 78wchar_t *wmemchr (const wchar_t *, wchar_t, size_t); 79int wmemcmp (const wchar_t *, const wchar_t *, size_t); 80wchar_t *wmemcpy (wchar_t *__restrict, const wchar_t *__restrict, size_t); 81wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t); 82wchar_t *wmemset (wchar_t *, wchar_t, size_t); 83 84wint_t btowc (int); 85int wctob (wint_t); 86 87int mbsinit (const mbstate_t *); 88size_t mbrtowc (wchar_t *__restrict, const char *__restrict, size_t, mbstate_t *__restrict); 89size_t wcrtomb (char *__restrict, wchar_t, mbstate_t *__restrict); 90 91size_t mbrlen (const char *__restrict, size_t, mbstate_t *__restrict); 92 93size_t mbsrtowcs (wchar_t *__restrict, const char **__restrict, size_t, mbstate_t *__restrict); 94size_t wcsrtombs (char *__restrict, const wchar_t **__restrict, size_t, mbstate_t *__restrict); 95 96float wcstof (const wchar_t *__restrict, wchar_t **__restrict); 97double wcstod (const wchar_t *__restrict, wchar_t **__restrict); 98long double wcstold (const wchar_t *__restrict, wchar_t **__restrict); 99 100long wcstol (const wchar_t *__restrict, wchar_t **__restrict, int); 101unsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, int); 102 103long long wcstoll (const wchar_t *__restrict, wchar_t **__restrict, int); 104unsigned long long wcstoull (const wchar_t *__restrict, wchar_t **__restrict, int); 105 106 107 108int fwide (FILE *, int); 109 110 111int wprintf (const wchar_t *__restrict, ...); 112int fwprintf (FILE *__restrict, const wchar_t *__restrict, ...); 113int swprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, ...); 114 115int vwprintf (const wchar_t *__restrict, __isoc_va_list); 116int vfwprintf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list); 117int vswprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, __isoc_va_list); 118 119int wscanf (const wchar_t *__restrict, ...); 120int fwscanf (FILE *__restrict, const wchar_t *__restrict, ...); 121int swscanf (const wchar_t *__restrict, const wchar_t *__restrict, ...); 122 123int vwscanf (const wchar_t *__restrict, __isoc_va_list); 124int vfwscanf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list); 125int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, __isoc_va_list); 126 127wint_t fgetwc (FILE *); 128wint_t getwc (FILE *); 129wint_t getwchar (void); 130 131wint_t fputwc (wchar_t, FILE *); 132wint_t putwc (wchar_t, FILE *); 133wint_t putwchar (wchar_t); 134 135wchar_t *fgetws (wchar_t *__restrict, int, FILE *__restrict); 136int fputws (const wchar_t *__restrict, FILE *__restrict); 137 138wint_t ungetwc (wint_t, FILE *); 139 140struct tm; 141size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict); 142 143#undef iswdigit 144 145#if defined(_GNU_SOURCE) 146wint_t fgetwc_unlocked (FILE *); 147wint_t getwc_unlocked (FILE *); 148wint_t getwchar_unlocked (void); 149wint_t fputwc_unlocked (wchar_t, FILE *); 150wint_t putwc_unlocked (wchar_t, FILE *); 151wint_t putwchar_unlocked (wchar_t); 152wchar_t *fgetws_unlocked (wchar_t *__restrict, int, FILE *__restrict); 153int fputws_unlocked (const wchar_t *__restrict, FILE *__restrict); 154#endif 155 156#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 157size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t); 158#endif 159 160#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 161 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 162FILE *open_wmemstream(wchar_t **, size_t *); 163size_t mbsnrtowcs(wchar_t *__restrict, const char **__restrict, size_t, size_t, mbstate_t *__restrict); 164size_t wcsnrtombs(char *__restrict, const wchar_t **__restrict, size_t, size_t, mbstate_t *__restrict); 165wchar_t *wcsdup(const wchar_t *); 166size_t wcsnlen (const wchar_t *, size_t); 167wchar_t *wcpcpy (wchar_t *__restrict, const wchar_t *__restrict); 168wchar_t *wcpncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t); 169int wcscasecmp(const wchar_t *, const wchar_t *); 170int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); 171int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); 172int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); 173int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); 174size_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t, locale_t); 175#endif 176 177#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 178int wcwidth (wchar_t); 179int wcswidth (const wchar_t *, size_t); 180int iswalnum(wint_t); 181int iswalpha(wint_t); 182int iswblank(wint_t); 183int iswcntrl(wint_t); 184int iswdigit(wint_t); 185int iswgraph(wint_t); 186int iswlower(wint_t); 187int iswprint(wint_t); 188int iswpunct(wint_t); 189int iswspace(wint_t); 190int iswupper(wint_t); 191int iswxdigit(wint_t); 192int iswctype(wint_t, wctype_t); 193wint_t towlower(wint_t); 194wint_t towupper(wint_t); 195wctype_t wctype(const char *); 196 197#ifndef __cplusplus 198#undef iswdigit 199#define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10) 200#endif 201#endif 202 203#ifdef __cplusplus 204} 205#endif 206 207#endif 208