// -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_CWCHAR #define _LIBCPP_CWCHAR /* cwchar synopsis Macros: NULL WCHAR_MAX WCHAR_MIN WEOF namespace std { Types: mbstate_t size_t tm wint_t int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99 int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99 int vwprintf(const wchar_t* restrict format, va_list arg); int vwscanf(const wchar_t* restrict format, va_list arg); // C99 int wprintf(const wchar_t* restrict format, ...); int wscanf(const wchar_t* restrict format, ...); wint_t fgetwc(FILE* stream); wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); wint_t fputwc(wchar_t c, FILE* stream); int fputws(const wchar_t* restrict s, FILE* restrict stream); int fwide(FILE* stream, int mode); wint_t getwc(FILE* stream); wint_t getwchar(); wint_t putwc(wchar_t c, FILE* stream); wint_t putwchar(wchar_t c); wint_t ungetwc(wint_t c, FILE* stream); double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); int wcscmp(const wchar_t* s1, const wchar_t* s2); int wcscoll(const wchar_t* s1, const wchar_t* s2); int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); const wchar_t* wcschr(const wchar_t* s, wchar_t c); wchar_t* wcschr( wchar_t* s, wchar_t c); size_t wcscspn(const wchar_t* s1, const wchar_t* s2); size_t wcslen(const wchar_t* s); const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2); const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); wchar_t* wcsrchr( wchar_t* s, wchar_t c); size_t wcsspn(const wchar_t* s1, const wchar_t* s2); const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2); wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n); int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, const tm* restrict timeptr); wint_t btowc(int c); int wctob(wint_t c); int mbsinit(const mbstate_t* ps); size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, mbstate_t* restrict ps); size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, mbstate_t* restrict ps); } // std */ #include <__config> #include <__type_traits/copy_cv.h> #include <__type_traits/is_constant_evaluated.h> #include <__type_traits/is_equality_comparable.h> #include <__type_traits/is_same.h> #include <__type_traits/remove_cv.h> #include <cwctype> #include <wchar.h> #ifndef _LIBCPP_WCHAR_H # error <cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. \ This usually means that your header search paths are not configured properly. \ The header search paths should contain the C++ Standard Library headers before \ any C Standard Library, and you are probably using compiler flags that make that \ not be the case. #endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD mbstate_t _LIBCPP_USING_IF_EXISTS; size_t _LIBCPP_USING_IF_EXISTS; tm _LIBCPP_USING_IF_EXISTS; wint_t _LIBCPP_USING_IF_EXISTS; FILE _LIBCPP_USING_IF_EXISTS; fwprintf _LIBCPP_USING_IF_EXISTS; fwscanf _LIBCPP_USING_IF_EXISTS; swprintf _LIBCPP_USING_IF_EXISTS; vfwprintf _LIBCPP_USING_IF_EXISTS; vswprintf _LIBCPP_USING_IF_EXISTS; swscanf _LIBCPP_USING_IF_EXISTS; vfwscanf _LIBCPP_USING_IF_EXISTS; vswscanf _LIBCPP_USING_IF_EXISTS; fgetwc _LIBCPP_USING_IF_EXISTS; fgetws _LIBCPP_USING_IF_EXISTS; fputwc _LIBCPP_USING_IF_EXISTS; fputws _LIBCPP_USING_IF_EXISTS; fwide _LIBCPP_USING_IF_EXISTS; getwc _LIBCPP_USING_IF_EXISTS; putwc _LIBCPP_USING_IF_EXISTS; ungetwc _LIBCPP_USING_IF_EXISTS; wcstod _LIBCPP_USING_IF_EXISTS; wcstof _LIBCPP_USING_IF_EXISTS; wcstold _LIBCPP_USING_IF_EXISTS; wcstol _LIBCPP_USING_IF_EXISTS; wcstoll _LIBCPP_USING_IF_EXISTS; wcstoul _LIBCPP_USING_IF_EXISTS; wcstoull _LIBCPP_USING_IF_EXISTS; wcscpy _LIBCPP_USING_IF_EXISTS; wcsncpy _LIBCPP_USING_IF_EXISTS; wcscat _LIBCPP_USING_IF_EXISTS; wcsncat _LIBCPP_USING_IF_EXISTS; wcscmp _LIBCPP_USING_IF_EXISTS; wcscoll _LIBCPP_USING_IF_EXISTS; wcsncmp _LIBCPP_USING_IF_EXISTS; wcsxfrm _LIBCPP_USING_IF_EXISTS; wcschr _LIBCPP_USING_IF_EXISTS; wcspbrk _LIBCPP_USING_IF_EXISTS; wcsrchr _LIBCPP_USING_IF_EXISTS; wcsstr _LIBCPP_USING_IF_EXISTS; wmemchr _LIBCPP_USING_IF_EXISTS; wcscspn _LIBCPP_USING_IF_EXISTS; wcslen _LIBCPP_USING_IF_EXISTS; wcsspn _LIBCPP_USING_IF_EXISTS; wcstok _LIBCPP_USING_IF_EXISTS; wmemcmp _LIBCPP_USING_IF_EXISTS; wmemcpy _LIBCPP_USING_IF_EXISTS; wmemmove _LIBCPP_USING_IF_EXISTS; wmemset _LIBCPP_USING_IF_EXISTS; wcsftime _LIBCPP_USING_IF_EXISTS; btowc _LIBCPP_USING_IF_EXISTS; wctob _LIBCPP_USING_IF_EXISTS; mbsinit _LIBCPP_USING_IF_EXISTS; mbrlen _LIBCPP_USING_IF_EXISTS; mbrtowc _LIBCPP_USING_IF_EXISTS; wcrtomb _LIBCPP_USING_IF_EXISTS; mbsrtowcs _LIBCPP_USING_IF_EXISTS; wcsrtombs _LIBCPP_USING_IF_EXISTS; getwchar _LIBCPP_USING_IF_EXISTS; vwscanf _LIBCPP_USING_IF_EXISTS; wscanf _LIBCPP_USING_IF_EXISTS; putwchar _LIBCPP_USING_IF_EXISTS; vwprintf _LIBCPP_USING_IF_EXISTS; wprintf _LIBCPP_USING_IF_EXISTS; inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_wcslen(const wchar_t* __str) { … } inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __constexpr_wmemcmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __count) { … } template <class _Tp, class _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp* __str, _Up __value, size_t __count) { … } _LIBCPP_END_NAMESPACE_STD #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <cstddef> #endif #endif // _LIBCPP_CWCHAR