10b57cec5SDimitry Andric// -*- C++ -*- 20b57cec5SDimitry Andric//===--------------------------- cwchar -----------------------------------===// 30b57cec5SDimitry Andric// 40b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 50b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 60b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 70b57cec5SDimitry Andric// 80b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 90b57cec5SDimitry Andric 100b57cec5SDimitry Andric#ifndef _LIBCPP_CWCHAR 110b57cec5SDimitry Andric#define _LIBCPP_CWCHAR 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric/* 140b57cec5SDimitry Andric cwchar synopsis 150b57cec5SDimitry Andric 160b57cec5SDimitry AndricMacros: 170b57cec5SDimitry Andric 180b57cec5SDimitry Andric NULL 190b57cec5SDimitry Andric WCHAR_MAX 200b57cec5SDimitry Andric WCHAR_MIN 210b57cec5SDimitry Andric WEOF 220b57cec5SDimitry Andric 230b57cec5SDimitry Andricnamespace std 240b57cec5SDimitry Andric{ 250b57cec5SDimitry Andric 260b57cec5SDimitry AndricTypes: 270b57cec5SDimitry Andric 280b57cec5SDimitry Andric mbstate_t 290b57cec5SDimitry Andric size_t 300b57cec5SDimitry Andric tm 310b57cec5SDimitry Andric wint_t 320b57cec5SDimitry Andric 330b57cec5SDimitry Andricint fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); 340b57cec5SDimitry Andricint fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); 350b57cec5SDimitry Andricint swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); 360b57cec5SDimitry Andricint swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); 370b57cec5SDimitry Andricint vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); 380b57cec5SDimitry Andricint vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99 390b57cec5SDimitry Andricint vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); 400b57cec5SDimitry Andricint vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99 410b57cec5SDimitry Andricint vwprintf(const wchar_t* restrict format, va_list arg); 420b57cec5SDimitry Andricint vwscanf(const wchar_t* restrict format, va_list arg); // C99 430b57cec5SDimitry Andricint wprintf(const wchar_t* restrict format, ...); 440b57cec5SDimitry Andricint wscanf(const wchar_t* restrict format, ...); 450b57cec5SDimitry Andricwint_t fgetwc(FILE* stream); 460b57cec5SDimitry Andricwchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); 470b57cec5SDimitry Andricwint_t fputwc(wchar_t c, FILE* stream); 480b57cec5SDimitry Andricint fputws(const wchar_t* restrict s, FILE* restrict stream); 490b57cec5SDimitry Andricint fwide(FILE* stream, int mode); 500b57cec5SDimitry Andricwint_t getwc(FILE* stream); 510b57cec5SDimitry Andricwint_t getwchar(); 520b57cec5SDimitry Andricwint_t putwc(wchar_t c, FILE* stream); 530b57cec5SDimitry Andricwint_t putwchar(wchar_t c); 540b57cec5SDimitry Andricwint_t ungetwc(wint_t c, FILE* stream); 550b57cec5SDimitry Andricdouble wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); 560b57cec5SDimitry Andricfloat wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 570b57cec5SDimitry Andriclong double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 580b57cec5SDimitry Andriclong wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); 590b57cec5SDimitry Andriclong long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 600b57cec5SDimitry Andricunsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); 610b57cec5SDimitry Andricunsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 620b57cec5SDimitry Andricwchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); 630b57cec5SDimitry Andricwchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 640b57cec5SDimitry Andricwchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); 650b57cec5SDimitry Andricwchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 660b57cec5SDimitry Andricint wcscmp(const wchar_t* s1, const wchar_t* s2); 670b57cec5SDimitry Andricint wcscoll(const wchar_t* s1, const wchar_t* s2); 680b57cec5SDimitry Andricint wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); 690b57cec5SDimitry Andricsize_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 700b57cec5SDimitry Andricconst wchar_t* wcschr(const wchar_t* s, wchar_t c); 710b57cec5SDimitry Andric wchar_t* wcschr( wchar_t* s, wchar_t c); 720b57cec5SDimitry Andricsize_t wcscspn(const wchar_t* s1, const wchar_t* s2); 730b57cec5SDimitry Andricsize_t wcslen(const wchar_t* s); 740b57cec5SDimitry Andricconst wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); 750b57cec5SDimitry Andric wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2); 760b57cec5SDimitry Andricconst wchar_t* wcsrchr(const wchar_t* s, wchar_t c); 770b57cec5SDimitry Andric wchar_t* wcsrchr( wchar_t* s, wchar_t c); 780b57cec5SDimitry Andricsize_t wcsspn(const wchar_t* s1, const wchar_t* s2); 790b57cec5SDimitry Andricconst wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); 800b57cec5SDimitry Andric wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2); 810b57cec5SDimitry Andricwchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); 820b57cec5SDimitry Andricconst wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); 830b57cec5SDimitry Andric wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n); 840b57cec5SDimitry Andricint wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 850b57cec5SDimitry Andricwchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 860b57cec5SDimitry Andricwchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); 870b57cec5SDimitry Andricwchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); 880b57cec5SDimitry Andricsize_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, 890b57cec5SDimitry Andric const tm* restrict timeptr); 900b57cec5SDimitry Andricwint_t btowc(int c); 910b57cec5SDimitry Andricint wctob(wint_t c); 920b57cec5SDimitry Andricint mbsinit(const mbstate_t* ps); 930b57cec5SDimitry Andricsize_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); 940b57cec5SDimitry Andricsize_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); 950b57cec5SDimitry Andricsize_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); 960b57cec5SDimitry Andricsize_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, 970b57cec5SDimitry Andric mbstate_t* restrict ps); 980b57cec5SDimitry Andricsize_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, 990b57cec5SDimitry Andric mbstate_t* restrict ps); 1000b57cec5SDimitry Andric 1010b57cec5SDimitry Andric} // std 1020b57cec5SDimitry Andric 1030b57cec5SDimitry Andric*/ 1040b57cec5SDimitry Andric 1050b57cec5SDimitry Andric#include <__config> 1060b57cec5SDimitry Andric#include <cwctype> 1070b57cec5SDimitry Andric#include <wchar.h> 1080b57cec5SDimitry Andric 1090b57cec5SDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 1100b57cec5SDimitry Andric#pragma GCC system_header 1110b57cec5SDimitry Andric#endif 1120b57cec5SDimitry Andric 1130b57cec5SDimitry Andric_LIBCPP_BEGIN_NAMESPACE_STD 1140b57cec5SDimitry Andric 115*fe6060f1SDimitry Andricusing ::mbstate_t _LIBCPP_USING_IF_EXISTS; 116*fe6060f1SDimitry Andricusing ::size_t _LIBCPP_USING_IF_EXISTS; 117*fe6060f1SDimitry Andricusing ::tm _LIBCPP_USING_IF_EXISTS; 118*fe6060f1SDimitry Andricusing ::wint_t _LIBCPP_USING_IF_EXISTS; 119*fe6060f1SDimitry Andricusing ::FILE _LIBCPP_USING_IF_EXISTS; 120*fe6060f1SDimitry Andricusing ::fwprintf _LIBCPP_USING_IF_EXISTS; 121*fe6060f1SDimitry Andricusing ::fwscanf _LIBCPP_USING_IF_EXISTS; 122*fe6060f1SDimitry Andricusing ::swprintf _LIBCPP_USING_IF_EXISTS; 123*fe6060f1SDimitry Andricusing ::vfwprintf _LIBCPP_USING_IF_EXISTS; 124*fe6060f1SDimitry Andricusing ::vswprintf _LIBCPP_USING_IF_EXISTS; 125*fe6060f1SDimitry Andricusing ::swscanf _LIBCPP_USING_IF_EXISTS; 126*fe6060f1SDimitry Andricusing ::vfwscanf _LIBCPP_USING_IF_EXISTS; 127*fe6060f1SDimitry Andricusing ::vswscanf _LIBCPP_USING_IF_EXISTS; 128*fe6060f1SDimitry Andricusing ::fgetwc _LIBCPP_USING_IF_EXISTS; 129*fe6060f1SDimitry Andricusing ::fgetws _LIBCPP_USING_IF_EXISTS; 130*fe6060f1SDimitry Andricusing ::fputwc _LIBCPP_USING_IF_EXISTS; 131*fe6060f1SDimitry Andricusing ::fputws _LIBCPP_USING_IF_EXISTS; 132*fe6060f1SDimitry Andricusing ::fwide _LIBCPP_USING_IF_EXISTS; 133*fe6060f1SDimitry Andricusing ::getwc _LIBCPP_USING_IF_EXISTS; 134*fe6060f1SDimitry Andricusing ::putwc _LIBCPP_USING_IF_EXISTS; 135*fe6060f1SDimitry Andricusing ::ungetwc _LIBCPP_USING_IF_EXISTS; 136*fe6060f1SDimitry Andricusing ::wcstod _LIBCPP_USING_IF_EXISTS; 137*fe6060f1SDimitry Andricusing ::wcstof _LIBCPP_USING_IF_EXISTS; 138*fe6060f1SDimitry Andricusing ::wcstold _LIBCPP_USING_IF_EXISTS; 139*fe6060f1SDimitry Andricusing ::wcstol _LIBCPP_USING_IF_EXISTS; 1400b57cec5SDimitry Andric#ifndef _LIBCPP_HAS_NO_LONG_LONG 141*fe6060f1SDimitry Andricusing ::wcstoll _LIBCPP_USING_IF_EXISTS; 1420b57cec5SDimitry Andric#endif // _LIBCPP_HAS_NO_LONG_LONG 143*fe6060f1SDimitry Andricusing ::wcstoul _LIBCPP_USING_IF_EXISTS; 1440b57cec5SDimitry Andric#ifndef _LIBCPP_HAS_NO_LONG_LONG 145*fe6060f1SDimitry Andricusing ::wcstoull _LIBCPP_USING_IF_EXISTS; 1460b57cec5SDimitry Andric#endif // _LIBCPP_HAS_NO_LONG_LONG 147*fe6060f1SDimitry Andricusing ::wcscpy _LIBCPP_USING_IF_EXISTS; 148*fe6060f1SDimitry Andricusing ::wcsncpy _LIBCPP_USING_IF_EXISTS; 149*fe6060f1SDimitry Andricusing ::wcscat _LIBCPP_USING_IF_EXISTS; 150*fe6060f1SDimitry Andricusing ::wcsncat _LIBCPP_USING_IF_EXISTS; 151*fe6060f1SDimitry Andricusing ::wcscmp _LIBCPP_USING_IF_EXISTS; 152*fe6060f1SDimitry Andricusing ::wcscoll _LIBCPP_USING_IF_EXISTS; 153*fe6060f1SDimitry Andricusing ::wcsncmp _LIBCPP_USING_IF_EXISTS; 154*fe6060f1SDimitry Andricusing ::wcsxfrm _LIBCPP_USING_IF_EXISTS; 155*fe6060f1SDimitry Andricusing ::wcschr _LIBCPP_USING_IF_EXISTS; 156*fe6060f1SDimitry Andricusing ::wcspbrk _LIBCPP_USING_IF_EXISTS; 157*fe6060f1SDimitry Andricusing ::wcsrchr _LIBCPP_USING_IF_EXISTS; 158*fe6060f1SDimitry Andricusing ::wcsstr _LIBCPP_USING_IF_EXISTS; 159*fe6060f1SDimitry Andricusing ::wmemchr _LIBCPP_USING_IF_EXISTS; 160*fe6060f1SDimitry Andricusing ::wcscspn _LIBCPP_USING_IF_EXISTS; 161*fe6060f1SDimitry Andricusing ::wcslen _LIBCPP_USING_IF_EXISTS; 162*fe6060f1SDimitry Andricusing ::wcsspn _LIBCPP_USING_IF_EXISTS; 163*fe6060f1SDimitry Andricusing ::wcstok _LIBCPP_USING_IF_EXISTS; 164*fe6060f1SDimitry Andricusing ::wmemcmp _LIBCPP_USING_IF_EXISTS; 165*fe6060f1SDimitry Andricusing ::wmemcpy _LIBCPP_USING_IF_EXISTS; 166*fe6060f1SDimitry Andricusing ::wmemmove _LIBCPP_USING_IF_EXISTS; 167*fe6060f1SDimitry Andricusing ::wmemset _LIBCPP_USING_IF_EXISTS; 168*fe6060f1SDimitry Andricusing ::wcsftime _LIBCPP_USING_IF_EXISTS; 169*fe6060f1SDimitry Andricusing ::btowc _LIBCPP_USING_IF_EXISTS; 170*fe6060f1SDimitry Andricusing ::wctob _LIBCPP_USING_IF_EXISTS; 171*fe6060f1SDimitry Andricusing ::mbsinit _LIBCPP_USING_IF_EXISTS; 172*fe6060f1SDimitry Andricusing ::mbrlen _LIBCPP_USING_IF_EXISTS; 173*fe6060f1SDimitry Andricusing ::mbrtowc _LIBCPP_USING_IF_EXISTS; 174*fe6060f1SDimitry Andricusing ::wcrtomb _LIBCPP_USING_IF_EXISTS; 175*fe6060f1SDimitry Andricusing ::mbsrtowcs _LIBCPP_USING_IF_EXISTS; 176*fe6060f1SDimitry Andricusing ::wcsrtombs _LIBCPP_USING_IF_EXISTS; 1770b57cec5SDimitry Andric 1780b57cec5SDimitry Andric#ifndef _LIBCPP_HAS_NO_STDIN 179*fe6060f1SDimitry Andricusing ::getwchar _LIBCPP_USING_IF_EXISTS; 180*fe6060f1SDimitry Andricusing ::vwscanf _LIBCPP_USING_IF_EXISTS; 181*fe6060f1SDimitry Andricusing ::wscanf _LIBCPP_USING_IF_EXISTS; 1820b57cec5SDimitry Andric#endif 1830b57cec5SDimitry Andric 1840b57cec5SDimitry Andric#ifndef _LIBCPP_HAS_NO_STDOUT 185*fe6060f1SDimitry Andricusing ::putwchar _LIBCPP_USING_IF_EXISTS; 186*fe6060f1SDimitry Andricusing ::vwprintf _LIBCPP_USING_IF_EXISTS; 187*fe6060f1SDimitry Andricusing ::wprintf _LIBCPP_USING_IF_EXISTS; 1880b57cec5SDimitry Andric#endif 1890b57cec5SDimitry Andric 1900b57cec5SDimitry Andric_LIBCPP_END_NAMESPACE_STD 1910b57cec5SDimitry Andric 1920b57cec5SDimitry Andric#endif // _LIBCPP_CWCHAR 193