123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- // -*- C++ -*-
- //===--------------------------- cwchar -----------------------------------===//
- //
- // The LLVM Compiler Infrastructure
- //
- // This file is dual licensed under the MIT and the University of Illinois Open
- // Source Licenses. See LICENSE.TXT for details.
- //
- //===----------------------------------------------------------------------===//
- #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 <cwctype>
- #include <wchar.h>
- #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
- #if !defined(_LIBCPP_SGX_CONFIG)
- #include <support/win32/support.h> // pull in *swprintf defines
- #endif // !defined(_LIBCPP_SGX_CONFIG)
- #endif // _LIBCPP_MSVCRT
- #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
- #pragma GCC system_header
- #endif
- _LIBCPP_BEGIN_NAMESPACE_STD
- using ::mbstate_t;
- using ::size_t;
- #ifndef _LIBCPP_SGX_CONFIG
- using ::tm;
- #endif //_LIBCPP_SGX_CONFIG
- using ::wint_t;
- #ifndef _LIBCPP_SGX_CONFIG
- using ::FILE;
- using ::fwprintf;
- using ::fwscanf;
- #endif //_LIBCPP_SGX_CONFIG
- using ::swprintf;
- #ifndef _LIBCPP_SGX_CONFIG
- using ::vfwprintf;
- #endif //_LIBCPP_SGX_CONFIG
- using ::vswprintf;
- #ifndef _LIBCPP_SGX_CONFIG
- using ::swscanf;
- using ::vfwscanf;
- using ::vswscanf;
- #endif // _LIBCPP_SGX_CONFIG
- #ifndef _LIBCPP_SGX_CONFIG
- using ::fgetwc;
- using ::fgetws;
- using ::fputwc;
- using ::fputws;
- using ::fwide;
- using ::getwc;
- using ::putwc;
- using ::ungetwc;
- using ::wcstod;
- #endif //_LIBCPP_SGX_CONFIG
- #ifndef _LIBCPP_SGX_CONFIG
- using ::wcstof;
- using ::wcstold;
- #endif // _LIBCPP_SGX_CONFIG
- #ifndef _LIBCPP_SGX_CONFIG
- using ::wcstol;
- #ifndef _LIBCPP_HAS_NO_LONG_LONG
- using ::wcstoll;
- #endif // _LIBCPP_HAS_NO_LONG_LONG
- using ::wcstoul;
- #ifndef _LIBCPP_HAS_NO_LONG_LONG
- using ::wcstoull;
- #endif // _LIBCPP_HAS_NO_LONG_LONG
- using ::wcscpy;
- #endif //_LIBCPP_SGX_CONFIG
- using ::wcsncpy;
- #ifndef _LIBCPP_SGX_CONFIG
- using ::wcscat;
- #endif //_LIBCPP_SGX_CONFIG
- using ::wcsncat;
- using ::wcscmp;
- using ::wcscoll;
- using ::wcsncmp;
- using ::wcsxfrm;
- #if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
- using ::wcschr;
- using ::wcspbrk;
- using ::wcsrchr;
- using ::wcsstr;
- using ::wmemchr;
- #else
- inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
- inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
- inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);}
- inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);}
- inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);}
- inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);}
- inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
- inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
- inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
- inline _LIBCPP_INLINE_VISIBILITY wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
- #endif
- using ::wcscspn;
- using ::wcslen;
- using ::wcsspn;
- using ::wcstok;
- using ::wmemcmp;
- using ::wmemcpy;
- using ::wmemmove;
- using ::wmemset;
- #ifndef _LIBCPP_SGX_CONFIG
- using ::wcsftime;
- #endif _LIBCPP_SGX_CONFIG
- using ::btowc;
- using ::wctob;
- using ::mbsinit;
- using ::mbrlen;
- using ::mbrtowc;
- using ::wcrtomb;
- using ::mbsrtowcs;
- using ::wcsrtombs;
- #ifndef _LIBCPP_HAS_NO_STDIN
- using ::getwchar;
- #ifndef _LIBCPP_MSVCRT
- using ::vwscanf;
- #endif // _LIBCPP_MSVCRT
- using ::wscanf;
- #endif
- #ifndef _LIBCPP_HAS_NO_STDOUT
- using ::putwchar;
- using ::vwprintf;
- using ::wprintf;
- #endif
- _LIBCPP_END_NAMESPACE_STD
- #endif // _LIBCPP_CWCHAR
|