2010-05-12 03:42:16 +08:00
|
|
|
// -*- C++ -*-
|
|
|
|
//===--------------------------- cwchar -----------------------------------===//
|
|
|
|
//
|
2010-05-12 05:36:01 +08:00
|
|
|
// The LLVM Compiler Infrastructure
|
2010-05-12 03:42:16 +08:00
|
|
|
//
|
2010-11-17 06:09:02 +08:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-05-12 03:42:16 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef _LIBCPP_CWCHAR
|
|
|
|
#define _LIBCPP_CWCHAR
|
|
|
|
|
|
|
|
/*
|
|
|
|
cwchar synopsis
|
|
|
|
|
|
|
|
Macros:
|
|
|
|
|
|
|
|
NULL
|
|
|
|
WCHAR_MAX
|
|
|
|
WCHAR_MIN
|
|
|
|
WEOF
|
2010-08-22 08:02:43 +08:00
|
|
|
|
2010-05-12 03:42:16 +08:00
|
|
|
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);
|
2010-08-22 08:02:43 +08:00
|
|
|
wint_t getwchar();
|
2010-05-12 03:42:16 +08:00
|
|
|
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);
|
2010-08-22 08:02:43 +08:00
|
|
|
size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps);
|
2010-05-12 03:42:16 +08:00
|
|
|
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,
|
2010-08-22 08:02:43 +08:00
|
|
|
mbstate_t* restrict ps);
|
2010-05-12 03:42:16 +08:00
|
|
|
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>
|
|
|
|
|
2011-10-18 04:05:10 +08:00
|
|
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
2010-05-12 03:42:16 +08:00
|
|
|
#pragma GCC system_header
|
2011-10-18 04:05:10 +08:00
|
|
|
#endif
|
2010-05-12 03:42:16 +08:00
|
|
|
|
|
|
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
|
|
|
|
|
|
|
using ::mbstate_t;
|
|
|
|
using ::size_t;
|
|
|
|
using ::tm;
|
|
|
|
using ::wint_t;
|
|
|
|
using ::FILE;
|
|
|
|
using ::fwprintf;
|
|
|
|
using ::fwscanf;
|
|
|
|
using ::swprintf;
|
|
|
|
using ::vfwprintf;
|
|
|
|
using ::vswprintf;
|
2013-08-02 02:17:34 +08:00
|
|
|
#ifndef _LIBCPP_MSVCRT
|
2011-10-23 04:59:45 +08:00
|
|
|
using ::swscanf;
|
|
|
|
using ::vfwscanf;
|
|
|
|
using ::vswscanf;
|
2013-08-02 02:17:34 +08:00
|
|
|
#endif // _LIBCPP_MSVCRT
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::fgetwc;
|
|
|
|
using ::fgetws;
|
|
|
|
using ::fputwc;
|
|
|
|
using ::fputws;
|
|
|
|
using ::fwide;
|
|
|
|
using ::getwc;
|
|
|
|
using ::putwc;
|
|
|
|
using ::ungetwc;
|
|
|
|
using ::wcstod;
|
2013-08-02 02:17:34 +08:00
|
|
|
#ifndef _LIBCPP_MSVCRT
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::wcstof;
|
|
|
|
using ::wcstold;
|
2013-08-02 02:17:34 +08:00
|
|
|
#endif // _LIBCPP_MSVCRT
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::wcstol;
|
2012-11-27 05:18:17 +08:00
|
|
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::wcstoll;
|
2012-11-27 05:18:17 +08:00
|
|
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::wcstoul;
|
2012-11-27 05:18:17 +08:00
|
|
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::wcstoull;
|
2012-11-27 05:18:17 +08:00
|
|
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::wcscpy;
|
|
|
|
using ::wcsncpy;
|
|
|
|
using ::wcscat;
|
|
|
|
using ::wcsncat;
|
|
|
|
using ::wcscmp;
|
|
|
|
using ::wcscoll;
|
|
|
|
using ::wcsncmp;
|
|
|
|
using ::wcsxfrm;
|
Change <cwchar> and <cstring> to look out for flags which may or may not be set by the C headers <wchar.h> and <string.h> indicating C support for the C++-altered wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr, strchr, strpbrk, strrchr, memchr, and strstr. This was already done in <cstring> for other platforms using other flags, so just had to add one more flag to the list there.
llvm-svn: 179041
2013-04-09 02:59:28 +08:00
|
|
|
using ::wcschr;
|
|
|
|
using ::wcspbrk;
|
|
|
|
using ::wcsrchr;
|
|
|
|
using ::wcsstr;
|
|
|
|
using ::wmemchr;
|
|
|
|
using ::wcscspn;
|
|
|
|
using ::wcslen;
|
|
|
|
using ::wcsspn;
|
|
|
|
using ::wcstok;
|
2010-05-12 03:42:16 +08:00
|
|
|
using ::wmemcmp;
|
|
|
|
using ::wmemcpy;
|
|
|
|
using ::wmemmove;
|
|
|
|
using ::wmemset;
|
|
|
|
using ::wcsftime;
|
|
|
|
using ::btowc;
|
|
|
|
using ::wctob;
|
|
|
|
using ::mbsinit;
|
|
|
|
using ::mbrlen;
|
|
|
|
using ::mbrtowc;
|
|
|
|
using ::wcrtomb;
|
|
|
|
using ::mbsrtowcs;
|
|
|
|
using ::wcsrtombs;
|
|
|
|
|
2015-03-26 22:35:46 +08:00
|
|
|
#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
|
|
|
|
|
2010-05-12 03:42:16 +08:00
|
|
|
_LIBCPP_END_NAMESPACE_STD
|
|
|
|
|
|
|
|
#endif // _LIBCPP_CWCHAR
|