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 17 Macros: 18 19 NULL 20 WCHAR_MAX 21 WCHAR_MIN 22 WEOF 23 24 namespace std 25 { 26 27 Types: 28 29 mbstate_t 30 size_t 31 tm 32 wint_t 33 34 int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); 35 int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); 36 int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); 37 int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); 38 int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); 39 int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99 40 int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); 41 int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99 42 int vwprintf(const wchar_t* restrict format, va_list arg); 43 int vwscanf(const wchar_t* restrict format, va_list arg); // C99 44 int wprintf(const wchar_t* restrict format, ...); 45 int wscanf(const wchar_t* restrict format, ...); 46 wint_t fgetwc(FILE* stream); 47 wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); 48 wint_t fputwc(wchar_t c, FILE* stream); 49 int fputws(const wchar_t* restrict s, FILE* restrict stream); 50 int fwide(FILE* stream, int mode); 51 wint_t getwc(FILE* stream); 52 wint_t getwchar(); 53 wint_t putwc(wchar_t c, FILE* stream); 54 wint_t putwchar(wchar_t c); 55 wint_t ungetwc(wint_t c, FILE* stream); 56 double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); 57 float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 58 long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 59 long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); 60 long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 61 unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); 62 unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 63 wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); 64 wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 65 wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); 66 wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 67 int wcscmp(const wchar_t* s1, const wchar_t* s2); 68 int wcscoll(const wchar_t* s1, const wchar_t* s2); 69 int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); 70 size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 71 const wchar_t* wcschr(const wchar_t* s, wchar_t c); 72 wchar_t* wcschr( wchar_t* s, wchar_t c); 73 size_t wcscspn(const wchar_t* s1, const wchar_t* s2); 74 size_t wcslen(const wchar_t* s); 75 const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); 76 wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2); 77 const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); 78 wchar_t* wcsrchr( wchar_t* s, wchar_t c); 79 size_t wcsspn(const wchar_t* s1, const wchar_t* s2); 80 const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); 81 wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2); 82 wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); 83 const 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); 85 int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 86 wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 87 wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); 88 wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); 89 size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, 90 const tm* restrict timeptr); 91 wint_t btowc(int c); 92 int wctob(wint_t c); 93 int mbsinit(const mbstate_t* ps); 94 size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); 95 size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); 96 size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); 97 size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, 98 mbstate_t* restrict ps); 99 size_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 116 using ::mbstate_t; 117 using ::size_t; 118 using ::tm; 119 using ::wint_t; 120 using ::FILE; 121 using ::fwprintf; 122 using ::fwscanf; 123 using ::swprintf; 124 using ::vfwprintf; 125 using ::vswprintf; 126 #ifndef _LIBCPP_MSVCRT 127 using ::swscanf; 128 using ::vfwscanf; 129 using ::vswscanf; 130 #endif // _LIBCPP_MSVCRT 131 using ::fgetwc; 132 using ::fgetws; 133 using ::fputwc; 134 using ::fputws; 135 using ::fwide; 136 using ::getwc; 137 using ::putwc; 138 using ::ungetwc; 139 using ::wcstod; 140 #ifndef _LIBCPP_MSVCRT 141 using ::wcstof; 142 using ::wcstold; 143 #endif // _LIBCPP_MSVCRT 144 using ::wcstol; 145 #ifndef _LIBCPP_HAS_NO_LONG_LONG 146 using ::wcstoll; 147 #endif // _LIBCPP_HAS_NO_LONG_LONG 148 using ::wcstoul; 149 #ifndef _LIBCPP_HAS_NO_LONG_LONG 150 using ::wcstoull; 151 #endif // _LIBCPP_HAS_NO_LONG_LONG 152 using ::wcscpy; 153 using ::wcsncpy; 154 using ::wcscat; 155 using ::wcsncat; 156 using ::wcscmp; 157 using ::wcscoll; 158 using ::wcsncmp; 159 using ::wcsxfrm; 160 using ::wcschr; 161 using ::wcspbrk; 162 using ::wcsrchr; 163 using ::wcsstr; 164 using ::wmemchr; 165 using ::wcscspn; 166 using ::wcslen; 167 using ::wcsspn; 168 using ::wcstok; 169 using ::wmemcmp; 170 using ::wmemcpy; 171 using ::wmemmove; 172 using ::wmemset; 173 using ::wcsftime; 174 using ::btowc; 175 using ::wctob; 176 using ::mbsinit; 177 using ::mbrlen; 178 using ::mbrtowc; 179 using ::wcrtomb; 180 using ::mbsrtowcs; 181 using ::wcsrtombs; 182 183 #ifndef _LIBCPP_HAS_NO_STDIN 184 using ::getwchar; 185 #ifndef _LIBCPP_MSVCRT 186 using ::vwscanf; 187 #endif // _LIBCPP_MSVCRT 188 using ::wscanf; 189 #endif 190 191 #ifndef _LIBCPP_HAS_NO_STDOUT 192 using ::putwchar; 193 using ::vwprintf; 194 using ::wprintf; 195 #endif 196 197 _LIBCPP_END_NAMESPACE_STD 198 199 #endif // _LIBCPP_CWCHAR 200