1// -*- C++ -*- 2//===--------------------------- cwchar -----------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// 9//===----------------------------------------------------------------------===// 10 11#ifndef _LIBCPP_CWCHAR 12#define _LIBCPP_CWCHAR 13 14/* 15 cwchar synopsis 16 17Macros: 18 19 NULL 20 WCHAR_MAX 21 WCHAR_MIN 22 WEOF 23 24namespace std 25{ 26 27Types: 28 29 mbstate_t 30 size_t 31 tm 32 wint_t 33 34int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); 35int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); 36int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); 37int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); 38int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); 39int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99 40int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); 41int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99 42int vwprintf(const wchar_t* restrict format, va_list arg); 43int vwscanf(const wchar_t* restrict format, va_list arg); // C99 44int wprintf(const wchar_t* restrict format, ...); 45int wscanf(const wchar_t* restrict format, ...); 46wint_t fgetwc(FILE* stream); 47wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); 48wint_t fputwc(wchar_t c, FILE* stream); 49int fputws(const wchar_t* restrict s, FILE* restrict stream); 50int fwide(FILE* stream, int mode); 51wint_t getwc(FILE* stream); 52wint_t getwchar(); 53wint_t putwc(wchar_t c, FILE* stream); 54wint_t putwchar(wchar_t c); 55wint_t ungetwc(wint_t c, FILE* stream); 56double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); 57float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 58long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 59long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); 60long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 61unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); 62unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 63wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); 64wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 65wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); 66wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 67int wcscmp(const wchar_t* s1, const wchar_t* s2); 68int wcscoll(const wchar_t* s1, const wchar_t* s2); 69int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); 70size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 71const wchar_t* wcschr(const wchar_t* s, wchar_t c); 72 wchar_t* wcschr( wchar_t* s, wchar_t c); 73size_t wcscspn(const wchar_t* s1, const wchar_t* s2); 74size_t wcslen(const wchar_t* s); 75const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); 76 wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2); 77const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); 78 wchar_t* wcsrchr( wchar_t* s, wchar_t c); 79size_t wcsspn(const wchar_t* s1, const wchar_t* s2); 80const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); 81 wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2); 82wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); 83const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); 84 wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n); 85int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 86wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 87wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); 88wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); 89size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, 90 const tm* restrict timeptr); 91wint_t btowc(int c); 92int wctob(wint_t c); 93int mbsinit(const mbstate_t* ps); 94size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); 95size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); 96size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); 97size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, 98 mbstate_t* restrict ps); 99size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, 100 mbstate_t* restrict ps); 101 102} // std 103 104*/ 105 106#include <__config> 107#include <cwctype> 108#include <wchar.h> 109 110#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 111#pragma GCC system_header 112#endif 113 114_LIBCPP_BEGIN_NAMESPACE_STD 115 116using ::mbstate_t; 117using ::size_t; 118using ::tm; 119using ::wint_t; 120using ::FILE; 121using ::fwprintf; 122using ::fwscanf; 123using ::swprintf; 124using ::vfwprintf; 125using ::vswprintf; 126using ::swscanf; 127using ::vfwscanf; 128using ::vswscanf; 129using ::fgetwc; 130using ::fgetws; 131using ::fputwc; 132using ::fputws; 133using ::fwide; 134using ::getwc; 135using ::putwc; 136using ::ungetwc; 137using ::wcstod; 138using ::wcstof; 139using ::wcstold; 140using ::wcstol; 141#ifndef _LIBCPP_HAS_NO_LONG_LONG 142using ::wcstoll; 143#endif // _LIBCPP_HAS_NO_LONG_LONG 144using ::wcstoul; 145#ifndef _LIBCPP_HAS_NO_LONG_LONG 146using ::wcstoull; 147#endif // _LIBCPP_HAS_NO_LONG_LONG 148using ::wcscpy; 149using ::wcsncpy; 150using ::wcscat; 151using ::wcsncat; 152using ::wcscmp; 153using ::wcscoll; 154using ::wcsncmp; 155using ::wcsxfrm; 156using ::wcschr; 157using ::wcspbrk; 158using ::wcsrchr; 159using ::wcsstr; 160using ::wmemchr; 161using ::wcscspn; 162using ::wcslen; 163using ::wcsspn; 164using ::wcstok; 165using ::wmemcmp; 166using ::wmemcpy; 167using ::wmemmove; 168using ::wmemset; 169using ::wcsftime; 170using ::btowc; 171using ::wctob; 172using ::mbsinit; 173using ::mbrlen; 174using ::mbrtowc; 175using ::wcrtomb; 176using ::mbsrtowcs; 177using ::wcsrtombs; 178 179#ifndef _LIBCPP_HAS_NO_STDIN 180using ::getwchar; 181using ::vwscanf; 182using ::wscanf; 183#endif 184 185#ifndef _LIBCPP_HAS_NO_STDOUT 186using ::putwchar; 187using ::vwprintf; 188using ::wprintf; 189#endif 190 191_LIBCPP_END_NAMESPACE_STD 192 193#endif // _LIBCPP_CWCHAR 194