17777dab0Sopenharmony_ci#ifndef _WCHAR_H
27777dab0Sopenharmony_ci#define _WCHAR_H
37777dab0Sopenharmony_ci
47777dab0Sopenharmony_ci#ifdef __cplusplus
57777dab0Sopenharmony_ciextern "C" {
67777dab0Sopenharmony_ci#endif
77777dab0Sopenharmony_ci
87777dab0Sopenharmony_ci#include <features.h>
97777dab0Sopenharmony_ci
107777dab0Sopenharmony_ci#define __NEED_FILE
117777dab0Sopenharmony_ci#define __NEED___isoc_va_list
127777dab0Sopenharmony_ci#define __NEED_size_t
137777dab0Sopenharmony_ci#define __NEED_wchar_t
147777dab0Sopenharmony_ci#define __NEED_wint_t
157777dab0Sopenharmony_ci#define __NEED_mbstate_t
167777dab0Sopenharmony_ci
177777dab0Sopenharmony_ci#if __STDC_VERSION__ < 201112L
187777dab0Sopenharmony_ci#define __NEED_struct__IO_FILE
197777dab0Sopenharmony_ci#endif
207777dab0Sopenharmony_ci
217777dab0Sopenharmony_ci#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
227777dab0Sopenharmony_ci || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
237777dab0Sopenharmony_ci#define __NEED_locale_t
247777dab0Sopenharmony_ci#define __NEED_va_list
257777dab0Sopenharmony_ci#endif
267777dab0Sopenharmony_ci
277777dab0Sopenharmony_ci#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
287777dab0Sopenharmony_ci#define __NEED_wctype_t
297777dab0Sopenharmony_ci#endif
307777dab0Sopenharmony_ci
317777dab0Sopenharmony_ci#include <bits/alltypes.h>
327777dab0Sopenharmony_ci
337777dab0Sopenharmony_ci#if L'\0'-1 > 0
347777dab0Sopenharmony_ci#define WCHAR_MAX (0xffffffffu+L'\0')
357777dab0Sopenharmony_ci#define WCHAR_MIN (0+L'\0')
367777dab0Sopenharmony_ci#else
377777dab0Sopenharmony_ci#define WCHAR_MAX (0x7fffffff+L'\0')
387777dab0Sopenharmony_ci#define WCHAR_MIN (-1-0x7fffffff+L'\0')
397777dab0Sopenharmony_ci#endif
407777dab0Sopenharmony_ci
417777dab0Sopenharmony_ci#ifdef __cplusplus
427777dab0Sopenharmony_ci#define NULL 0L
437777dab0Sopenharmony_ci#else
447777dab0Sopenharmony_ci#define NULL ((void*)0)
457777dab0Sopenharmony_ci#endif
467777dab0Sopenharmony_ci
477777dab0Sopenharmony_ci#undef WEOF
487777dab0Sopenharmony_ci#define WEOF 0xffffffffU
497777dab0Sopenharmony_ci
507777dab0Sopenharmony_ciwchar_t *wcscpy (wchar_t *__restrict, const wchar_t *__restrict);
517777dab0Sopenharmony_ciwchar_t *wcsncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
527777dab0Sopenharmony_ci
537777dab0Sopenharmony_ciwchar_t *wcscat (wchar_t *__restrict, const wchar_t *__restrict);
547777dab0Sopenharmony_ciwchar_t *wcsncat (wchar_t *__restrict, const wchar_t *__restrict, size_t);
557777dab0Sopenharmony_ci
567777dab0Sopenharmony_ciint wcscmp (const wchar_t *, const wchar_t *);
577777dab0Sopenharmony_ciint wcsncmp (const wchar_t *, const wchar_t *, size_t);
587777dab0Sopenharmony_ci
597777dab0Sopenharmony_ciint wcscoll(const wchar_t *, const wchar_t *);
607777dab0Sopenharmony_cisize_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t);
617777dab0Sopenharmony_ci
627777dab0Sopenharmony_ciwchar_t *wcschr (const wchar_t *, wchar_t);
637777dab0Sopenharmony_ciwchar_t *wcsrchr (const wchar_t *, wchar_t);
647777dab0Sopenharmony_ci
657777dab0Sopenharmony_cisize_t wcscspn (const wchar_t *, const wchar_t *);
667777dab0Sopenharmony_cisize_t wcsspn (const wchar_t *, const wchar_t *);
677777dab0Sopenharmony_ciwchar_t *wcspbrk (const wchar_t *, const wchar_t *);
687777dab0Sopenharmony_ci
697777dab0Sopenharmony_ciwchar_t *wcstok (wchar_t *__restrict, const wchar_t *__restrict, wchar_t **__restrict);
707777dab0Sopenharmony_ci
717777dab0Sopenharmony_cisize_t wcslen (const wchar_t *);
727777dab0Sopenharmony_ci
737777dab0Sopenharmony_ciwchar_t *wcsstr (const wchar_t *__restrict, const wchar_t *__restrict);
747777dab0Sopenharmony_ciwchar_t *wcswcs (const wchar_t *, const wchar_t *);
757777dab0Sopenharmony_ci
767777dab0Sopenharmony_ciwchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
777777dab0Sopenharmony_ciint wmemcmp (const wchar_t *, const wchar_t *, size_t);
787777dab0Sopenharmony_ciwchar_t *wmemcpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
797777dab0Sopenharmony_ciwchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
807777dab0Sopenharmony_ciwchar_t *wmemset (wchar_t *, wchar_t, size_t);
817777dab0Sopenharmony_ci
827777dab0Sopenharmony_ciwint_t btowc (int);
837777dab0Sopenharmony_ciint wctob (wint_t);
847777dab0Sopenharmony_ci
857777dab0Sopenharmony_ciint mbsinit (const mbstate_t *);
867777dab0Sopenharmony_cisize_t mbrtowc (wchar_t *__restrict, const char *__restrict, size_t, mbstate_t *__restrict);
877777dab0Sopenharmony_cisize_t wcrtomb (char *__restrict, wchar_t, mbstate_t *__restrict);
887777dab0Sopenharmony_ci
897777dab0Sopenharmony_cisize_t mbrlen (const char *__restrict, size_t, mbstate_t *__restrict);
907777dab0Sopenharmony_ci
917777dab0Sopenharmony_cisize_t mbsrtowcs (wchar_t *__restrict, const char **__restrict, size_t, mbstate_t *__restrict);
927777dab0Sopenharmony_cisize_t wcsrtombs (char *__restrict, const wchar_t **__restrict, size_t, mbstate_t *__restrict);
937777dab0Sopenharmony_ci
947777dab0Sopenharmony_cifloat wcstof (const wchar_t *__restrict, wchar_t **__restrict);
957777dab0Sopenharmony_cidouble wcstod (const wchar_t *__restrict, wchar_t **__restrict);
967777dab0Sopenharmony_cilong double wcstold (const wchar_t *__restrict, wchar_t **__restrict);
977777dab0Sopenharmony_ci
987777dab0Sopenharmony_cilong wcstol (const wchar_t *__restrict, wchar_t **__restrict, int);
997777dab0Sopenharmony_ciunsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, int);
1007777dab0Sopenharmony_ci
1017777dab0Sopenharmony_cilong long wcstoll (const wchar_t *__restrict, wchar_t **__restrict, int);
1027777dab0Sopenharmony_ciunsigned long long wcstoull (const wchar_t *__restrict, wchar_t **__restrict, int);
1037777dab0Sopenharmony_ci
1047777dab0Sopenharmony_ci
1057777dab0Sopenharmony_ci
1067777dab0Sopenharmony_ciint fwide (FILE *, int);
1077777dab0Sopenharmony_ci
1087777dab0Sopenharmony_ci
1097777dab0Sopenharmony_ciint wprintf (const wchar_t *__restrict, ...);
1107777dab0Sopenharmony_ciint fwprintf (FILE *__restrict, const wchar_t *__restrict, ...);
1117777dab0Sopenharmony_ciint swprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, ...);
1127777dab0Sopenharmony_ci
1137777dab0Sopenharmony_ciint vwprintf (const wchar_t *__restrict, __isoc_va_list);
1147777dab0Sopenharmony_ciint vfwprintf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
1157777dab0Sopenharmony_ciint vswprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, __isoc_va_list);
1167777dab0Sopenharmony_ci
1177777dab0Sopenharmony_ciint wscanf (const wchar_t *__restrict, ...);
1187777dab0Sopenharmony_ciint fwscanf (FILE *__restrict, const wchar_t *__restrict, ...);
1197777dab0Sopenharmony_ciint swscanf (const wchar_t *__restrict, const wchar_t *__restrict, ...);
1207777dab0Sopenharmony_ci
1217777dab0Sopenharmony_ciint vwscanf (const wchar_t *__restrict, __isoc_va_list);
1227777dab0Sopenharmony_ciint vfwscanf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
1237777dab0Sopenharmony_ciint vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, __isoc_va_list);
1247777dab0Sopenharmony_ci
1257777dab0Sopenharmony_ciwint_t fgetwc (FILE *);
1267777dab0Sopenharmony_ciwint_t getwc (FILE *);
1277777dab0Sopenharmony_ciwint_t getwchar (void);
1287777dab0Sopenharmony_ci
1297777dab0Sopenharmony_ciwint_t fputwc (wchar_t, FILE *);
1307777dab0Sopenharmony_ciwint_t putwc (wchar_t, FILE *);
1317777dab0Sopenharmony_ciwint_t putwchar (wchar_t);
1327777dab0Sopenharmony_ci
1337777dab0Sopenharmony_ciwchar_t *fgetws (wchar_t *__restrict, int, FILE *__restrict);
1347777dab0Sopenharmony_ciint fputws (const wchar_t *__restrict, FILE *__restrict);
1357777dab0Sopenharmony_ci
1367777dab0Sopenharmony_ciwint_t ungetwc (wint_t, FILE *);
1377777dab0Sopenharmony_ci
1387777dab0Sopenharmony_cistruct tm;
1397777dab0Sopenharmony_cisize_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict);
1407777dab0Sopenharmony_ci
1417777dab0Sopenharmony_ci#undef iswdigit
1427777dab0Sopenharmony_ci
1437777dab0Sopenharmony_ci#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
1447777dab0Sopenharmony_cisize_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t);
1457777dab0Sopenharmony_ci
1467777dab0Sopenharmony_ci/**
1477777dab0Sopenharmony_ci * @brief converts the input string const wchar_t * to a double-precision value
1487777dab0Sopenharmony_ci * @param const wchar_t * Null-terminated string to convert
1497777dab0Sopenharmony_ci * @param wchar_t ** Pointer to character that stops scan
1507777dab0Sopenharmony_ci * @param locale_t The locale to use
1517777dab0Sopenharmony_ci * @return double-precision value converted from the input string
1527777dab0Sopenharmony_ci * @since 12
1537777dab0Sopenharmony_ci */
1547777dab0Sopenharmony_cidouble wcstod_l (const wchar_t *__restrict, wchar_t **__restrict, locale_t);
1557777dab0Sopenharmony_ci#endif
1567777dab0Sopenharmony_ci
1577777dab0Sopenharmony_ci#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
1587777dab0Sopenharmony_ci || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)  || defined(_BSD_SOURCE)
1597777dab0Sopenharmony_ciFILE *open_wmemstream(wchar_t **, size_t *);
1607777dab0Sopenharmony_cisize_t mbsnrtowcs(wchar_t *__restrict, const char **__restrict, size_t, size_t, mbstate_t *__restrict);
1617777dab0Sopenharmony_cisize_t wcsnrtombs(char *__restrict, const wchar_t **__restrict, size_t, size_t, mbstate_t *__restrict);
1627777dab0Sopenharmony_ciwchar_t *wcsdup(const wchar_t *);
1637777dab0Sopenharmony_cisize_t wcsnlen (const wchar_t *, size_t);
1647777dab0Sopenharmony_ciwchar_t *wcpcpy (wchar_t *__restrict, const wchar_t *__restrict);
1657777dab0Sopenharmony_ciwchar_t *wcpncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
1667777dab0Sopenharmony_ciint wcscasecmp(const wchar_t *, const wchar_t *);
1677777dab0Sopenharmony_ciint wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
1687777dab0Sopenharmony_ciint wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
1697777dab0Sopenharmony_ciint wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
1707777dab0Sopenharmony_ciint wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
1717777dab0Sopenharmony_cisize_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t, locale_t);
1727777dab0Sopenharmony_ci#endif
1737777dab0Sopenharmony_ci
1747777dab0Sopenharmony_ci#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
1757777dab0Sopenharmony_ciint wcwidth (wchar_t);
1767777dab0Sopenharmony_ciint wcswidth (const wchar_t *, size_t);
1777777dab0Sopenharmony_ciint       iswalnum(wint_t);
1787777dab0Sopenharmony_ciint       iswalpha(wint_t);
1797777dab0Sopenharmony_ciint       iswblank(wint_t);
1807777dab0Sopenharmony_ciint       iswcntrl(wint_t);
1817777dab0Sopenharmony_ciint       iswdigit(wint_t);
1827777dab0Sopenharmony_ciint       iswgraph(wint_t);
1837777dab0Sopenharmony_ciint       iswlower(wint_t);
1847777dab0Sopenharmony_ciint       iswprint(wint_t);
1857777dab0Sopenharmony_ciint       iswpunct(wint_t);
1867777dab0Sopenharmony_ciint       iswspace(wint_t);
1877777dab0Sopenharmony_ciint       iswupper(wint_t);
1887777dab0Sopenharmony_ciint       iswxdigit(wint_t);
1897777dab0Sopenharmony_ciint       iswctype(wint_t, wctype_t);
1907777dab0Sopenharmony_ciwint_t    towlower(wint_t);
1917777dab0Sopenharmony_ciwint_t    towupper(wint_t);
1927777dab0Sopenharmony_ciwctype_t  wctype(const char *);
1937777dab0Sopenharmony_ci
1947777dab0Sopenharmony_ci#ifndef __cplusplus
1957777dab0Sopenharmony_ci#undef iswdigit
1967777dab0Sopenharmony_ci#define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10)
1977777dab0Sopenharmony_ci#endif
1987777dab0Sopenharmony_ci#endif
1997777dab0Sopenharmony_ci
2007777dab0Sopenharmony_ci#ifdef __cplusplus
2017777dab0Sopenharmony_ci}
2027777dab0Sopenharmony_ci#endif
2037777dab0Sopenharmony_ci
2047777dab0Sopenharmony_ci#endif
205