diff --git a/stdio.h b/stdio.h new file mode 100644 index 0000000..0fffddf --- /dev/null +++ b/stdio.h @@ -0,0 +1,2448 @@ +// +// stdio.h +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// The C Standard Library header. +// +#pragma once +#ifndef _INC_STDIO // include guard for 3rd party interop +#define _INC_STDIO + +#include +#include + +#pragma warning(push) +#pragma warning(disable: _UCRT_DISABLED_WARNINGS) +_UCRT_DISABLE_CLANG_WARNINGS + +_CRT_BEGIN_C_HEADER + +/* Buffered I/O macros */ + +#define BUFSIZ 512 + + + +/* + * Default number of supported streams. _NFILE is confusing and obsolete, but + * supported anyway for backwards compatibility. + */ +#define _NFILE _NSTREAM_ + +#define _NSTREAM_ 512 + +/* + * Number of entries in _iob[] (declared below). Note that _NSTREAM_ must be + * greater than or equal to _IOB_ENTRIES. + */ +#define _IOB_ENTRIES 3 + +#define EOF (-1) + +#define _IOFBF 0x0000 +#define _IOLBF 0x0040 +#define _IONBF 0x0004 + + + +#define L_tmpnam 260 // _MAX_PATH +#if __STDC_WANT_SECURE_LIB__ + #define L_tmpnam_s L_tmpnam +#endif + + + +/* Seek method constants */ + +#define SEEK_CUR 1 +#define SEEK_END 2 +#define SEEK_SET 0 + + +#define FILENAME_MAX 260 +#define FOPEN_MAX 20 +#define _SYS_OPEN 20 +#define TMP_MAX _CRT_INT_MAX +#if __STDC_WANT_SECURE_LIB__ + #define TMP_MAX_S TMP_MAX + #define _TMP_MAX_S TMP_MAX +#endif + + +typedef __int64 fpos_t; + + + +#if _CRT_FUNCTIONS_REQUIRED + + _Check_return_opt_ + _ACRTIMP errno_t __cdecl _get_stream_buffer_pointers( + _In_ FILE* _Stream, + _Out_opt_ char*** _Base, + _Out_opt_ char*** _Pointer, + _Out_opt_ int** _Count + ); + + + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + // + // Narrow Character Stream I/O Functions + // + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl clearerr_s( + _Inout_ FILE* _Stream + ); + + _Check_return_wat_ + _Success_(return == 0) + _ACRTIMP errno_t __cdecl fopen_s( + _Outptr_result_nullonfailure_ FILE** _Stream, + _In_z_ char const* _FileName, + _In_z_ char const* _Mode + ); + + _Check_return_opt_ + _Success_(return != 0) + _ACRTIMP size_t __cdecl fread_s( + _Out_writes_bytes_to_(_BufferSize, _ElementSize * _ElementCount) void* _Buffer, + _In_range_(>=, _ElementSize * _ElementCount) size_t _BufferSize, + _In_ size_t _ElementSize, + _In_ size_t _ElementCount, + _Inout_ FILE* _Stream + ); + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl freopen_s( + _Outptr_result_maybenull_ FILE** _Stream, + _In_z_ char const* _FileName, + _In_z_ char const* _Mode, + _Inout_ FILE* _OldStream + ); + + _Success_(return != 0) + _ACRTIMP char* __cdecl gets_s( + _Out_writes_z_(_Size) char* _Buffer, + _In_ rsize_t _Size + ); + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl tmpfile_s( + _Out_opt_ _Deref_post_valid_ FILE** _Stream + ); + + _Success_(return == 0) + _Check_return_wat_ + _ACRTIMP errno_t __cdecl tmpnam_s( + _Out_writes_z_(_Size) char* _Buffer, + _In_ rsize_t _Size + ); + + #endif + + _ACRTIMP void __cdecl clearerr( + _Inout_ FILE* _Stream + ); + + _Success_(return != -1) + _Check_return_opt_ + _ACRTIMP int __cdecl fclose( + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _fcloseall(void); + + _Check_return_ + _ACRTIMP FILE* __cdecl _fdopen( + _In_ int _FileHandle, + _In_z_ char const* _Mode + ); + + _Check_return_ + _ACRTIMP int __cdecl feof( + _In_ FILE* _Stream + ); + + _Check_return_ + _ACRTIMP int __cdecl ferror( + _In_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl fflush( + _Inout_opt_ FILE* _Stream + ); + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl fgetc( + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _fgetchar(void); + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl fgetpos( + _Inout_ FILE* _Stream, + _Out_ fpos_t* _Position + ); + + _Success_(return == _Buffer) + _Check_return_opt_ + _ACRTIMP char* __cdecl fgets( + _Out_writes_z_(_MaxCount) char* _Buffer, + _In_ int _MaxCount, + _Inout_ FILE* _Stream + ); + + _Check_return_ + _ACRTIMP int __cdecl _fileno( + _In_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _flushall(void); + + _Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s) + _ACRTIMP FILE* __cdecl fopen( + _In_z_ char const* _FileName, + _In_z_ char const* _Mode + ); + + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl fputc( + _In_ int _Character, + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _fputchar( + _In_ int _Character + ); + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl fputs( + _In_z_ char const* _Buffer, + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP size_t __cdecl fread( + _Out_writes_bytes_(_ElementSize * _ElementCount) void* _Buffer, + _In_ size_t _ElementSize, + _In_ size_t _ElementCount, + _Inout_ FILE* _Stream + ); + + _Success_(return != 0) + _Check_return_ _CRT_INSECURE_DEPRECATE(freopen_s) + _ACRTIMP FILE* __cdecl freopen( + _In_z_ char const* _FileName, + _In_z_ char const* _Mode, + _Inout_ FILE* _Stream + ); + + _Check_return_ + _ACRTIMP FILE* __cdecl _fsopen( + _In_z_ char const* _FileName, + _In_z_ char const* _Mode, + _In_ int _ShFlag + ); + + _Success_(return == 0) + _Check_return_opt_ + _ACRTIMP int __cdecl fsetpos( + _Inout_ FILE* _Stream, + _In_ fpos_t const* _Position + ); + + _Success_(return == 0) + _Check_return_opt_ + _ACRTIMP int __cdecl fseek( + _Inout_ FILE* _Stream, + _In_ long _Offset, + _In_ int _Origin + ); + + _Success_(return == 0) + _Check_return_opt_ + _ACRTIMP int __cdecl _fseeki64( + _Inout_ FILE* _Stream, + _In_ __int64 _Offset, + _In_ int _Origin + ); + + _Success_(return != -1) + _Check_return_ + _ACRTIMP long __cdecl ftell( + _Inout_ FILE* _Stream + ); + + _Success_(return != -1) + _Check_return_ + _ACRTIMP __int64 __cdecl _ftelli64( + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP size_t __cdecl fwrite( + _In_reads_bytes_(_ElementSize * _ElementCount) void const* _Buffer, + _In_ size_t _ElementSize, + _In_ size_t _ElementCount, + _Inout_ FILE* _Stream + ); + + _Success_(return != EOF) + _Check_return_ + _ACRTIMP int __cdecl getc( + _Inout_ FILE* _Stream + ); + + _Check_return_ + _ACRTIMP int __cdecl getchar(void); + + _Check_return_ + _ACRTIMP int __cdecl _getmaxstdio(void); + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0( + char*, gets_s, + char, _Buffer) + + _Check_return_ + _ACRTIMP int __cdecl _getw( + _Inout_ FILE* _Stream + ); + + _ACRTIMP void __cdecl perror( + _In_opt_z_ char const* _ErrorMessage + ); + + #if defined _CRT_USE_WINAPI_FAMILY_DESKTOP_APP + + _Success_(return != -1) + _Check_return_opt_ + _DCRTIMP int __cdecl _pclose( + _Inout_ FILE* _Stream + ); + + _Check_return_ + _DCRTIMP FILE* __cdecl _popen( + _In_z_ char const* _Command, + _In_z_ char const* _Mode + ); + + #endif + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl putc( + _In_ int _Character, + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl putchar( + _In_ int _Character + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl puts( + _In_z_ char const* _Buffer + ); + + _Success_(return != -1) + _Check_return_opt_ + _ACRTIMP int __cdecl _putw( + _In_ int _Word, + _Inout_ FILE* _Stream + ); + + _ACRTIMP int __cdecl remove( + _In_z_ char const* _FileName + ); + + _Check_return_ + _ACRTIMP int __cdecl rename( + _In_z_ char const* _OldFileName, + _In_z_ char const* _NewFileName + ); + + _ACRTIMP int __cdecl _unlink( + _In_z_ char const* _FileName + ); + + #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES + + _CRT_NONSTDC_DEPRECATE(_unlink) + _ACRTIMP int __cdecl unlink( + _In_z_ char const* _FileName + ); + + #endif + + _ACRTIMP void __cdecl rewind( + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _rmtmp(void); + + _CRT_INSECURE_DEPRECATE(setvbuf) + _ACRTIMP void __cdecl setbuf( + _Inout_ FILE* _Stream, + _Inout_updates_opt_(BUFSIZ) _Post_readable_size_(0) char* _Buffer + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _setmaxstdio( + _In_ int _Maximum + ); + + _Success_(return == 0) + _Check_return_opt_ + _ACRTIMP int __cdecl setvbuf( + _Inout_ FILE* _Stream, + _Inout_updates_opt_(_Size) char* _Buffer, + _In_ int _Mode, + _In_ size_t _Size + ); + + #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC + #pragma push_macro("_tempnam") + #undef _tempnam + #endif + + _Check_return_ + _ACRTIMP _CRTALLOCATOR char* __cdecl _tempnam( + _In_opt_z_ char const* _DirectoryName, + _In_opt_z_ char const* _FilePrefix + ); + + #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC + #pragma pop_macro("_tempnam") + #endif + + _Check_return_ _CRT_INSECURE_DEPRECATE(tmpfile_s) + _ACRTIMP FILE* __cdecl tmpfile(void); + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0( + _Success_(return == 0) + errno_t, tmpnam_s, + _Always_(_Post_z_) char, _Buffer + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0( + _Success_(return != 0) + char*, __RETURN_POLICY_DST, _ACRTIMP, tmpnam, + _Pre_maybenull_ _Always_(_Post_z_), char, _Buffer + ) + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl ungetc( + _In_ int _Character, + _Inout_ FILE* _Stream + ); + + + + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + // + // I/O Synchronization and _nolock family of I/O functions + // + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + _ACRTIMP void __cdecl _lock_file( + _Inout_ FILE* _Stream + ); + + _ACRTIMP void __cdecl _unlock_file( + _Inout_ FILE* _Stream + ); + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl _fclose_nolock( + _Inout_ FILE* _Stream + ); + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl _fflush_nolock( + _Inout_opt_ FILE* _Stream + ); + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl _fgetc_nolock( + _Inout_ FILE* _Stream + ); + + _Success_(return != EOF) + _Check_return_opt_ + _ACRTIMP int __cdecl _fputc_nolock( + _In_ int _Character, + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP size_t __cdecl _fread_nolock( + _Out_writes_bytes_(_ElementSize * _ElementCount) void* _Buffer, + _In_ size_t _ElementSize, + _In_ size_t _ElementCount, + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _Success_(return != 0) + _ACRTIMP size_t __cdecl _fread_nolock_s( + _Out_writes_bytes_to_(_BufferSize, _ElementSize * _ElementCount) void* _Buffer, + _In_range_(>=, _ElementSize * _ElementCount) size_t _BufferSize, + _In_ size_t _ElementSize, + _In_ size_t _ElementCount, + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _fseek_nolock( + _Inout_ FILE* _Stream, + _In_ long _Offset, + _In_ int _Origin + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _fseeki64_nolock( + _Inout_ FILE* _Stream, + _In_ __int64 _Offset, + _In_ int _Origin + ); + + _Check_return_ + _ACRTIMP long __cdecl _ftell_nolock( + _Inout_ FILE* _Stream + ); + + _Check_return_ + _ACRTIMP __int64 __cdecl _ftelli64_nolock( + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP size_t __cdecl _fwrite_nolock( + _In_reads_bytes_(_ElementSize * _ElementCount) void const* _Buffer, + _In_ size_t _ElementSize, + _In_ size_t _ElementCount, + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _getc_nolock( + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _putc_nolock( + _In_ int _Character, + _Inout_ FILE* _Stream + ); + + _Check_return_opt_ + _ACRTIMP int __cdecl _ungetc_nolock( + _In_ int _Character, + _Inout_ FILE* _Stream + ); + + #define _getchar_nolock() _getc_nolock(stdin) + #define _putchar_nolock(_Ch) _putc_nolock(_Ch, stdout) + #define _getwchar_nolock() _getwc_nolock(stdin) + #define _putwchar_nolock(_Ch) _putwc_nolock(_Ch, stdout) + + + + #if defined _CRT_DISABLE_PERFCRIT_LOCKS && !defined _DLL + #define fclose(_Stream) _fclose_nolock(_Stream) + #define fflush(_Stream) _fflush_nolock(_Stream) + #define fgetc(_Stream) _fgetc_nolock(_Stream) + #define fputc(_Ch, _Stream) _fputc_nolock(_Ch, _Stream) + #define fread(_DstBuf, _ElementSize, _Count, _Stream) _fread_nolock(_DstBuf, _ElementSize, _Count, _Stream) + #define fread_s(_DstBuf, _DstSize, _ElementSize, _Count, _Stream) _fread_nolock_s(_DstBuf, _DstSize, _ElementSize, _Count, _Stream) + #define fseek(_Stream, _Offset, _Origin) _fseek_nolock(_Stream, _Offset, _Origin) + #define _fseeki64(_Stream, _Offset, _Origin) _fseeki64_nolock(_Stream, _Offset, _Origin) + #define ftell(_Stream) _ftell_nolock(_Stream) + #define _ftelli64(_Stream) _ftelli64_nolock(_Stream) + #define fwrite(_SrcBuf, _ElementSize, _Count, _Stream) _fwrite_nolock(_SrcBuf, _ElementSize, _Count, _Stream) + #define getc(_Stream) _getc_nolock(_Stream) + #define putc(_Ch, _Stream) _putc_nolock(_Ch, _Stream) + #define ungetc(_Ch, _Stream) _ungetc_nolock(_Ch, _Stream) + #endif + + + + _ACRTIMP int* __cdecl __p__commode(void); + + #ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY + extern int _commode; + #else + #define _commode (*__p__commode()) + #endif + + + + // Variadic functions are not supported in managed code under /clr + #if defined _M_CEE_MIXED + #pragma managed(push, off) + #endif + + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + // + // Narrow Character Formatted Output Functions (Stream) + // + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + _ACRTIMP int __cdecl __stdio_common_vfprintf( + _In_ unsigned __int64 _Options, + _Inout_ FILE* _Stream, + _In_z_ _Printf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _ArgList + ); + + _ACRTIMP int __cdecl __stdio_common_vfprintf_s( + _In_ unsigned __int64 _Options, + _Inout_ FILE* _Stream, + _In_z_ _Printf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _ArgList + ); + + _Success_(return >= 0) + _ACRTIMP int __cdecl __stdio_common_vfprintf_p( + _In_ unsigned __int64 _Options, + _Inout_ FILE* _Stream, + _In_z_ _Printf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _ArgList + ); + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vfprintf_l( + _Inout_ FILE* const _Stream, + _In_z_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vfprintf( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_l(_Stream, _Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vfprintf_s_l( + _Inout_ FILE* const _Stream, + _In_z_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList); + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vfprintf_s( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_s_l(_Stream, _Format, NULL, _ArgList); + } + #endif + + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vfprintf_p_l( + _Inout_ FILE* const _Stream, + _In_z_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return __stdio_common_vfprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vfprintf_p( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_p_l(_Stream, _Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vprintf_l( + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_l(stdout, _Format, _Locale, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vprintf( + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_l(stdout, _Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vprintf_s_l( + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_s_l(stdout, _Format, _Locale, _ArgList); + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vprintf_s( + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_s_l(stdout, _Format, NULL, _ArgList); + } + #endif + + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vprintf_p_l( + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_p_l(stdout, _Format, _Locale, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vprintf_p( + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfprintf_p_l(stdout, _Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _fprintf_l( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfprintf_l(_Stream, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL fprintf( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfprintf_l(_Stream, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _ACRTIMP int __cdecl _set_printf_count_output( + _In_ int _Value + ); + + _ACRTIMP int __cdecl _get_printf_count_output(void); + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _fprintf_s_l( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfprintf_s_l(_Stream, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL fprintf_s( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfprintf_s_l(_Stream, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _fprintf_p_l( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfprintf_p_l(_Stream, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _fprintf_p( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfprintf_p_l(_Stream, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _printf_l( + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfprintf_l(stdout, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL printf( + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfprintf_l(stdout, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _printf_s_l( + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfprintf_s_l(stdout, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL printf_s( + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfprintf_s_l(stdout, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _printf_p_l( + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfprintf_p_l(stdout, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _printf_p( + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfprintf_p_l(stdout, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + // + // Narrow Character Formatted Input Functions (Stream) + // + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + _ACRTIMP int __cdecl __stdio_common_vfscanf( + _In_ unsigned __int64 _Options, + _Inout_ FILE* _Stream, + _In_z_ _Scanf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _Arglist + ); + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vfscanf_l( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return __stdio_common_vfscanf( + _CRT_INTERNAL_LOCAL_SCANF_OPTIONS, + _Stream, _Format, _Locale, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vfscanf( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfscanf_l(_Stream, _Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vfscanf_s_l( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return __stdio_common_vfscanf( + _CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, + _Stream, _Format, _Locale, _ArgList); + } + #endif + + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vfscanf_s( + _Inout_ FILE* const _Stream, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfscanf_s_l(_Stream, _Format, NULL, _ArgList); + } + #endif + + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vscanf_l( + _In_z_ _Printf_format_string_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfscanf_l(stdin, _Format, _Locale, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vscanf( + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfscanf_l(stdin, _Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vscanf_s_l( + _In_z_ _Printf_format_string_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfscanf_s_l(stdin, _Format, _Locale, _ArgList); + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vscanf_s( + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vfscanf_s_l(stdin, _Format, NULL, _ArgList); + } + #endif + + #endif + + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_fscanf_s_l) + _CRT_STDIO_INLINE int __CRTDECL _fscanf_l( + _Inout_ FILE* const _Stream, + _In_z_ _Scanf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfscanf_l(_Stream, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_ _CRT_INSECURE_DEPRECATE(fscanf_s) + _CRT_STDIO_INLINE int __CRTDECL fscanf( + _Inout_ FILE* const _Stream, + _In_z_ _Scanf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfscanf_l(_Stream, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _fscanf_s_l( + _Inout_ FILE* const _Stream, + _In_z_ _Scanf_s_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfscanf_s_l(_Stream, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL fscanf_s( + _Inout_ FILE* const _Stream, + _In_z_ _Scanf_s_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfscanf_s_l(_Stream, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #endif + + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_scanf_s_l) + _CRT_STDIO_INLINE int __CRTDECL _scanf_l( + _In_z_ _Scanf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfscanf_l(stdin, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_ _CRT_INSECURE_DEPRECATE(scanf_s) + _CRT_STDIO_INLINE int __CRTDECL scanf( + _In_z_ _Scanf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfscanf_l(stdin, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _scanf_s_l( + _In_z_ _Scanf_s_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vfscanf_s_l(stdin, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL scanf_s( + _In_z_ _Scanf_s_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vfscanf_s_l(stdin, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #endif + + + + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + // + // Narrow Character Formatted Output Functions (String) + // + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + _Success_(return >= 0) + _ACRTIMP int __cdecl __stdio_common_vsprintf( + _In_ unsigned __int64 _Options, + _Out_writes_opt_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_z_ _Printf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _ArgList + ); + + _Success_(return >= 0) + _ACRTIMP int __cdecl __stdio_common_vsprintf_s( + _In_ unsigned __int64 _Options, + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_z_ _Printf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _ArgList + ); + + _Success_(return >= 0) + _ACRTIMP int __cdecl __stdio_common_vsnprintf_s( + _In_ unsigned __int64 _Options, + _Out_writes_opt_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ size_t _MaxCount, + _In_z_ _Printf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _ArgList + ); + + _Success_(return >= 0) + _ACRTIMP int __cdecl __stdio_common_vsprintf_p( + _In_ unsigned __int64 _Options, + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_z_ _Printf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _ArgList + ); + + _Success_(return >= 0) + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_vsnprintf_s_l) + _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_l( + _Out_writes_opt_(_BufferCount) _Post_maybez_ char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int const _Result = __stdio_common_vsprintf( + _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, + _Buffer, _BufferCount, _Format, _Locale, _ArgList); + + return _Result < 0 ? -1 : _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsnprintf( + _Out_writes_opt_(_BufferCount) _Post_maybez_ char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsnprintf_l(_Buffer, _BufferCount, _Format, NULL, _ArgList); + } + #endif + + #if defined vsnprintf + // This definition of vsnprintf will generate "warning C4005: 'vsnprintf': macro + // redefinition" with a subsequent line indicating where the previous definition + // of vsnprintf was. This makes it easier to find where vsnprintf was defined. + #pragma warning(push, 1) + #pragma warning(1: 4005) // macro redefinition + #define vsnprintf Do not define vsnprintf as a macro + #pragma warning(pop) + #error Macro definition of vsnprintf conflicts with Standard Library function declaration + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vsnprintf( + _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int const _Result = __stdio_common_vsprintf( + _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, + _Buffer, _BufferCount, _Format, NULL, _ArgList); + + return _Result < 0 ? -1 : _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_vsprintf_s_l) + _CRT_STDIO_INLINE int __CRTDECL _vsprintf_l( + _Pre_notnull_ _Always_(_Post_z_) char* const _Buffer, + _In_z_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsnprintf_l(_Buffer, (size_t)-1, _Format, _Locale, _ArgList); + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(vsprintf_s) + _CRT_STDIO_INLINE int __CRTDECL vsprintf( + _Pre_notnull_ _Always_(_Post_z_) char* const _Buffer, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsnprintf_l(_Buffer, (size_t)-1, _Format, NULL, _ArgList); + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsprintf_s_l( + _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int const _Result = __stdio_common_vsprintf_s( + _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, + _Buffer, _BufferCount, _Format, _Locale, _ArgList); + + return _Result < 0 ? -1 : _Result; + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vsprintf_s( + _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsprintf_s_l(_Buffer, _BufferCount, _Format, NULL, _ArgList); + } + #endif + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2( + _Success_(return >= 0) + int, vsprintf_s, + _Always_(_Post_z_) char, _Buffer, + _In_z_ _Printf_format_string_ char const*, _Format, + va_list, _ArgList + ) + + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsprintf_p_l( + _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int const _Result = __stdio_common_vsprintf_p( + _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, + _Buffer, _BufferCount, _Format, _Locale, _ArgList); + + return _Result < 0 ? -1 : _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsprintf_p( + _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsprintf_p_l(_Buffer, _BufferCount, _Format, NULL, _ArgList); + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_s_l( + _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_ size_t const _MaxCount, + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int const _Result = __stdio_common_vsnprintf_s( + _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, + _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList); + + return _Result < 0 ? -1 : _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_s( + _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_ size_t const _MaxCount, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, NULL, _ArgList); + } + #endif + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_3( + _Success_(return >= 0) + int, _vsnprintf_s, + _Always_(_Post_z_) char, _Buffer, + _In_ size_t, _BufferCount, + _In_z_ _Printf_format_string_ char const*, _Format, + va_list, _ArgList + ) + + #if __STDC_WANT_SECURE_LIB__ + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vsnprintf_s( + _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_ size_t const _MaxCount, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, NULL, _ArgList); + } + #endif + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_3( + _Success_(return >= 0) + int, vsnprintf_s, + _Always_(_Post_z_) char, _Buffer, + _In_ size_t, _BufferCount, + _In_z_ _Printf_format_string_ char const*, _Format, + va_list, _ArgList + ) + + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vscprintf_l( + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int const _Result = __stdio_common_vsprintf( + _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, + NULL, 0, _Format, _Locale, _ArgList); + + return _Result < 0 ? -1 : _Result; + } + #endif + + _Check_return_ + _CRT_STDIO_INLINE int __CRTDECL _vscprintf( + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vscprintf_l(_Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vscprintf_p_l( + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int const _Result = __stdio_common_vsprintf_p( + _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, + NULL, 0, _Format, _Locale, _ArgList); + + return _Result < 0 ? -1 : _Result; + } + #endif + + _Check_return_ + _CRT_STDIO_INLINE int __CRTDECL _vscprintf_p( + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vscprintf_p_l(_Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_c_l( + _Out_writes_opt_(_BufferCount) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_params_(2) char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int const _Result = __stdio_common_vsprintf( + _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, + _Buffer, _BufferCount, _Format, _Locale, _ArgList); + + return _Result < 0 ? -1 : _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_c( + _Out_writes_opt_(_BufferCount) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsnprintf_c_l(_Buffer, _BufferCount, _Format, NULL, _ArgList); + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_sprintf_s_l) + _CRT_STDIO_INLINE int __CRTDECL _sprintf_l( + _Pre_notnull_ _Always_(_Post_z_) char* const _Buffer, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + + _Result = _vsprintf_l(_Buffer, _Format, _Locale, _ArgList); + + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL sprintf( + _Pre_notnull_ _Always_(_Post_z_) char* const _Buffer, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + + _Result = _vsprintf_l(_Buffer, _Format, NULL, _ArgList); + + __crt_va_end(_ArgList); + return _Result; + } + #endif + + __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST( + _Success_(return >= 0) + int, __RETURN_POLICY_SAME, __EMPTY_DECLSPEC, __CRTDECL, sprintf, vsprintf, + _Pre_notnull_ _Always_(_Post_z_), char, _Buffer, + _In_z_ _Printf_format_string_ char const*, _Format + ) + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _sprintf_s_l( + _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL sprintf_s( + _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vsprintf_s_l(_Buffer, _BufferCount, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #endif + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1_ARGLIST( + _Success_(return >= 0) + int, sprintf_s, vsprintf_s, + _Always_(_Post_z_) char, _Buffer, + _In_z_ _Printf_format_string_ char const*, _Format + ) + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _sprintf_p_l( + _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _sprintf_p( + _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vsprintf_p_l(_Buffer, _BufferCount, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snprintf_s_l) + _CRT_STDIO_INLINE int __CRTDECL _snprintf_l( + _Out_writes_opt_(_BufferCount) _Post_maybez_ char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + + _Result = _vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList); + + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #if defined snprintf + // This definition of snprintf will generate "warning C4005: 'snprintf': macro + // redefinition" with a subsequent line indicating where the previous definition + // of snprintf was. This makes it easier to find where snprintf was defined. + #pragma warning(push, 1) + #pragma warning(1: 4005) // macro redefinition + #define snprintf Do not define snprintf as a macro + #pragma warning(pop) + #error Macro definition of snprintf conflicts with Standard Library function declaration + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL snprintf( + _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = vsnprintf(_Buffer, _BufferCount, _Format, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _snprintf( + _Out_writes_opt_(_BufferCount) _Post_maybez_ char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vsnprintf(_Buffer, _BufferCount, _Format, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX( + _Success_(return >= 0) + int, __RETURN_POLICY_SAME, __EMPTY_DECLSPEC, __CRTDECL, _snprintf, _vsnprintf, + _Pre_notnull_ _Post_maybez_ char, + _Out_writes_opt_(_BufferCount) _Post_maybez_, char, _Buffer, + _In_ size_t, _BufferCount, + _In_z_ _Printf_format_string_ char const*, _Format + ) + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _snprintf_c_l( + _Out_writes_opt_(_BufferCount) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _snprintf_c( + _Out_writes_opt_(_BufferCount) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vsnprintf_c_l(_Buffer, _BufferCount, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _snprintf_s_l( + _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_ size_t const _MaxCount, + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Success_(return >= 0) + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _snprintf_s( + _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, + _In_ size_t const _BufferCount, + _In_ size_t const _MaxCount, + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2_ARGLIST( + _Success_(return >= 0) + int, _snprintf_s, _vsnprintf_s, + _Always_(_Post_z_) char, _Buffer, + _In_ size_t, _BufferCount, + _In_z_ _Printf_format_string_ char const*, _Format + ) + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _scprintf_l( + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vscprintf_l(_Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_ + _CRT_STDIO_INLINE int __CRTDECL _scprintf( + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vscprintf_l(_Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _scprintf_p_l( + _In_z_ _Printf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vscprintf_p_l(_Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_ + _CRT_STDIO_INLINE int __CRTDECL _scprintf_p( + _In_z_ _Printf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vscprintf_p(_Format, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + // + // Narrow Character Formatted Input Functions (String) + // + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + _ACRTIMP int __cdecl __stdio_common_vsscanf( + _In_ unsigned __int64 _Options, + _In_reads_(_BufferCount) _Pre_z_ char const* _Buffer, + _In_ size_t _BufferCount, + _In_z_ _Scanf_format_string_params_(2) char const* _Format, + _In_opt_ _locale_t _Locale, + va_list _ArgList + ); + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsscanf_l( + _In_z_ char const* const _Buffer, + _In_z_ _Printf_format_string_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return __stdio_common_vsscanf( + _CRT_INTERNAL_LOCAL_SCANF_OPTIONS, + _Buffer, (size_t)-1, _Format, _Locale, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vsscanf( + _In_z_ char const* const _Buffer, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsscanf_l(_Buffer, _Format, NULL, _ArgList); + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _vsscanf_s_l( + _In_z_ char const* const _Buffer, + _In_z_ _Printf_format_string_ char const* const _Format, + _In_opt_ _locale_t const _Locale, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return __stdio_common_vsscanf( + _CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, + _Buffer, (size_t)-1, _Format, _Locale, _ArgList); + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + #pragma warning(push) + #pragma warning(disable: 6530) // Unrecognized SAL format string + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL vsscanf_s( + _In_z_ char const* const _Buffer, + _In_z_ _Printf_format_string_ char const* const _Format, + va_list _ArgList + ) + #if defined _NO_CRT_STDIO_INLINE + ; + #else + { + return _vsscanf_s_l(_Buffer, _Format, NULL, _ArgList); + } + #endif + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2( + int, vsscanf_s, + _In_z_ char const, _Buffer, + _In_z_ _Printf_format_string_ char const*, _Format, + va_list, _ArgList + ) + + #pragma warning(pop) + + #endif + + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_sscanf_s_l) + _CRT_STDIO_INLINE int __CRTDECL _sscanf_l( + _In_z_ char const* const _Buffer, + _In_z_ _Scanf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vsscanf_l(_Buffer, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_ _CRT_INSECURE_DEPRECATE(sscanf_s) + _CRT_STDIO_INLINE int __CRTDECL sscanf( + _In_z_ char const* const _Buffer, + _In_z_ _Scanf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + _Result = _vsscanf_l(_Buffer, _Format, NULL, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _sscanf_s_l( + _In_z_ char const* const _Buffer, + _In_z_ _Scanf_s_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + _Result = _vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList); + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #if __STDC_WANT_SECURE_LIB__ + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL sscanf_s( + _In_z_ char const* const _Buffer, + _In_z_ _Scanf_s_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + + _Result = vsscanf_s(_Buffer, _Format, _ArgList); + + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #endif + + #pragma warning(push) + #pragma warning(disable: 6530) // Unrecognized SAL format string + + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snscanf_s_l) + _CRT_STDIO_INLINE int __CRTDECL _snscanf_l( + _In_reads_bytes_(_BufferCount) _Pre_z_ char const* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Scanf_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + + _Result = __stdio_common_vsscanf( + _CRT_INTERNAL_LOCAL_SCANF_OPTIONS, + _Buffer, _BufferCount, _Format, _Locale, _ArgList); + + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snscanf_s) + _CRT_STDIO_INLINE int __CRTDECL _snscanf( + _In_reads_bytes_(_BufferCount) _Pre_z_ char const* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Scanf_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + + _Result = __stdio_common_vsscanf( + _CRT_INTERNAL_LOCAL_SCANF_OPTIONS, + _Buffer, _BufferCount, _Format, NULL, _ArgList); + + __crt_va_end(_ArgList); + return _Result; + } + #endif + + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _snscanf_s_l( + _In_reads_bytes_(_BufferCount) _Pre_z_ char const* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Scanf_s_format_string_params_(0) char const* const _Format, + _In_opt_ _locale_t const _Locale, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Locale); + + _Result = __stdio_common_vsscanf( + _CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, + _Buffer, _BufferCount, _Format, _Locale, _ArgList); + + __crt_va_end(_ArgList); + return _Result; + } + #endif + + _Check_return_opt_ + _CRT_STDIO_INLINE int __CRTDECL _snscanf_s( + _In_reads_bytes_(_BufferCount) _Pre_z_ char const* const _Buffer, + _In_ size_t const _BufferCount, + _In_z_ _Scanf_s_format_string_ char const* const _Format, + ...) + #if defined _NO_CRT_STDIO_INLINE // SCANF + ; + #else + { + int _Result; + va_list _ArgList; + __crt_va_start(_ArgList, _Format); + + _Result = __stdio_common_vsscanf( + _CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, + _Buffer, _BufferCount, _Format, NULL, _ArgList); + + __crt_va_end(_ArgList); + return _Result; + } + #endif + + #pragma warning(pop) + + #if defined _M_CEE_MIXED + #pragma managed(pop) + #endif + + + + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + // + // Non-ANSI Names for Compatibility + // + //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES + + #define SYS_OPEN _SYS_OPEN + + #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC + #pragma push_macro("tempnam") + #undef tempnam + #endif + + _CRT_NONSTDC_DEPRECATE(_tempnam) + _ACRTIMP char* __cdecl tempnam( + _In_opt_z_ char const* _Directory, + _In_opt_z_ char const* _FilePrefix + ); + + #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC + #pragma pop_macro("tempnam") + #endif + + _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_fcloseall) _ACRTIMP int __cdecl fcloseall(void); + _Check_return_ _CRT_NONSTDC_DEPRECATE(_fdopen) _ACRTIMP FILE* __cdecl fdopen(_In_ int _FileHandle, _In_z_ char const* _Format); + _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_fgetchar) _ACRTIMP int __cdecl fgetchar(void); + _Check_return_ _CRT_NONSTDC_DEPRECATE(_fileno) _ACRTIMP int __cdecl fileno(_In_ FILE* _Stream); + _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_flushall) _ACRTIMP int __cdecl flushall(void); + _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_fputchar) _ACRTIMP int __cdecl fputchar(_In_ int _Ch); + _Check_return_ _CRT_NONSTDC_DEPRECATE(_getw) _ACRTIMP int __cdecl getw(_Inout_ FILE* _Stream); + _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_putw) _ACRTIMP int __cdecl putw(_In_ int _Ch, _Inout_ FILE* _Stream); + _Check_return_ _CRT_NONSTDC_DEPRECATE(_rmtmp) _ACRTIMP int __cdecl rmtmp(void); + + #endif // _CRT_INTERNAL_NONSTDC_NAMES +#endif // _CRT_FUNCTIONS_REQUIRED + + + +_CRT_END_C_HEADER +_UCRT_RESTORE_CLANG_WARNINGS +#pragma warning(pop) // _UCRT_DISABLED_WARNINGS +#endif // _INC_STDIO diff --git a/stdlib.h b/stdlib.h new file mode 100644 index 0000000..53b6e08 --- /dev/null +++ b/stdlib.h @@ -0,0 +1,1362 @@ +// +// stdlib.h +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// The C Standard Library header. +// +#pragma once +#ifndef _INC_STDLIB // include guard for 3rd party interop +#define _INC_STDLIB + +#include +#include +#include +#include +#include + +#pragma warning(push) +#pragma warning(disable: _UCRT_DISABLED_WARNINGS) +_UCRT_DISABLE_CLANG_WARNINGS + +_CRT_BEGIN_C_HEADER + + + +#ifndef _countof + #define _countof __crt_countof +#endif + + + +// Minimum and maximum macros +#define __max(a,b) (((a) > (b)) ? (a) : (b)) +#define __min(a,b) (((a) < (b)) ? (a) : (b)) + + + +_ACRTIMP void __cdecl _swab( + _Inout_updates_(_SizeInBytes) _Post_readable_size_(_SizeInBytes) char* _Buf1, + _Inout_updates_(_SizeInBytes) _Post_readable_size_(_SizeInBytes) char* _Buf2, + _In_ int _SizeInBytes + ); + + + +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// +// Exit and Abort +// +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// Argument values for exit() +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 + +#if _CRT_FUNCTIONS_REQUIRED + _ACRTIMP __declspec(noreturn) void __cdecl exit(_In_ int _Code); + _ACRTIMP __declspec(noreturn) void __cdecl _exit(_In_ int _Code); + _ACRTIMP __declspec(noreturn) void __cdecl _Exit(_In_ int _Code); + _ACRTIMP __declspec(noreturn) void __cdecl quick_exit(_In_ int _Code); + _ACRTIMP __declspec(noreturn) void __cdecl abort(void); +#endif // _CRT_FUNCTIONS_REQUIRED + +// Argument values for _set_abort_behavior(). +#define _WRITE_ABORT_MSG 0x1 // debug only, has no effect in release +#define _CALL_REPORTFAULT 0x2 + +_ACRTIMP unsigned int __cdecl _set_abort_behavior( + _In_ unsigned int _Flags, + _In_ unsigned int _Mask + ); + + + +#ifndef _CRT_ONEXIT_T_DEFINED + #define _CRT_ONEXIT_T_DEFINED + + typedef int (__CRTDECL* _onexit_t)(void); + #ifdef _M_CEE + typedef int (__clrcall* _onexit_m_t)(void); + #endif +#endif + +#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES + // Non-ANSI name for compatibility + #define onexit_t _onexit_t +#endif + + + +#ifdef _M_CEE + #pragma warning (push) + #pragma warning (disable: 4985) // Attributes not present on previous declaration + + _Check_return_ int __clrcall _atexit_m_appdomain(_In_opt_ void (__clrcall* _Function)(void)); + + _onexit_m_t __clrcall _onexit_m_appdomain(_onexit_m_t _Function); + + #ifdef _M_CEE_MIXED + #ifdef __cplusplus + [System::Security::SecurityCritical] + #endif + _Check_return_ int __clrcall _atexit_m(_In_opt_ void (__clrcall* _Function)(void)); + + _onexit_m_t __clrcall _onexit_m(_onexit_m_t _Function); + #else + #ifdef __cplusplus + [System::Security::SecurityCritical] + #endif + _Check_return_ inline int __clrcall _atexit_m(_In_opt_ void (__clrcall* _Function)(void)) + { + return _atexit_m_appdomain(_Function); + } + + inline _onexit_m_t __clrcall _onexit_m(_onexit_t _Function) + { + return _onexit_m_appdomain(_Function); + } + #endif + #pragma warning (pop) +#endif + + + +#ifdef _M_CEE_PURE + // In pure mode, atexit is the same as atexit_m_appdomain + extern "C++" + { + + #ifdef __cplusplus + [System::Security::SecurityCritical] + #endif + inline int __clrcall atexit(void (__clrcall* _Function)(void)) + { + return _atexit_m_appdomain(_Function); + } + + inline _onexit_t __clrcall _onexit(_onexit_t _Function) + { + return _onexit_m_appdomain(_Function); + } + + } // extern "C++" +#else + int __cdecl atexit(void (__cdecl*)(void)); + _onexit_t __cdecl _onexit(_In_opt_ _onexit_t _Func); +#endif + +int __cdecl at_quick_exit(void (__cdecl*)(void)); + + + +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// +// Global State (errno, global handlers, etc.) +// +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +#ifndef _M_CEE_PURE + // a purecall handler procedure. Never returns normally + typedef void (__cdecl* _purecall_handler)(void); + + // Invalid parameter handler function pointer type + typedef void (__cdecl* _invalid_parameter_handler)( + wchar_t const*, + wchar_t const*, + wchar_t const*, + unsigned int, + uintptr_t + ); + + // Establishes a purecall handler + _VCRTIMP _purecall_handler __cdecl _set_purecall_handler( + _In_opt_ _purecall_handler _Handler + ); + + _VCRTIMP _purecall_handler __cdecl _get_purecall_handler(void); + + // Establishes an invalid parameter handler + _ACRTIMP _invalid_parameter_handler __cdecl _set_invalid_parameter_handler( + _In_opt_ _invalid_parameter_handler _Handler + ); + + _ACRTIMP _invalid_parameter_handler __cdecl _get_invalid_parameter_handler(void); + + _ACRTIMP _invalid_parameter_handler __cdecl _set_thread_local_invalid_parameter_handler( + _In_opt_ _invalid_parameter_handler _Handler + ); + + _ACRTIMP _invalid_parameter_handler __cdecl _get_thread_local_invalid_parameter_handler(void); +#endif + + +#if defined __cplusplus && defined _M_CEE_PURE +extern "C++" +{ + typedef void (__clrcall* _purecall_handler)(void); + typedef _purecall_handler _purecall_handler_m; + + _MRTIMP _purecall_handler __cdecl _set_purecall_handler( + _In_opt_ _purecall_handler _Handler + ); +} // extern "C++" +#endif + + + +// Argument values for _set_error_mode(). +#define _OUT_TO_DEFAULT 0 +#define _OUT_TO_STDERR 1 +#define _OUT_TO_MSGBOX 2 +#define _REPORT_ERRMODE 3 + +_Check_return_opt_ _ACRTIMP int __cdecl _set_error_mode(_In_ int _Mode); + + + +#if _CRT_FUNCTIONS_REQUIRED + _ACRTIMP int* __cdecl _errno(void); + #define errno (*_errno()) + + _ACRTIMP errno_t __cdecl _set_errno(_In_ int _Value); + _ACRTIMP errno_t __cdecl _get_errno(_Out_ int* _Value); + + _ACRTIMP unsigned long* __cdecl __doserrno(void); + #define _doserrno (*__doserrno()) + + _ACRTIMP errno_t __cdecl _set_doserrno(_In_ unsigned long _Value); + _ACRTIMP errno_t __cdecl _get_doserrno(_Out_ unsigned long * _Value); + + // This is non-const for backwards compatibility; do not modify it. + _ACRTIMP _CRT_INSECURE_DEPRECATE(strerror) char** __cdecl __sys_errlist(void); + #define _sys_errlist (__sys_errlist()) + + _ACRTIMP _CRT_INSECURE_DEPRECATE(strerror) int * __cdecl __sys_nerr(void); + #define _sys_nerr (*__sys_nerr()) + + _ACRTIMP void __cdecl perror(_In_opt_z_ char const* _ErrMsg); +#endif // _CRT_FUNCTIONS_REQUIRED + + + +// These point to the executable module name. +_CRT_INSECURE_DEPRECATE_GLOBALS(_get_pgmptr ) _ACRTIMP char** __cdecl __p__pgmptr (void); +_CRT_INSECURE_DEPRECATE_GLOBALS(_get_wpgmptr) _ACRTIMP wchar_t** __cdecl __p__wpgmptr(void); +_CRT_INSECURE_DEPRECATE_GLOBALS(_get_fmode ) _ACRTIMP int* __cdecl __p__fmode (void); + +#ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY + _CRT_INSECURE_DEPRECATE_GLOBALS(_get_pgmptr ) extern char* _pgmptr; + _CRT_INSECURE_DEPRECATE_GLOBALS(_get_wpgmptr) extern wchar_t* _wpgmptr; + #ifndef _CORECRT_BUILD + _CRT_INSECURE_DEPRECATE_GLOBALS(_get_fmode ) extern int _fmode; + #endif +#else + #define _pgmptr (*__p__pgmptr ()) + #define _wpgmptr (*__p__wpgmptr()) + #define _fmode (*__p__fmode ()) +#endif + +_Success_(return == 0) +_ACRTIMP errno_t __cdecl _get_pgmptr (_Outptr_result_z_ char** _Value); + +_Success_(return == 0) +_ACRTIMP errno_t __cdecl _get_wpgmptr(_Outptr_result_z_ wchar_t** _Value); + +_ACRTIMP errno_t __cdecl _set_fmode (_In_ int _Mode ); + +_ACRTIMP errno_t __cdecl _get_fmode (_Out_ int* _PMode); + + + +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// +// Math +// +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +typedef struct _div_t +{ + int quot; + int rem; +} div_t; + +typedef struct _ldiv_t +{ + long quot; + long rem; +} ldiv_t; + +typedef struct _lldiv_t +{ + long long quot; + long long rem; +} lldiv_t; + +_Check_return_ int __cdecl abs (_In_ int _Number); +_Check_return_ long __cdecl labs (_In_ long _Number); +_Check_return_ long long __cdecl llabs (_In_ long long _Number); +_Check_return_ __int64 __cdecl _abs64(_In_ __int64 _Number); + +_Check_return_ unsigned short __cdecl _byteswap_ushort(_In_ unsigned short _Number); +_Check_return_ unsigned long __cdecl _byteswap_ulong (_In_ unsigned long _Number); +_Check_return_ unsigned __int64 __cdecl _byteswap_uint64(_In_ unsigned __int64 _Number); + +_Check_return_ _ACRTIMP div_t __cdecl div (_In_ int _Numerator, _In_ int _Denominator); +_Check_return_ _ACRTIMP ldiv_t __cdecl ldiv (_In_ long _Numerator, _In_ long _Denominator); +_Check_return_ _ACRTIMP lldiv_t __cdecl lldiv(_In_ long long _Numerator, _In_ long long _Denominator); + +// These functions have declspecs in their declarations in the Windows headers, +// which cause PREfast to fire 6540. +#pragma warning(push) +#pragma warning(disable: 6540) + +unsigned int __cdecl _rotl( + _In_ unsigned int _Value, + _In_ int _Shift + ); + +_Check_return_ +unsigned long __cdecl _lrotl( + _In_ unsigned long _Value, + _In_ int _Shift + ); + +unsigned __int64 __cdecl _rotl64( + _In_ unsigned __int64 _Value, + _In_ int _Shift + ); + +unsigned int __cdecl _rotr( + _In_ unsigned int _Value, + _In_ int _Shift + ); + +_Check_return_ +unsigned long __cdecl _lrotr( + _In_ unsigned long _Value, + _In_ int _Shift + ); + +unsigned __int64 __cdecl _rotr64( + _In_ unsigned __int64 _Value, + _In_ int _Shift + ); + +#pragma warning(pop) + + + +// Maximum value that can be returned by the rand function: +#define RAND_MAX 0x7fff + +_ACRTIMP void __cdecl srand(_In_ unsigned int _Seed); + +_Check_return_ _ACRTIMP int __cdecl rand(void); + +#if defined _CRT_RAND_S || defined _CRTBLD + _ACRTIMP errno_t __cdecl rand_s(_Out_ unsigned int* _RandomValue); +#endif + + + +#ifdef __cplusplus +extern "C++" +{ + inline long abs(long const _X) throw() + { + return labs(_X); + } + + inline long long abs(long long const _X) throw() + { + return llabs(_X); + } + + inline ldiv_t div(long const _A1, long const _A2) throw() + { + return ldiv(_A1, _A2); + } + + inline lldiv_t div(long long const _A1, long long const _A2) throw() + { + return lldiv(_A1, _A2); + } +} +#endif // __cplusplus + + + + +// Structs used to fool the compiler into not generating floating point +// instructions when copying and pushing [long] double values +#define _CRT_DOUBLE_DEC + +#ifndef _LDSUPPORT + + #pragma pack(push, 4) + typedef struct + { + unsigned char ld[10]; + } _LDOUBLE; + #pragma pack(pop) + + #define _PTR_LD(x) ((unsigned char*)(&(x)->ld)) + +#else // _LDSUPPORT + + // push and pop long, which is #defined as __int64 by a spec2k test + #pragma push_macro("long") + #undef long + typedef long double _LDOUBLE; + #pragma pop_macro("long") + + #define _PTR_LD(x) ((unsigned char *)(x)) + +#endif // _LDSUPPORT + +typedef struct +{ + double x; +} _CRT_DOUBLE; + +typedef struct +{ + float f; +} _CRT_FLOAT; + +// push and pop long, which is #defined as __int64 by a spec2k test +#pragma push_macro("long") +#undef long + +typedef struct +{ + long double x; +} _LONGDOUBLE; + +#pragma pop_macro("long") + +#pragma pack(push, 4) +typedef struct +{ + unsigned char ld12[12]; +} _LDBL12; +#pragma pack(pop) + + + +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// +// Narrow String to Number Conversions +// +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +_Check_return_ _ACRTIMP double __cdecl atof (_In_z_ char const* _String); +_Check_return_ _CRT_JIT_INTRINSIC _ACRTIMP int __cdecl atoi (_In_z_ char const* _String); +_Check_return_ _ACRTIMP long __cdecl atol (_In_z_ char const* _String); +_Check_return_ _ACRTIMP long long __cdecl atoll (_In_z_ char const* _String); +_Check_return_ _ACRTIMP __int64 __cdecl _atoi64(_In_z_ char const* _String); + +_Check_return_ _ACRTIMP double __cdecl _atof_l (_In_z_ char const* _String, _In_opt_ _locale_t _Locale); +_Check_return_ _ACRTIMP int __cdecl _atoi_l (_In_z_ char const* _String, _In_opt_ _locale_t _Locale); +_Check_return_ _ACRTIMP long __cdecl _atol_l (_In_z_ char const* _String, _In_opt_ _locale_t _Locale); +_Check_return_ _ACRTIMP long long __cdecl _atoll_l (_In_z_ char const* _String, _In_opt_ _locale_t _Locale); +_Check_return_ _ACRTIMP __int64 __cdecl _atoi64_l(_In_z_ char const* _String, _In_opt_ _locale_t _Locale); + +_Check_return_ _ACRTIMP int __cdecl _atoflt (_Out_ _CRT_FLOAT* _Result, _In_z_ char const* _String); +_Check_return_ _ACRTIMP int __cdecl _atodbl (_Out_ _CRT_DOUBLE* _Result, _In_z_ char* _String); +_Check_return_ _ACRTIMP int __cdecl _atoldbl(_Out_ _LDOUBLE* _Result, _In_z_ char* _String); + +_Check_return_ +_ACRTIMP int __cdecl _atoflt_l( + _Out_ _CRT_FLOAT* _Result, + _In_z_ char const* _String, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP int __cdecl _atodbl_l( + _Out_ _CRT_DOUBLE* _Result, + _In_z_ char* _String, + _In_opt_ _locale_t _Locale + ); + + +_Check_return_ +_ACRTIMP int __cdecl _atoldbl_l( + _Out_ _LDOUBLE* _Result, + _In_z_ char* _String, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP float __cdecl strtof( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr + ); + +_Check_return_ +_ACRTIMP float __cdecl _strtof_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP double __cdecl strtod( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr + ); + +_Check_return_ +_ACRTIMP double __cdecl _strtod_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP long double __cdecl strtold( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr + ); + +_Check_return_ +_ACRTIMP long double __cdecl _strtold_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP long __cdecl strtol( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix + ); + +_Check_return_ +_ACRTIMP long __cdecl _strtol_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP long long __cdecl strtoll( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix + ); + +_Check_return_ +_ACRTIMP long long __cdecl _strtoll_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP unsigned long __cdecl strtoul( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix + ); + +_Check_return_ +_ACRTIMP unsigned long __cdecl _strtoul_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP unsigned long long __cdecl strtoull( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix + ); + +_Check_return_ +_ACRTIMP unsigned long long __cdecl _strtoull_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP __int64 __cdecl _strtoi64( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix + ); + +_Check_return_ +_ACRTIMP __int64 __cdecl _strtoi64_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP unsigned __int64 __cdecl _strtoui64( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix + ); + +_Check_return_ +_ACRTIMP unsigned __int64 __cdecl _strtoui64_l( + _In_z_ char const* _String, + _Out_opt_ _Deref_post_z_ char** _EndPtr, + _In_ int _Radix, + _In_opt_ _locale_t _Locale + ); + + + +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// +// Number to Narrow String Conversions +// +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +_Success_(return == 0) +_Check_return_opt_ +_ACRTIMP errno_t __cdecl _itoa_s( + _In_ int _Value, + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ int _Radix + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1( + _Success_(return == 0) + errno_t, _itoa_s, + _In_ int, _Value, + char, _Buffer, + _In_ int, _Radix + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_1_1( + char*, __RETURN_POLICY_DST, _ACRTIMP, _itoa, + _In_ int, _Value, + _Pre_notnull_ _Post_z_, char, _Buffer, + _In_ int, _Radix + ) + +_Success_(return == 0) +_Check_return_opt_ +_ACRTIMP errno_t __cdecl _ltoa_s( + _In_ long _Value, + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ int _Radix + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1( + errno_t, _ltoa_s, + _In_ long, _Value, + char, _Buffer, + _In_ int, _Radix + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_1_1( + char*, __RETURN_POLICY_DST, _ACRTIMP, _ltoa, + _In_ long, _Value, + _Pre_notnull_ _Post_z_, char, _Buffer, + _In_ int, _Radix + ) + +_Success_(return == 0) +_Check_return_opt_ +_ACRTIMP errno_t __cdecl _ultoa_s( + _In_ unsigned long _Value, + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ int _Radix + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1( + errno_t, _ultoa_s, + _In_ unsigned long, _Value, + char, _Buffer, + _In_ int, _Radix + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_1_1( + char*, __RETURN_POLICY_DST, _ACRTIMP, _ultoa, + _In_ unsigned long, _Value, + _Pre_notnull_ _Post_z_, char, _Buffer, + _In_ int, _Radix + ) + +_Success_(return == 0) +_Check_return_opt_ +_ACRTIMP errno_t __cdecl _i64toa_s( + _In_ __int64 _Value, + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ int _Radix + ); + +_Success_(return == 0) +_CRT_INSECURE_DEPRECATE(_i64toa_s) +_ACRTIMP char* __cdecl _i64toa( + _In_ __int64 _Value, + _Pre_notnull_ _Post_z_ char* _Buffer, + _In_ int _Radix + ); + +_Success_(return == 0) +_Check_return_opt_ +_ACRTIMP errno_t __cdecl _ui64toa_s( + _In_ unsigned __int64 _Value, + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ int _Radix + ); + +_CRT_INSECURE_DEPRECATE(_ui64toa_s) +_ACRTIMP char* __cdecl _ui64toa( + _In_ unsigned __int64 _Value, + _Pre_notnull_ _Post_z_ char* _Buffer, + _In_ int _Radix + ); + + + +// _CVTBUFSIZE is the maximum size for the per-thread conversion buffer. It +// should be at least as long as the number of digits in the largest double +// precision value (?.?e308 in IEEE arithmetic). We will use the same size +// buffer as is used in the printf support routines. +// +// (This value actually allows 40 additional decimal places; even though there +// are only 16 digits of accuracy in a double precision IEEE number, the user may +// ask for more to effect zero padding.) +#define _CVTBUFSIZE (309 + 40) // # of digits in max. dp value + slop + +_Success_(return == 0) +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _ecvt_s( + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ double _Value, + _In_ int _DigitCount, + _Out_ int* _PtDec, + _Out_ int* _PtSign + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4( + errno_t, _ecvt_s, + char, _Buffer, + _In_ double, _Value, + _In_ int, _DigitCount, + _Out_ int*, _PtDec, + _Out_ int*, _PtSign + ) + +_Check_return_ _CRT_INSECURE_DEPRECATE(_ecvt_s) +_ACRTIMP char* __cdecl _ecvt( + _In_ double _Value, + _In_ int _DigitCount, + _Out_ int* _PtDec, + _Out_ int* _PtSign + ); + +_Success_(return == 0) +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _fcvt_s( + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ double _Value, + _In_ int _FractionalDigitCount, + _Out_ int* _PtDec, + _Out_ int* _PtSign + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4( + _Success_(return == 0) + errno_t, _fcvt_s, + char, _Buffer, + _In_ double, _Value, + _In_ int, _FractionalDigitCount, + _Out_ int*, _PtDec, + _Out_ int*, _PtSign + ) + +_Success_(return == 0) +_Check_return_ _CRT_INSECURE_DEPRECATE(_fcvt_s) +_ACRTIMP char* __cdecl _fcvt( + _In_ double _Value, + _In_ int _FractionalDigitCount, + _Out_ int* _PtDec, + _Out_ int* _PtSign + ); + +_Success_(return == 0) +_ACRTIMP errno_t __cdecl _gcvt_s( + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_ double _Value, + _In_ int _DigitCount + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2( + _Success_(return == 0) + errno_t, _gcvt_s, + char, _Buffer, + _In_ double, _Value, + _In_ int, _DigitCount + ) + +_CRT_INSECURE_DEPRECATE(_gcvt_s) +_ACRTIMP char* __cdecl _gcvt( + _In_ double _Value, + _In_ int _DigitCount, + _Pre_notnull_ _Post_z_ char* _Buffer + ); + + + +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// +// Multibyte String Operations and Conversions +// +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// Maximum number of bytes in multi-byte character in the current locale +// (also defined in ctype.h). +#ifndef MB_CUR_MAX + #if defined _CRT_DISABLE_PERFCRIT_LOCKS && !defined _DLL + #define MB_CUR_MAX __mb_cur_max + #else + #define MB_CUR_MAX ___mb_cur_max_func() + #endif + + #ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY + extern int __mb_cur_max; + #else + #define __mb_cur_max (___mb_cur_max_func()) + #endif + + _Post_satisfies_(return > 0 && return < MB_LEN_MAX) + _ACRTIMP int __cdecl ___mb_cur_max_func(void); + + _Post_satisfies_(return > 0 && return < MB_LEN_MAX) + _ACRTIMP int __cdecl ___mb_cur_max_l_func(_locale_t _Locale); +#endif + + + +_Check_return_ +_ACRTIMP int __cdecl mblen( + _In_reads_bytes_opt_(_MaxCount) _Pre_opt_z_ char const* _Ch, + _In_ size_t _MaxCount + ); + +_Check_return_ +_ACRTIMP int __cdecl _mblen_l( + _In_reads_bytes_opt_(_MaxCount) _Pre_opt_z_ char const* _Ch, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_Post_satisfies_(return <= _String_length_(_String)) +_ACRTIMP size_t __cdecl _mbstrlen( + _In_z_ char const* _String + ); + +_Check_return_ +_Post_satisfies_(return <= _String_length_(_String) || return == (size_t)-1) +_ACRTIMP size_t __cdecl _mbstrlen_l( + _In_z_ char const* _String, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_Post_satisfies_((return <= _String_length_(_String) && return <= _MaxCount) || return == (size_t)-1) +_ACRTIMP size_t __cdecl _mbstrnlen( + _In_z_ char const* _String, + _In_ size_t _MaxCount + ); + +_Post_satisfies_((return <= _String_length_(_String) && return <= _MaxCount) || return == (size_t)-1) +_Check_return_ +_ACRTIMP size_t __cdecl _mbstrnlen_l( + _In_z_ char const* _String, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale + ); + +_Success_(return != -1) +_ACRTIMP int __cdecl mbtowc( + _Pre_notnull_ _Post_z_ wchar_t* _DstCh, + _In_reads_or_z_opt_(_SrcSizeInBytes) char const* _SrcCh, + _In_ size_t _SrcSizeInBytes + ); + +_Success_(return != -1) +_ACRTIMP int __cdecl _mbtowc_l( + _Pre_notnull_ _Post_z_ wchar_t* _DstCh, + _In_reads_or_z_opt_(_SrcSizeInBytes) char const* _SrcCh, + _In_ size_t _SrcSizeInBytes, + _In_opt_ _locale_t _Locale + ); + +_Check_return_opt_ +_ACRTIMP errno_t __cdecl mbstowcs_s( + _Out_opt_ size_t* _PtNumOfCharConverted, + _Out_writes_to_opt_(_SizeInWords, *_PtNumOfCharConverted) wchar_t* _DstBuf, + _In_ size_t _SizeInWords, + _In_reads_or_z_(_MaxCount) char const* _SrcBuf, + _In_ size_t _MaxCount + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_2( + errno_t, mbstowcs_s, + _Out_opt_ size_t*, _PtNumOfCharConverted, + _Post_z_ wchar_t, _Dest, + _In_z_ char const*, _Source, + _In_ size_t, _MaxCount + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_SIZE( + _ACRTIMP, mbstowcs, + _Out_writes_opt_z_(_MaxCount), wchar_t, _Dest, + _In_z_ char const*, _Source, + _In_ size_t, _MaxCount + ) + +_Check_return_opt_ +_ACRTIMP errno_t __cdecl _mbstowcs_s_l( + _Out_opt_ size_t* _PtNumOfCharConverted, + _Out_writes_to_opt_(_SizeInWords, *_PtNumOfCharConverted) wchar_t* _DstBuf, + _In_ size_t _SizeInWords, + _In_reads_or_z_(_MaxCount) char const* _SrcBuf, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3( + errno_t, _mbstowcs_s_l, + _Out_opt_ size_t*, _PtNumOfCharConverted, + _Post_z_ wchar_t, _Dest, + _In_z_ char const*, _Source, + _In_ size_t, _MaxCount, + _In_opt_ _locale_t, _Locale + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_3_SIZE_EX( + _ACRTIMP, _mbstowcs_l, _mbstowcs_s_l, + _Out_writes_opt_z_(_Size) wchar_t, + _Out_writes_z_(_MaxCount), wchar_t, _Dest, + _In_z_ char const*, _Source, + _In_ size_t, _MaxCount, + _In_opt_ _locale_t, _Locale + ) + + + + +_CRT_INSECURE_DEPRECATE(wctomb_s) +_ACRTIMP int __cdecl wctomb( + _Out_writes_opt_z_(MB_LEN_MAX) char* _MbCh, + _In_ wchar_t _WCh + ); + +_CRT_INSECURE_DEPRECATE(_wctomb_s_l) +_ACRTIMP int __cdecl _wctomb_l( + _Pre_maybenull_ _Post_z_ char* _MbCh, + _In_ wchar_t _WCh, + _In_opt_ _locale_t _Locale + ); + +#if __STDC_WANT_SECURE_LIB__ + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl wctomb_s( + _Out_opt_ int* _SizeConverted, + _Out_writes_bytes_to_opt_(_SizeInBytes, *_SizeConverted) char* _MbCh, + _In_ rsize_t _SizeInBytes, + _In_ wchar_t _WCh + ); + +#endif // __STDC_WANT_SECURE_LIB__ + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _wctomb_s_l( + _Out_opt_ int* _SizeConverted, + _Out_writes_opt_z_(_SizeInBytes) char* _MbCh, + _In_ size_t _SizeInBytes, + _In_ wchar_t _WCh, + _In_opt_ _locale_t _Locale); + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl wcstombs_s( + _Out_opt_ size_t* _PtNumOfCharConverted, + _Out_writes_bytes_to_opt_(_DstSizeInBytes, *_PtNumOfCharConverted) char* _Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ wchar_t const* _Src, + _In_ size_t _MaxCountInBytes + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_2( + errno_t, wcstombs_s, + _Out_opt_ size_t*, _PtNumOfCharConverted, + _Out_writes_bytes_opt_(_Size) char, _Dest, + _In_z_ wchar_t const*, _Source, + _In_ size_t, _MaxCount + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_SIZE( + _ACRTIMP, wcstombs, + _Out_writes_opt_(_MaxCount), char, _Dest, + _In_z_ wchar_t const*, _Source, + _In_ size_t, _MaxCount + ) + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _wcstombs_s_l( + _Out_opt_ size_t* _PtNumOfCharConverted, + _Out_writes_bytes_to_opt_(_DstSizeInBytes, *_PtNumOfCharConverted) char* _Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ wchar_t const* _Src, + _In_ size_t _MaxCountInBytes, + _In_opt_ _locale_t _Locale + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3( + errno_t, _wcstombs_s_l, + _Out_opt_ size_t*, _PtNumOfCharConverted, + _Out_writes_opt_(_Size) char, _Dest, + _In_z_ wchar_t const*, _Source, + _In_ size_t, _MaxCount, + _In_opt_ _locale_t, _Locale + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_3_SIZE_EX( + _ACRTIMP, _wcstombs_l, _wcstombs_s_l, + _Out_writes_opt_z_(_Size) char, + _Out_writes_(_MaxCount), char, _Dest, + _In_z_ wchar_t const*, _Source, + _In_ size_t, _MaxCount, + _In_opt_ _locale_t, _Locale + ) + + + +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// +// Path Manipulation +// +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// Sizes for buffers used by the _makepath() and _splitpath() functions. +// note that the sizes include space for 0-terminator +#define _MAX_PATH 260 // max. length of full pathname +#define _MAX_DRIVE 3 // max. length of drive component +#define _MAX_DIR 256 // max. length of path component +#define _MAX_FNAME 256 // max. length of file name component +#define _MAX_EXT 256 // max. length of extension component + + +#pragma push_macro("_fullpath") +#undef _fullpath + +_Success_(return != 0) +_Check_return_ +_ACRTIMP _CRTALLOCATOR char* __cdecl _fullpath( + _Out_writes_opt_z_(_BufferCount) char* _Buffer, + _In_z_ char const* _Path, + _In_ size_t _BufferCount + ); + +#pragma pop_macro("_fullpath") + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _makepath_s( + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount, + _In_opt_z_ char const* _Drive, + _In_opt_z_ char const* _Dir, + _In_opt_z_ char const* _Filename, + _In_opt_z_ char const* _Ext + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4( + errno_t, _makepath_s, + char, _Buffer, + _In_opt_z_ char const*, _Drive, + _In_opt_z_ char const*, _Dir, + _In_opt_z_ char const*, _Filename, + _In_opt_z_ char const*, _Ext + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_4( + void, __RETURN_POLICY_VOID, _ACRTIMP, _makepath, + _Pre_notnull_ _Post_z_, char, _Buffer, + _In_opt_z_ char const*, _Drive, + _In_opt_z_ char const*, _Dir, + _In_opt_z_ char const*, _Filename, + _In_opt_z_ char const*, _Ext + ) + +_CRT_INSECURE_DEPRECATE(_splitpath_s) +_ACRTIMP void __cdecl _splitpath( + _In_z_ char const* _FullPath, + _Pre_maybenull_ _Post_z_ char* _Drive, + _Pre_maybenull_ _Post_z_ char* _Dir, + _Pre_maybenull_ _Post_z_ char* _Filename, + _Pre_maybenull_ _Post_z_ char* _Ext + ); + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _splitpath_s( + _In_z_ char const* _FullPath, + _Out_writes_opt_z_(_DriveCount) char* _Drive, + _In_ size_t _DriveCount, + _Out_writes_opt_z_(_DirCount) char* _Dir, + _In_ size_t _DirCount, + _Out_writes_opt_z_(_FilenameCount) char* _Filename, + _In_ size_t _FilenameCount, + _Out_writes_opt_z_(_ExtCount) char* _Ext, + _In_ size_t _ExtCount + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_SPLITPATH(errno_t, _splitpath_s, char, _Dest) + +#if __STDC_WANT_SECURE_LIB__ + +_Check_return_opt_ +_Success_(return == 0) +_DCRTIMP errno_t __cdecl getenv_s( + _Out_ size_t* _RequiredCount, + _Out_writes_opt_z_(_BufferCount) char* _Buffer, + _In_ rsize_t _BufferCount, + _In_z_ char const* _VarName + ); + +#endif // __STDC_WANT_SECURE_LIB__ + + + + +_ACRTIMP int* __cdecl __p___argc (void); +_ACRTIMP char*** __cdecl __p___argv (void); +_ACRTIMP wchar_t*** __cdecl __p___wargv(void); + +#ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY + extern int __argc; + extern char** __argv; + extern wchar_t** __wargv; +#else + #define __argc (*__p___argc()) // Pointer to number of command line arguments + #define __argv (*__p___argv()) // Pointer to table of narrow command line arguments + #define __wargv (*__p___wargv()) // Pointer to table of wide command line arguments +#endif + +_DCRTIMP char*** __cdecl __p__environ (void); +_DCRTIMP wchar_t*** __cdecl __p__wenviron(void); + +#ifndef _CRT_BEST_PRACTICES_USAGE + #define _CRT_V12_LEGACY_FUNCTIONALITY +#endif + +#ifndef _CRT_V12_LEGACY_FUNCTIONALITY + // Deprecated symbol: Do not expose environment global pointers unless + // legacy access is specifically requested + #define _environ crt_usage_error__do_not_reference_global_pointer_directly__environ + #define _wenviron crt_usage_error__do_not_reference_global_pointer_directly__wenviron +#else + #define _environ (*__p__environ()) // Pointer to narrow environment table + #define _wenviron (*__p__wenviron()) // Pointer to wide environment table +#endif + + + +// Sizes for buffers used by the getenv/putenv family of functions. +#define _MAX_ENV 32767 + + +#if _CRT_FUNCTIONS_REQUIRED + + _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) + _DCRTIMP char* __cdecl getenv( + _In_z_ char const* _VarName + ); + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1( + errno_t, getenv_s, + _Out_ size_t*, _RequiredCount, + char, _Buffer, + _In_z_ char const*, _VarName + ) + + #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) + #pragma push_macro("_dupenv_s") + #undef _dupenv_s + #endif + + _Check_return_opt_ + _DCRTIMP errno_t __cdecl _dupenv_s( + _Outptr_result_buffer_maybenull_(*_BufferCount) _Outptr_result_maybenull_z_ char** _Buffer, + _Out_opt_ size_t* _BufferCount, + _In_z_ char const* _VarName + ); + + #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) + #pragma pop_macro("_dupenv_s") + #endif + + _DCRTIMP int __cdecl system( + _In_opt_z_ char const* _Command + ); + + // The functions below have declspecs in their declarations in the Windows + // headers, causing PREfast to fire 6540 here + #pragma warning(push) + #pragma warning(disable: 6540) + + _Check_return_ + _DCRTIMP int __cdecl _putenv( + _In_z_ char const* _EnvString + ); + + _Check_return_wat_ + _DCRTIMP errno_t __cdecl _putenv_s( + _In_z_ char const* _Name, + _In_z_ char const* _Value + ); + + #pragma warning(pop) + + _DCRTIMP errno_t __cdecl _searchenv_s( + _In_z_ char const* _Filename, + _In_z_ char const* _VarName, + _Out_writes_z_(_BufferCount) char* _Buffer, + _In_ size_t _BufferCount + ); + + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_2_0( + errno_t, _searchenv_s, + _In_z_ char const*, _Filename, + _In_z_ char const*, _VarName, + char, _Buffer + ) + + __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_2_0( + void, __RETURN_POLICY_VOID, _DCRTIMP, _searchenv, + _In_z_ char const*, _Filename, + _In_z_ char const*, _VarName, + _Pre_notnull_ _Post_z_, char, _Buffer + ) + + // The Win32 API SetErrorMode, Beep and Sleep should be used instead. + _CRT_OBSOLETE(SetErrorMode) + _DCRTIMP void __cdecl _seterrormode( + _In_ int _Mode + ); + + _CRT_OBSOLETE(Beep) + _DCRTIMP void __cdecl _beep( + _In_ unsigned _Frequency, + _In_ unsigned _Duration + ); + + _CRT_OBSOLETE(Sleep) + _DCRTIMP void __cdecl _sleep( + _In_ unsigned long _Duration + ); + +#endif // _CRT_FUNCTIONS_REQUIRED + + +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +// +// Non-ANSI Names for Compatibility +// +//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES + + #ifndef __cplusplus + #define max(a,b) (((a) > (b)) ? (a) : (b)) + #define min(a,b) (((a) < (b)) ? (a) : (b)) + #endif + + #define sys_errlist _sys_errlist + #define sys_nerr _sys_nerr + + #pragma warning(push) + #pragma warning(disable: 4141) // Using deprecated twice + + _Check_return_ _CRT_NONSTDC_DEPRECATE(_ecvt) _CRT_INSECURE_DEPRECATE(_ecvt_s) + _ACRTIMP char* __cdecl ecvt( + _In_ double _Value, + _In_ int _DigitCount, + _Out_ int* _PtDec, + _Out_ int* _PtSign + ); + + _Check_return_ _CRT_NONSTDC_DEPRECATE(_fcvt) _CRT_INSECURE_DEPRECATE(_fcvt_s) + _ACRTIMP char* __cdecl fcvt( + _In_ double _Value, + _In_ int _FractionalDigitCount, + _Out_ int* _PtDec, + _Out_ int* _PtSign + ); + + _CRT_NONSTDC_DEPRECATE(_gcvt) _CRT_INSECURE_DEPRECATE(_fcvt_s) + _ACRTIMP char* __cdecl gcvt( + _In_ double _Value, + _In_ int _DigitCount, + _Pre_notnull_ _Post_z_ char* _DstBuf + ); + + _CRT_NONSTDC_DEPRECATE(_itoa) _CRT_INSECURE_DEPRECATE(_itoa_s) + _ACRTIMP char* __cdecl itoa( + _In_ int _Value, + _Pre_notnull_ _Post_z_ char* _Buffer, + _In_ int _Radix + ); + + _CRT_NONSTDC_DEPRECATE(_ltoa) _CRT_INSECURE_DEPRECATE(_ltoa_s) + _ACRTIMP char* __cdecl ltoa( + _In_ long _Value, + _Pre_notnull_ _Post_z_ char* _Buffer, + _In_ int _Radix + ); + + + _CRT_NONSTDC_DEPRECATE(_swab) + _ACRTIMP void __cdecl swab( + _Inout_updates_z_(_SizeInBytes) char* _Buf1, + _Inout_updates_z_(_SizeInBytes) char* _Buf2, + _In_ int _SizeInBytes + ); + + _CRT_NONSTDC_DEPRECATE(_ultoa) _CRT_INSECURE_DEPRECATE(_ultoa_s) + _ACRTIMP char* __cdecl ultoa( + _In_ unsigned long _Value, + _Pre_notnull_ _Post_z_ char* _Buffer, + _In_ int _Radix + ); + + #define environ _environ + + _Check_return_ _CRT_NONSTDC_DEPRECATE(_putenv) + _DCRTIMP int __cdecl putenv( + _In_z_ char const* _EnvString + ); + + #pragma warning(pop) + + onexit_t __cdecl onexit(_In_opt_ onexit_t _Func); + +#endif // _CRT_INTERNAL_NONSTDC_NAMES + + + +_CRT_END_C_HEADER +_UCRT_RESTORE_CLANG_WARNINGS +#pragma warning(pop) // _UCRT_DISABLED_WARNINGS +#endif // _INC_STDLIB diff --git a/string.h b/string.h new file mode 100644 index 0000000..37406d4 --- /dev/null +++ b/string.h @@ -0,0 +1,592 @@ +// +// string.h +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// The C Standard Library header. +// +#pragma once +#ifndef _INC_STRING // include guard for 3rd party interop +#define _INC_STRING + +#include +#include +#include +#include + +#ifndef __midl + +#pragma warning(push) +#pragma warning(disable: _UCRT_DISABLED_WARNINGS) +_UCRT_DISABLE_CLANG_WARNINGS + +_CRT_BEGIN_C_HEADER + + + +#define _NLSCMPERROR _CRT_INT_MAX // currently == INT_MAX + +#if __STDC_WANT_SECURE_LIB__ + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl strcpy_s( + _Out_writes_z_(_SizeInBytes) char* _Destination, + _In_ rsize_t _SizeInBytes, + _In_z_ char const* _Source + ); + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl strcat_s( + _Inout_updates_z_(_SizeInBytes) char* _Destination, + _In_ rsize_t _SizeInBytes, + _In_z_ char const* _Source + ); + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl strerror_s( + _Out_writes_z_(_SizeInBytes) char* _Buffer, + _In_ size_t _SizeInBytes, + _In_ int _ErrorNumber); + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl strncat_s( + _Inout_updates_z_(_SizeInBytes) char* _Destination, + _In_ rsize_t _SizeInBytes, + _In_reads_or_z_(_MaxCount) char const* _Source, + _In_ rsize_t _MaxCount + ); + + _Check_return_wat_ + _ACRTIMP errno_t __cdecl strncpy_s( + _Out_writes_z_(_SizeInBytes) char* _Destination, + _In_ rsize_t _SizeInBytes, + _In_reads_or_z_(_MaxCount) char const* _Source, + _In_ rsize_t _MaxCount + ); + + _Check_return_ + _ACRTIMP char* __cdecl strtok_s( + _Inout_opt_z_ char* _String, + _In_z_ char const* _Delimiter, + _Inout_ _Deref_prepost_opt_z_ char** _Context + ); + +#endif // __STDC_WANT_SECURE_LIB__ + +_ACRTIMP void* __cdecl _memccpy( + _Out_writes_bytes_opt_(_MaxCount) void* _Dst, + _In_ void const* _Src, + _In_ int _Val, + _In_ size_t _MaxCount + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1( + errno_t, strcat_s, + char, _Destination, + _In_z_ char const*, _Source + ) + +#ifndef RC_INVOKED + + __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1( + char*, __RETURN_POLICY_DST, __EMPTY_DECLSPEC, strcat, + _Inout_updates_z_(_String_length_(_Destination) + _String_length_(_Source) + 1), char, _Destination, + _In_z_ char const*, _Source + ) + +#endif // RC_INVOKED + +_Check_return_ +int __cdecl strcmp( + _In_z_ char const* _Str1, + _In_z_ char const* _Str2 + ); + +_Check_return_ +_ACRTIMP int __cdecl _strcmpi( + _In_z_ char const* _String1, + _In_z_ char const* _String2 + ); + +_Check_return_ +_ACRTIMP int __cdecl strcoll( + _In_z_ char const* _String1, + _In_z_ char const* _String2 + ); + +_Check_return_ +_ACRTIMP int __cdecl _strcoll_l( + _In_z_ char const* _String1, + _In_z_ char const* _String2, + _In_opt_ _locale_t _Locale + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1( + errno_t, strcpy_s, + _Post_z_ char, _Destination, + _In_z_ char const*, _Source + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1( + char*, __RETURN_POLICY_DST, __EMPTY_DECLSPEC, strcpy, + _Out_writes_z_(_String_length_(_Source) + 1), char, _Destination, + _In_z_ char const*, _Source + ) + +_Check_return_ +_ACRTIMP size_t __cdecl strcspn( + _In_z_ char const* _Str, + _In_z_ char const* _Control + ); + +#if defined _DEBUG && defined _CRTDBG_MAP_ALLOC + #pragma push_macro("_strdup") + #undef _strdup +#endif + +_Check_return_ +_ACRTIMP _CRTALLOCATOR char* __cdecl _strdup( + _In_opt_z_ char const* _Source + ); + +#if defined _DEBUG && defined _CRTDBG_MAP_ALLOC + #pragma pop_macro("_strdup") +#endif + +_Ret_z_ +_Success_(return != 0) +_Check_return_ _CRT_INSECURE_DEPRECATE(_strerror_s) +_ACRTIMP char* __cdecl _strerror( + _In_opt_z_ char const* _ErrorMessage + ); + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _strerror_s( + _Out_writes_z_(_SizeInBytes) char* _Buffer, + _In_ size_t _SizeInBytes, + _In_opt_z_ char const* _ErrorMessage + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1( + errno_t, _strerror_s, + char, _Buffer, + _In_opt_z_ char const*, _ErrorMessage + ) + +_Ret_z_ +_Check_return_ _CRT_INSECURE_DEPRECATE(strerror_s) +_ACRTIMP char* __cdecl strerror( + _In_ int _ErrorMessage + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1( + errno_t, strerror_s, + char, _Buffer, + _In_ int, _ErrorMessage + ) + +_Check_return_ +_ACRTIMP int __cdecl _stricmp( + _In_z_ char const* _String1, + _In_z_ char const* _String2 + ); + +_Check_return_ +_ACRTIMP int __cdecl _stricoll( + _In_z_ char const* _String1, + _In_z_ char const* _String2 + ); + +_Check_return_ +_ACRTIMP int __cdecl _stricoll_l( + _In_z_ char const* _String1, + _In_z_ char const* _String2, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP int __cdecl _stricmp_l( + _In_z_ char const* _String1, + _In_z_ char const* _String2, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +size_t __cdecl strlen( + _In_z_ char const* _Str + ); + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _strlwr_s( + _Inout_updates_z_(_Size) char* _String, + _In_ size_t _Size + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0( + errno_t, _strlwr_s, + _Prepost_z_ char, _String + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0( + char*, __RETURN_POLICY_DST, _ACRTIMP, _strlwr, + _Inout_z_, char, _String + ) + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _strlwr_s_l( + _Inout_updates_z_(_Size) char* _String, + _In_ size_t _Size, + _In_opt_ _locale_t _Locale + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1( + errno_t, _strlwr_s_l, + _Prepost_z_ char, _String, + _In_opt_ _locale_t, _Locale + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX( + char*, __RETURN_POLICY_DST, _ACRTIMP, _strlwr_l, _strlwr_s_l, + _Inout_updates_z_(_Size) char, + _Inout_z_, char, _String, + _In_opt_ _locale_t, _Locale + ) + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2( + errno_t, strncat_s, + _Prepost_z_ char, _Destination, + _In_reads_or_z_(_Count) char const*, _Source, + _In_ size_t, _Count + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_EX( + char*, __RETURN_POLICY_DST, _ACRTIMP, strncat, strncat_s, + _Inout_updates_z_(_Size) char, + _Inout_updates_z_(_Count), char, _Destination, + _In_reads_or_z_(_Count) char const*, _Source, + _In_ size_t, _Count + ) + +_Check_return_ +_ACRTIMP int __cdecl strncmp( + _In_reads_or_z_(_MaxCount) char const* _Str1, + _In_reads_or_z_(_MaxCount) char const* _Str2, + _In_ size_t _MaxCount + ); + +_Check_return_ +_ACRTIMP int __cdecl _strnicmp( + _In_reads_or_z_(_MaxCount) char const* _String1, + _In_reads_or_z_(_MaxCount) char const* _String2, + _In_ size_t _MaxCount + ); + +_Check_return_ +_ACRTIMP int __cdecl _strnicmp_l( + _In_reads_or_z_(_MaxCount) char const* _String1, + _In_reads_or_z_(_MaxCount) char const* _String2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP int __cdecl _strnicoll( + _In_reads_or_z_(_MaxCount) char const* _String1, + _In_reads_or_z_(_MaxCount) char const* _String2, + _In_ size_t _MaxCount + ); + +_Check_return_ +_ACRTIMP int __cdecl _strnicoll_l( + _In_reads_or_z_(_MaxCount) char const* _String1, + _In_reads_or_z_(_MaxCount) char const* _String2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale + ); + +_Check_return_ +_ACRTIMP int __cdecl _strncoll( + _In_reads_or_z_(_MaxCount) char const* _String1, + _In_reads_or_z_(_MaxCount) char const* _String2, + _In_ size_t _MaxCount + ); + +_Check_return_ +_ACRTIMP int __cdecl _strncoll_l( + _In_reads_or_z_(_MaxCount) char const* _String1, + _In_reads_or_z_(_MaxCount) char const* _String2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale + ); + +_ACRTIMP size_t __cdecl __strncnt( + _In_reads_or_z_(_Count) char const* _String, + _In_ size_t _Count + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2( + errno_t, strncpy_s, + char, _Destination, + _In_reads_or_z_(_Count) char const*, _Source, + _In_ size_t, _Count + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_EX( + char*, __RETURN_POLICY_DST, _ACRTIMP, strncpy, strncpy_s, + _Out_writes_z_(_Size) char, + _Out_writes_(_Count) _Post_maybez_, char, _Destination, + _In_reads_or_z_(_Count) char const*, _Source, + _In_ size_t, _Count + ) + +_Check_return_ +_When_( + _MaxCount > _String_length_(_String), + _Post_satisfies_(return == _String_length_(_String)) +) +_When_( + _MaxCount <= _String_length_(_String), + _Post_satisfies_(return == _MaxCount) +) +_ACRTIMP size_t __cdecl strnlen( + _In_reads_or_z_(_MaxCount) char const* _String, + _In_ size_t _MaxCount + ); + +#if __STDC_WANT_SECURE_LIB__ && !defined __midl + + _Check_return_ + _When_( + _MaxCount > _String_length_(_String), + _Post_satisfies_(return == _String_length_(_String)) + ) + _When_( + _MaxCount <= _String_length_(_String), + _Post_satisfies_(return == _MaxCount) + ) + static __inline size_t __CRTDECL strnlen_s( + _In_reads_or_z_(_MaxCount) char const* _String, + _In_ size_t _MaxCount + ) + { + return _String == 0 ? 0 : strnlen(_String, _MaxCount); + } + +#endif + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _strnset_s( + _Inout_updates_z_(_SizeInBytes) char* _String, + _In_ size_t _SizeInBytes, + _In_ int _Value, + _In_ size_t _MaxCount + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2( + errno_t, _strnset_s, + _Prepost_z_ char, _Destination, + _In_ int, _Value, + _In_ size_t, _Count + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_EX( + char*, __RETURN_POLICY_DST, _ACRTIMP, _strnset, _strnset_s, + _Inout_updates_z_(_Size) char, + _Inout_updates_z_(_Count), char, _Destination, + _In_ int, _Value, + _In_ size_t, _Count + ) + +_Check_return_ +_ACRTIMP char _CONST_RETURN* __cdecl strpbrk( + _In_z_ char const* _Str, + _In_z_ char const* _Control + ); + +_ACRTIMP char* __cdecl _strrev( + _Inout_z_ char* _Str + ); + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _strset_s( + _Inout_updates_z_(_DestinationSize) char* _Destination, + _In_ size_t _DestinationSize, + _In_ int _Value + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1( + errno_t, _strset_s, + _Prepost_z_ char, _Destination, + _In_ int, _Value + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1( + char*, __RETURN_POLICY_DST, __EMPTY_DECLSPEC, _strset, + _Inout_z_, char, _Destination, + _In_ int, _Value + ) + +_Check_return_ +_ACRTIMP size_t __cdecl strspn( + _In_z_ char const* _Str, + _In_z_ char const* _Control + ); + +_Check_return_ _CRT_INSECURE_DEPRECATE(strtok_s) +_ACRTIMP char* __cdecl strtok( + _Inout_opt_z_ char* _String, + _In_z_ char const* _Delimiter + ); + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _strupr_s( + _Inout_updates_z_(_Size) char* _String, + _In_ size_t _Size + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0( + errno_t, _strupr_s, + _Prepost_z_ char, _String + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0( + char*, __RETURN_POLICY_DST, _ACRTIMP, _strupr, + _Inout_z_, char, _String + ) + +_Check_return_wat_ +_ACRTIMP errno_t __cdecl _strupr_s_l( + _Inout_updates_z_(_Size) char* _String, + _In_ size_t _Size, + _In_opt_ _locale_t _Locale + ); + +__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1( + errno_t, _strupr_s_l, + _Prepost_z_ char, _String, + _In_opt_ _locale_t, _Locale + ) + +__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX( + char*, __RETURN_POLICY_DST, _ACRTIMP, _strupr_l, _strupr_s_l, + _Inout_updates_z_(_Size) char, + _Inout_z_, char, _String, + _In_opt_ _locale_t, _Locale + ) + +_Success_(return < _MaxCount) +_Check_return_opt_ +_ACRTIMP size_t __cdecl strxfrm( + _Out_writes_opt_(_MaxCount) _Post_maybez_ char* _Destination, + _In_z_ char const* _Source, + _In_ _In_range_(<=,_CRT_INT_MAX) size_t _MaxCount + ); + +_Success_(return < _MaxCount) +_Check_return_opt_ +_ACRTIMP size_t __cdecl _strxfrm_l( + _Out_writes_opt_(_MaxCount) _Post_maybez_ char* _Destination, + _In_z_ char const* _Source, + _In_ _In_range_(<=,_CRT_INT_MAX) size_t _MaxCount, + _In_opt_ _locale_t _Locale + ); + + + +#ifdef __cplusplus +extern "C++" +{ + _Check_return_ + inline char* __CRTDECL strchr(_In_z_ char* const _String, _In_ int const _Ch) + { + return const_cast(strchr(static_cast(_String), _Ch)); + } + + _Check_return_ + inline char* __CRTDECL strpbrk(_In_z_ char* const _String, _In_z_ char const* const _Control) + { + return const_cast(strpbrk(static_cast(_String), _Control)); + } + + _Check_return_ + inline char* __CRTDECL strrchr(_In_z_ char* const _String, _In_ int const _Ch) + { + return const_cast(strrchr(static_cast(_String), _Ch)); + } + + _Check_return_ _Ret_maybenull_ + inline char* __CRTDECL strstr(_In_z_ char* const _String, _In_z_ char const* const _SubString) + { + return const_cast(strstr(static_cast(_String), _SubString)); + } +} +#endif // __cplusplus + + + +#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES + + #pragma push_macro("strdup") + #undef strdup + _Check_return_ _CRT_NONSTDC_DEPRECATE(_strdup) + _ACRTIMP char* __cdecl strdup( + _In_opt_z_ char const* _String + ); + #pragma pop_macro("strdup") + + // Declarations of functions defined in oldnames.lib: + _Check_return_ _CRT_NONSTDC_DEPRECATE(_strcmpi) + _ACRTIMP int __cdecl strcmpi( + _In_z_ char const* _String1, + _In_z_ char const* _String2 + ); + + _Check_return_ _CRT_NONSTDC_DEPRECATE(_stricmp) + _ACRTIMP int __cdecl stricmp( + _In_z_ char const* _String1, + _In_z_ char const* _String2 + ); + + _CRT_NONSTDC_DEPRECATE(_strlwr) + _ACRTIMP char* __cdecl strlwr( + _Inout_z_ char* _String + ); + + _Check_return_ _CRT_NONSTDC_DEPRECATE(_strnicmp) + _ACRTIMP int __cdecl strnicmp( + _In_reads_or_z_(_MaxCount) char const* _String1, + _In_reads_or_z_(_MaxCount) char const* _String2, + _In_ size_t _MaxCount + ); + + _CRT_NONSTDC_DEPRECATE(_strnset) + _ACRTIMP char* __cdecl strnset( + _Inout_updates_z_(_MaxCount) char* _String, + _In_ int _Value, + _In_ size_t _MaxCount + ); + + _CRT_NONSTDC_DEPRECATE(_strrev) + _ACRTIMP char* __cdecl strrev( + _Inout_z_ char* _String + ); + + _CRT_NONSTDC_DEPRECATE(_strset) + char* __cdecl strset( + _Inout_z_ char* _String, + _In_ int _Value); + + _CRT_NONSTDC_DEPRECATE(_strupr) + _ACRTIMP char* __cdecl strupr( + _Inout_z_ char* _String + ); + +#endif // _CRT_INTERNAL_NONSTDC_NAMES + + + +_CRT_END_C_HEADER +_UCRT_RESTORE_CLANG_WARNINGS +#pragma warning(pop) // _UCRT_DISABLED_WARNINGS +#endif // !__midl +#endif // _INC_STRING