| /** |
| * This file has no copyright assigned and is placed in the Public Domain. |
| * This file is part of the mingw-w64 runtime package. |
| * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| */ |
| #ifndef _INC_WCHAR |
| #define _INC_WCHAR |
| |
| #include <corecrt.h> |
| #include <corecrt_wconio.h> |
| #include <corecrt_wctype.h> |
| #include <corecrt_wdirect.h> |
| #include <corecrt_wio.h> |
| #include <corecrt_wprocess.h> |
| #include <corecrt_wstdio.h> |
| #include <corecrt_wstdlib.h> |
| #include <corecrt_wstring.h> |
| #include <corecrt_wtime.h> |
| #include <sys/stat.h> |
| #include <_mingw_locale.h> |
| |
| _CRT_BEGIN_C_HEADER |
| |
| #ifndef WCHAR_MIN /* also in stdint.h */ |
| #define WCHAR_MIN 0U |
| #define WCHAR_MAX 0xffffU |
| #endif |
| |
| typedef wchar_t _Wint_t; |
| |
| _CRTIMP wint_t __cdecl btowc(int); |
| int __cdecl mbsinit(const mbstate_t *ps); |
| _CRTIMP size_t __cdecl mbrlen(const char * __restrict__ _Ch,size_t _SizeInBytes,mbstate_t * __restrict__ _State); |
| _CRTIMP size_t __cdecl mbrtowc(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SizeInBytes,mbstate_t * __restrict__ _State); |
| _CRTIMP size_t __cdecl mbsrtowcs(wchar_t * __restrict__ _Dest,const char ** __restrict__ _PSrc,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| _CRTIMP size_t __cdecl wcrtomb(char * __restrict__ _Dest,wchar_t _Source,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| _CRTIMP size_t __cdecl wcsrtombs(char * __restrict__ _Dest,const wchar_t ** __restrict__ _PSource,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| _CRTIMP int __cdecl wctob(wint_t _WCh); |
| |
| _CRTIMP errno_t __cdecl mbsrtowcs_s(size_t *_Retval,wchar_t *_Dst,size_t _SizeInWords,const char **_PSrc,size_t _N,mbstate_t *_State); |
| __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3(errno_t,mbsrtowcs_s,size_t*,_Retval,wchar_t,_Dst,const char**,_PSrc,size_t,_N,mbstate_t,_State) |
| |
| _CRTIMP errno_t __cdecl wcrtomb_s(size_t *_Retval,char *_Dst,size_t _SizeInBytes,wchar_t _Ch,mbstate_t *_State); |
| __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_2(errno_t,wcrtomb_s,size_t*,_Retval,char,_Dst,wchar_t,_Ch,mbstate_t,_State) |
| |
| _CRTIMP errno_t __cdecl wcsrtombs_s(size_t *_Retval,char *_Dst,size_t _SizeInBytes,const wchar_t **_Src,size_t _Size,mbstate_t *_State); |
| __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3(errno_t,wcsrtombs_s,size_t,_Retval,char,_Dst,const wchar_t**,_Src,size_t,_Size,mbstate_t,_State) |
| |
| _SECIMP errno_t __cdecl wmemcpy_s (wchar_t *_dest,size_t _numberOfElements,const wchar_t *_src,size_t _count); |
| _SECIMP errno_t __cdecl wmemmove_s(wchar_t *_dest,size_t _numberOfElements,const wchar_t *_src,size_t _count); |
| |
| #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ |
| wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n); |
| int __cdecl wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n); |
| wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ s1,const wchar_t * __restrict__ s2,size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| wchar_t * __cdecl wmempcpy (wchar_t *_Dst, const wchar_t *_Src, size_t _Size); |
| wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| int __cdecl fwide(FILE *stream,int mode); |
| __MINGW_EXTENSION long long __cdecl wcstoll(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base); |
| __MINGW_EXTENSION unsigned long long __cdecl wcstoull(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base); |
| |
| #ifdef __cplusplus |
| extern "C++" { |
| const wchar_t* __cdecl wmemchr(const wchar_t*, wchar_t, size_t) __MINGW_ASM_CALL(wmemchr); |
| inline wchar_t* __cdecl wmemchr(wchar_t* _Buf, wchar_t _Val, size_t _MaxCount) |
| { return const_cast<wchar_t*>(wmemchr(const_cast<const wchar_t*>(_Buf), _Val, _MaxCount)); } |
| } |
| #else |
| wchar_t* __cdecl wmemchr(const wchar_t* _Buf, wchar_t _Val, size_t _MaxCount); |
| #endif |
| |
| #endif /* __NO_ISOCEXT */ |
| |
| void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount); |
| void *__cdecl memcpy(void * __restrict__ _Dst,const void * __restrict__ _Src,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| #ifndef __CRT__NO_INLINE |
| __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); } |
| #ifdef __cplusplus |
| extern "C++" |
| #endif |
| __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) { |
| if (_S) { |
| for ( ; 0 < _N; ++_S, --_N) |
| if (*_S == _C) |
| return (_CONST_RETURN wchar_t *)(_S); |
| } |
| return (_CONST_RETURN wchar_t *) NULL; |
| } |
| __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) { |
| if (_N == 0 || _S1 == _S2) |
| return 0; /* even for NULL pointers. */ |
| if ((_S1 && !(_S2)) || (_S2 && !(_S1))) |
| return !(_S2) ? 1 : -1; /* robust. */ |
| for ( ; 0 < _N; ++_S1, ++_S2, --_N) |
| if (*_S1 != *_S2) |
| return (*_S1 < *_S2 ? -1 : +1); |
| return 0; |
| } |
| __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ _S1,const wchar_t * __restrict__ _S2,size_t _N) |
| { |
| return (wchar_t *) memcpy (_S1,_S2,_N*sizeof(wchar_t)); |
| } |
| __CRT_INLINE wchar_t *__cdecl wmemmove(wchar_t *_S1,const wchar_t *_S2,size_t _N) { return (wchar_t *)memmove(_S1,_S2,_N*sizeof(wchar_t)); } |
| __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) { |
| wchar_t *_Su = _S; |
| for (;0<_N;++_Su,--_N) { |
| *_Su = _C; |
| } |
| return (_S); |
| } |
| #endif /* !__CRT__NO_INLINE */ |
| |
| _CRT_END_C_HEADER |
| |
| #endif /* _INC_WCHAR */ |