ReactOS 0.4.16-dev-736-g28b802b
stdlib.h
Go to the documentation of this file.
1//
2// stdlib.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The C Standard Library <stdlib.h> header.
7//
8#pragma once
9#ifndef _INC_STDLIB // include guard for 3rd party interop
10#define _INC_STDLIB
11
12#include <corecrt.h>
13#include <corecrt_malloc.h>
14#include <corecrt_search.h>
15#include <corecrt_wstdlib.h>
16#include <limits.h>
17
18#pragma warning(push)
19#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
21
23
24
25
26#ifndef _countof
27 #define _countof __crt_countof
28#endif
29
30
31
32// Minimum and maximum macros
33#define __max(a,b) (((a) > (b)) ? (a) : (b))
34#define __min(a,b) (((a) < (b)) ? (a) : (b))
35
36
37
42 );
43
44
45
46//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47//
48// Exit and Abort
49//
50//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
51// Argument values for exit()
52#define EXIT_SUCCESS 0
53#define EXIT_FAILURE 1
54
55#if _CRT_FUNCTIONS_REQUIRED
56 _ACRTIMP __declspec(noreturn) void __cdecl exit(_In_ int _Code);
57 _ACRTIMP __declspec(noreturn) void __cdecl _exit(_In_ int _Code);
58 _ACRTIMP __declspec(noreturn) void __cdecl _Exit(_In_ int _Code);
59 _ACRTIMP __declspec(noreturn) void __cdecl quick_exit(_In_ int _Code);
60 _ACRTIMP __declspec(noreturn) void __cdecl abort(void);
61#endif // _CRT_FUNCTIONS_REQUIRED
62
63// Argument values for _set_abort_behavior().
64#define _WRITE_ABORT_MSG 0x1 // debug only, has no effect in release
65#define _CALL_REPORTFAULT 0x2
66
68 _In_ unsigned int _Flags,
69 _In_ unsigned int _Mask
70 );
71
72
73
74#ifndef _CRT_ONEXIT_T_DEFINED
75 #define _CRT_ONEXIT_T_DEFINED
76
78 #ifdef _M_CEE
79 typedef int (__clrcall* _onexit_m_t)(void);
80 #endif
81#endif
82
83#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
84 // Non-ANSI name for compatibility
85 #define onexit_t _onexit_t
86#endif
87
88
89
90#ifdef _M_CEE
91 #pragma warning (push)
92 #pragma warning (disable: 4985) // Attributes not present on previous declaration
93
94 _Check_return_ int __clrcall _atexit_m_appdomain(_In_opt_ void (__clrcall* _Function)(void));
95
96 _onexit_m_t __clrcall _onexit_m_appdomain(_onexit_m_t _Function);
97
98 #ifdef _M_CEE_MIXED
99 #ifdef __cplusplus
100 [System::Security::SecurityCritical]
101 #endif
102 _Check_return_ int __clrcall _atexit_m(_In_opt_ void (__clrcall* _Function)(void));
103
104 _onexit_m_t __clrcall _onexit_m(_onexit_m_t _Function);
105 #else
106 #ifdef __cplusplus
107 [System::Security::SecurityCritical]
108 #endif
109 _Check_return_ inline int __clrcall _atexit_m(_In_opt_ void (__clrcall* _Function)(void))
110 {
111 return _atexit_m_appdomain(_Function);
112 }
113
114 inline _onexit_m_t __clrcall _onexit_m(_onexit_t _Function)
115 {
116 return _onexit_m_appdomain(_Function);
117 }
118 #endif
119 #pragma warning (pop)
120#endif
121
122
123
124#ifdef _M_CEE_PURE
125 // In pure mode, atexit is the same as atexit_m_appdomain
126 extern "C++"
127 {
128
129 #ifdef __cplusplus
130 [System::Security::SecurityCritical]
131 #endif
132 inline int __clrcall atexit(void (__clrcall* _Function)(void))
133 {
134 return _atexit_m_appdomain(_Function);
135 }
136
137 inline _onexit_t __clrcall _onexit(_onexit_t _Function)
138 {
139 return _onexit_m_appdomain(_Function);
140 }
141
142 } // extern "C++"
143#else
144 int __cdecl atexit(void (__cdecl*)(void));
146#endif
147
148int __cdecl at_quick_exit(void (__cdecl*)(void));
149
150
151
152//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
153//
154// Global State (errno, global handlers, etc.)
155//
156//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
157#ifndef _M_CEE_PURE
158 // a purecall handler procedure. Never returns normally
160
161 // Invalid parameter handler function pointer type
163 wchar_t const*,
164 wchar_t const*,
165 wchar_t const*,
166 unsigned int,
168 );
169
170 // Establishes a purecall handler
173 );
174
176
177 // Establishes an invalid parameter handler
180 );
181
183
186 );
187
189#endif
190
191
192#if defined __cplusplus && defined _M_CEE_PURE
193extern "C++"
194{
195 typedef void (__clrcall* _purecall_handler)(void);
196 typedef _purecall_handler _purecall_handler_m;
197
200 );
201} // extern "C++"
202#endif
203
204
205
206// Argument values for _set_error_mode().
207#define _OUT_TO_DEFAULT 0
208#define _OUT_TO_STDERR 1
209#define _OUT_TO_MSGBOX 2
210#define _REPORT_ERRMODE 3
211
213
214
215
216#if _CRT_FUNCTIONS_REQUIRED
217 _ACRTIMP int* __cdecl _errno(void);
218 #define errno (*_errno())
219
222
223 _ACRTIMP unsigned long* __cdecl __doserrno(void);
224 #define _doserrno (*__doserrno())
225
228
229 // This is non-const for backwards compatibility; do not modify it.
231 #define _sys_errlist (__sys_errlist())
232
234 #define _sys_nerr (*__sys_nerr())
235
236 _ACRTIMP void __cdecl perror(_In_opt_z_ char const* _ErrMsg);
237#endif // _CRT_FUNCTIONS_REQUIRED
238
239
240
241// These point to the executable module name.
245
246#ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY
249 #ifndef _CORECRT_BUILD
251 #endif
252#else
253 #define _pgmptr (*__p__pgmptr ())
254 #define _wpgmptr (*__p__wpgmptr())
255 #define _fmode (*__p__fmode ())
256#endif
257
258_Success_(return == 0)
260
261_Success_(return == 0)
263
265
267
268
269
270//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
271//
272// Math
273//
274//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
275typedef struct _div_t
276{
277 int quot;
278 int rem;
280
281typedef struct _ldiv_t
282{
283 long quot;
284 long rem;
286
287typedef struct _lldiv_t
288{
289 long long quot;
290 long long rem;
292
293_Check_return_ int __cdecl abs (_In_ int _Number);
294_Check_return_ long __cdecl labs (_In_ long _Number);
295_Check_return_ long long __cdecl llabs (_In_ long long _Number);
297
298_Check_return_ unsigned short __cdecl _byteswap_ushort(_In_ unsigned short _Number);
299_Check_return_ unsigned long __cdecl _byteswap_ulong (_In_ unsigned long _Number);
301
302_Check_return_ _ACRTIMP div_t __cdecl div (_In_ int _Numerator, _In_ int _Denominator);
303_Check_return_ _ACRTIMP ldiv_t __cdecl ldiv (_In_ long _Numerator, _In_ long _Denominator);
304_Check_return_ _ACRTIMP lldiv_t __cdecl lldiv(_In_ long long _Numerator, _In_ long long _Denominator);
305
306// These functions have declspecs in their declarations in the Windows headers,
307// which cause PREfast to fire 6540.
308#pragma warning(push)
309#pragma warning(disable: 6540)
310
311unsigned int __cdecl _rotl(
312 _In_ unsigned int _Value,
313 _In_ int _Shift
314 );
315
317unsigned long __cdecl _lrotl(
318 _In_ unsigned long _Value,
319 _In_ int _Shift
320 );
321
323 _In_ unsigned __int64 _Value,
324 _In_ int _Shift
325 );
326
327unsigned int __cdecl _rotr(
328 _In_ unsigned int _Value,
329 _In_ int _Shift
330 );
331
333unsigned long __cdecl _lrotr(
334 _In_ unsigned long _Value,
335 _In_ int _Shift
336 );
337
339 _In_ unsigned __int64 _Value,
340 _In_ int _Shift
341 );
342
343#pragma warning(pop)
344
345
346
347// Maximum value that can be returned by the rand function:
348#define RAND_MAX 0x7fff
349
350_ACRTIMP void __cdecl srand(_In_ unsigned int _Seed);
351
353
354#if defined _CRT_RAND_S || defined _CRTBLD
355 _ACRTIMP errno_t __cdecl rand_s(_Out_ unsigned int* _RandomValue);
356#endif
357
358
359
360#ifdef __cplusplus
361extern "C++"
362{
363 inline long abs(long const _X) throw()
364 {
365 return labs(_X);
366 }
367
368 inline long long abs(long long const _X) throw()
369 {
370 return llabs(_X);
371 }
372
373 inline ldiv_t div(long const _A1, long const _A2) throw()
374 {
375 return ldiv(_A1, _A2);
376 }
377
378 inline lldiv_t div(long long const _A1, long long const _A2) throw()
379 {
380 return lldiv(_A1, _A2);
381 }
382}
383#endif // __cplusplus
384
385
386
387
388// Structs used to fool the compiler into not generating floating point
389// instructions when copying and pushing [long] double values
390#define _CRT_DOUBLE_DEC
391
392#ifndef _LDSUPPORT
393
394 #pragma pack(push, 4)
395 typedef struct
396 {
397 unsigned char ld[10];
398 } _LDOUBLE;
399 #pragma pack(pop)
400
401 #define _PTR_LD(x) ((unsigned char*)(&(x)->ld))
402
403#else // _LDSUPPORT
404
405 // push and pop long, which is #defined as __int64 by a spec2k test
406 #pragma push_macro("long")
407 #undef long
408 typedef long double _LDOUBLE;
409 #pragma pop_macro("long")
410
411 #define _PTR_LD(x) ((unsigned char *)(x))
412
413#endif // _LDSUPPORT
414
415typedef struct
416{
417 double x;
419
420typedef struct
421{
422 float f;
423} _CRT_FLOAT;
424
425// push and pop long, which is #defined as __int64 by a spec2k test
426#pragma push_macro("long")
427#undef long
428
429typedef struct
430{
431 long double x;
433
434#pragma pop_macro("long")
435
436#pragma pack(push, 4)
437typedef struct
438{
439 unsigned char ld12[12];
440} _LDBL12;
441#pragma pack(pop)
442
443
444
445//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
446//
447// Narrow String to Number Conversions
448//
449//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
455
461
465
469 _In_z_ char const* _String,
471 );
472
476 _In_z_ char* _String,
478 );
479
480
484 _In_z_ char* _String,
486 );
487
490 _In_z_ char const* _String,
491 _Out_opt_ _Deref_post_z_ char** _EndPtr
492 );
493
496 _In_z_ char const* _String,
497 _Out_opt_ _Deref_post_z_ char** _EndPtr,
499 );
500
503 _In_z_ char const* _String,
504 _Out_opt_ _Deref_post_z_ char** _EndPtr
505 );
506
509 _In_z_ char const* _String,
510 _Out_opt_ _Deref_post_z_ char** _EndPtr,
512 );
513
516 _In_z_ char const* _String,
517 _Out_opt_ _Deref_post_z_ char** _EndPtr
518 );
519
522 _In_z_ char const* _String,
523 _Out_opt_ _Deref_post_z_ char** _EndPtr,
525 );
526
529 _In_z_ char const* _String,
530 _Out_opt_ _Deref_post_z_ char** _EndPtr,
531 _In_ int _Radix
532 );
533
536 _In_z_ char const* _String,
537 _Out_opt_ _Deref_post_z_ char** _EndPtr,
538 _In_ int _Radix,
540 );
541
544 _In_z_ char const* _String,
545 _Out_opt_ _Deref_post_z_ char** _EndPtr,
546 _In_ int _Radix
547 );
548
551 _In_z_ char const* _String,
552 _Out_opt_ _Deref_post_z_ char** _EndPtr,
553 _In_ int _Radix,
555 );
556
559 _In_z_ char const* _String,
560 _Out_opt_ _Deref_post_z_ char** _EndPtr,
561 _In_ int _Radix
562 );
563
566 _In_z_ char const* _String,
567 _Out_opt_ _Deref_post_z_ char** _EndPtr,
568 _In_ int _Radix,
570 );
571
573_ACRTIMP unsigned long long __cdecl strtoull(
574 _In_z_ char const* _String,
575 _Out_opt_ _Deref_post_z_ char** _EndPtr,
576 _In_ int _Radix
577 );
578
580_ACRTIMP unsigned long long __cdecl _strtoull_l(
581 _In_z_ char const* _String,
582 _Out_opt_ _Deref_post_z_ char** _EndPtr,
583 _In_ int _Radix,
585 );
586
589 _In_z_ char const* _String,
590 _Out_opt_ _Deref_post_z_ char** _EndPtr,
591 _In_ int _Radix
592 );
593
596 _In_z_ char const* _String,
597 _Out_opt_ _Deref_post_z_ char** _EndPtr,
598 _In_ int _Radix,
600 );
601
604 _In_z_ char const* _String,
605 _Out_opt_ _Deref_post_z_ char** _EndPtr,
606 _In_ int _Radix
607 );
608
611 _In_z_ char const* _String,
612 _Out_opt_ _Deref_post_z_ char** _EndPtr,
613 _In_ int _Radix,
615 );
616
617
618
619//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
620//
621// Number to Narrow String Conversions
622//
623//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
624_Success_(return == 0)
627 _In_ int _Value,
631 );
632
634 _Success_(return == 0)
636 _In_ int, _Value,
637 char, _Buffer,
638 _In_ int, _Radix
639 )
640
645 _In_ int, _Radix
646 )
647
648_Success_(return == 0)
651 _In_ long _Value,
653 _In_ size_t _BufferCount,
654 _In_ int _Radix
655 );
656
659 _In_ long, _Value,
660 char, _Buffer,
661 _In_ int, _Radix
662 )
663
668 _In_ int, _Radix
669 )
670
671_Success_(return == 0)
674 _In_ unsigned long _Value,
676 _In_ size_t _BufferCount,
677 _In_ int _Radix
678 );
679
682 _In_ unsigned long, _Value,
683 char, _Buffer,
684 _In_ int, _Radix
685 )
686
689 _In_ unsigned long, _Value,
691 _In_ int, _Radix
692 )
693
694_Success_(return == 0)
699 _In_ size_t _BufferCount,
700 _In_ int _Radix
701 );
702
703_Success_(return == 0)
708 _In_ int _Radix
709 );
710
711_Success_(return == 0)
714 _In_ unsigned __int64 _Value,
716 _In_ size_t _BufferCount,
717 _In_ int _Radix
718 );
719
722 _In_ unsigned __int64 _Value,
724 _In_ int _Radix
725 );
726
727
728
729// _CVTBUFSIZE is the maximum size for the per-thread conversion buffer. It
730// should be at least as long as the number of digits in the largest double
731// precision value (?.?e308 in IEEE arithmetic). We will use the same size
732// buffer as is used in the printf support routines.
733//
734// (This value actually allows 40 additional decimal places; even though there
735// are only 16 digits of accuracy in a double precision IEEE number, the user may
736// ask for more to effect zero padding.)
737#define _CVTBUFSIZE (309 + 40) // # of digits in max. dp value + slop
738
739_Success_(return == 0)
743 _In_ size_t _BufferCount,
744 _In_ double _Value,
748 );
749
752 char, _Buffer,
753 _In_ double, _Value,
754 _In_ int, _DigitCount,
755 _Out_ int*, _PtDec,
756 _Out_ int*, _PtSign
757 )
758
761 _In_ double _Value,
762 _In_ int _DigitCount,
763 _Out_ int* _PtDec,
764 _Out_ int* _PtSign
765 );
766
767_Success_(return == 0)
771 _In_ size_t _BufferCount,
772 _In_ double _Value,
774 _Out_ int* _PtDec,
775 _Out_ int* _PtSign
776 );
777
779 _Success_(return == 0)
781 char, _Buffer,
782 _In_ double, _Value,
784 _Out_ int*, _PtDec,
785 _Out_ int*, _PtSign
786 )
787
788_Success_(return == 0)
791 _In_ double _Value,
793 _Out_ int* _PtDec,
794 _Out_ int* _PtSign
795 );
796
797_Success_(return == 0)
800 _In_ size_t _BufferCount,
801 _In_ double _Value,
802 _In_ int _DigitCount
803 );
804
806 _Success_(return == 0)
808 char, _Buffer,
809 _In_ double, _Value,
810 _In_ int, _DigitCount
811 )
812
815 _In_ double _Value,
816 _In_ int _DigitCount,
818 );
819
820
821
822//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
823//
824// Multibyte String Operations and Conversions
825//
826//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
827// Maximum number of bytes in multi-byte character in the current locale
828// (also defined in ctype.h).
829#ifndef MB_CUR_MAX
830 #if defined _CRT_DISABLE_PERFCRIT_LOCKS && !defined _DLL
831 #define MB_CUR_MAX __mb_cur_max
832 #else
833 #define MB_CUR_MAX ___mb_cur_max_func()
834 #endif
835
836 #ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY
837 extern int __mb_cur_max;
838 #else
839 #define __mb_cur_max (___mb_cur_max_func())
840 #endif
841
842 _Post_satisfies_(return > 0 && return < MB_LEN_MAX)
844
845 _Post_satisfies_(return > 0 && return < MB_LEN_MAX)
847#endif
848
849
850
854 _In_ size_t _MaxCount
855 );
856
860 _In_ size_t _MaxCount,
862 );
863
865_Post_satisfies_(return <= _String_length_(_String))
867 _In_z_ char const* _String
868 );
869
871_Post_satisfies_(return <= _String_length_(_String) || return == (size_t)-1)
873 _In_z_ char const* _String,
875 );
876
878_Post_satisfies_((return <= _String_length_(_String) && return <= _MaxCount) || return == (size_t)-1)
880 _In_z_ char const* _String,
882 );
883
884_Post_satisfies_((return <= _String_length_(_String) && return <= _MaxCount) || return == (size_t)-1)
887 _In_z_ char const* _String,
888 _In_ size_t _MaxCount,
890 );
891
892_Success_(return != -1)
894 _Pre_notnull_ _Post_z_ wchar_t* _DstCh,
897 );
898
899_Success_(return != -1)
901 _Pre_notnull_ _Post_z_ wchar_t* _DstCh,
903 _In_ size_t _SrcSizeInBytes,
905 );
906
909 _Out_opt_ size_t* _PtNumOfCharConverted,
910 _Out_writes_to_opt_(_SizeInWords, *_PtNumOfCharConverted) wchar_t* _DstBuf,
911 _In_ size_t _SizeInWords,
912 _In_reads_or_z_(_MaxCount) char const* _SrcBuf,
913 _In_ size_t _MaxCount
914 );
915
918 _Out_opt_ size_t*, _PtNumOfCharConverted,
919 _Post_z_ wchar_t, _Dest,
920 _In_z_ char const*, _Source,
921 _In_ size_t, _MaxCount
922 )
923
929 )
930
933 _Out_opt_ size_t* _PtNumOfCharConverted,
934 _Out_writes_to_opt_(_SizeInWords, *_PtNumOfCharConverted) wchar_t* _DstBuf,
935 _In_ size_t _SizeInWords,
936 _In_reads_or_z_(_MaxCount) char const* _SrcBuf,
937 _In_ size_t _MaxCount,
939 );
940
943 _Out_opt_ size_t*, _PtNumOfCharConverted,
944 _Post_z_ wchar_t, _Dest,
945 _In_z_ char const*, _Source,
946 _In_ size_t, _MaxCount,
948 )
949
954 _In_z_ char const*, _Source,
955 _In_ size_t, _MaxCount,
957 )
958
959
960
961
964 _Out_writes_opt_z_(MB_LEN_MAX) char* _MbCh,
965 _In_ wchar_t _WCh
966 );
967
970 _Pre_maybenull_ _Post_z_ char* _MbCh,
971 _In_ wchar_t _WCh,
973 );
974
975#if __STDC_WANT_SECURE_LIB__
976
979 _Out_opt_ int* _SizeConverted,
980 _Out_writes_bytes_to_opt_(_SizeInBytes, *_SizeConverted) char* _MbCh,
982 _In_ wchar_t _WCh
983 );
984
985#endif // __STDC_WANT_SECURE_LIB__
986
989 _Out_opt_ int* _SizeConverted,
990 _Out_writes_opt_z_(_SizeInBytes) char* _MbCh,
991 _In_ size_t _SizeInBytes,
992 _In_ wchar_t _WCh,
994
997 _Out_opt_ size_t* _PtNumOfCharConverted,
998 _Out_writes_bytes_to_opt_(_DstSizeInBytes, *_PtNumOfCharConverted) char* _Dst,
999 _In_ size_t _DstSizeInBytes,
1000 _In_z_ wchar_t const* _Src,
1001 _In_ size_t _MaxCountInBytes
1002 );
1003
1006 _Out_opt_ size_t*, _PtNumOfCharConverted,
1008 _In_z_ wchar_t const*, _Source,
1009 _In_ size_t, _MaxCount
1010 )
1011
1015 _In_z_ wchar_t const*, _Source,
1016 _In_ size_t, _MaxCount
1017 )
1018
1021 _Out_opt_ size_t* _PtNumOfCharConverted,
1022 _Out_writes_bytes_to_opt_(_DstSizeInBytes, *_PtNumOfCharConverted) char* _Dst,
1023 _In_ size_t _DstSizeInBytes,
1024 _In_z_ wchar_t const* _Src,
1025 _In_ size_t _MaxCountInBytes,
1027 );
1028
1031 _Out_opt_ size_t*, _PtNumOfCharConverted,
1033 _In_z_ wchar_t const*, _Source,
1034 _In_ size_t, _MaxCount,
1036 )
1037
1042 _In_z_ wchar_t const*, _Source,
1043 _In_ size_t, _MaxCount,
1045 )
1046
1047
1048
1049//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1050//
1051// Path Manipulation
1052//
1053//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1054// Sizes for buffers used by the _makepath() and _splitpath() functions.
1055// note that the sizes include space for 0-terminator
1056#define _MAX_PATH 260 // max. length of full pathname
1057#define _MAX_DRIVE 3 // max. length of drive component
1058#define _MAX_DIR 256 // max. length of path component
1059#define _MAX_FNAME 256 // max. length of file name component
1060#define _MAX_EXT 256 // max. length of extension component
1061
1062
1063#pragma push_macro("_fullpath")
1064#undef _fullpath
1065
1066_Success_(return != 0)
1071 _In_ size_t _BufferCount
1072 );
1073
1074#pragma pop_macro("_fullpath")
1075
1079 _In_ size_t _BufferCount,
1080 _In_opt_z_ char const* _Drive,
1081 _In_opt_z_ char const* _Dir,
1082 _In_opt_z_ char const* _Filename,
1083 _In_opt_z_ char const* _Ext
1084 );
1085
1088 char, _Buffer,
1089 _In_opt_z_ char const*, _Drive,
1090 _In_opt_z_ char const*, _Dir,
1091 _In_opt_z_ char const*, _Filename,
1092 _In_opt_z_ char const*, _Ext
1093 )
1094
1098 _In_opt_z_ char const*, _Drive,
1099 _In_opt_z_ char const*, _Dir,
1100 _In_opt_z_ char const*, _Filename,
1101 _In_opt_z_ char const*, _Ext
1102 )
1103
1106 _In_z_ char const* _FullPath,
1110 _Pre_maybenull_ _Post_z_ char* _Ext
1111 );
1112
1115 _In_z_ char const* _FullPath,
1116 _Out_writes_opt_z_(_DriveCount) char* _Drive,
1117 _In_ size_t _DriveCount,
1118 _Out_writes_opt_z_(_DirCount) char* _Dir,
1119 _In_ size_t _DirCount,
1120 _Out_writes_opt_z_(_FilenameCount) char* _Filename,
1121 _In_ size_t _FilenameCount,
1122 _Out_writes_opt_z_(_ExtCount) char* _Ext,
1123 _In_ size_t _ExtCount
1124 );
1125
1127
1128#if __STDC_WANT_SECURE_LIB__
1129
1131_Success_(return == 0)
1133 _Out_ size_t* _RequiredCount,
1136 _In_z_ char const* _VarName
1137 );
1138
1139#endif // __STDC_WANT_SECURE_LIB__
1140
1141
1142
1143
1144_ACRTIMP int* __cdecl __p___argc (void);
1145_ACRTIMP char*** __cdecl __p___argv (void);
1146_ACRTIMP wchar_t*** __cdecl __p___wargv(void);
1147
1148#ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY
1149 extern int __argc;
1150 extern char** __argv;
1151 extern wchar_t** __wargv;
1152#else
1153 #define __argc (*__p___argc()) // Pointer to number of command line arguments
1154 #define __argv (*__p___argv()) // Pointer to table of narrow command line arguments
1155 #define __wargv (*__p___wargv()) // Pointer to table of wide command line arguments
1156#endif
1157
1158_DCRTIMP char*** __cdecl __p__environ (void);
1159_DCRTIMP wchar_t*** __cdecl __p__wenviron(void);
1160
1161#ifndef _CRT_BEST_PRACTICES_USAGE
1162 #define _CRT_V12_LEGACY_FUNCTIONALITY
1163#endif
1164
1165#ifndef _CRT_V12_LEGACY_FUNCTIONALITY
1166 // Deprecated symbol: Do not expose environment global pointers unless
1167 // legacy access is specifically requested
1168 #define _environ crt_usage_error__do_not_reference_global_pointer_directly__environ
1169 #define _wenviron crt_usage_error__do_not_reference_global_pointer_directly__wenviron
1170#else
1171 #define _environ (*__p__environ()) // Pointer to narrow environment table
1172 #define _wenviron (*__p__wenviron()) // Pointer to wide environment table
1173#endif
1174
1175
1176
1177// Sizes for buffers used by the getenv/putenv family of functions.
1178#define _MAX_ENV 32767
1179
1180
1181#if _CRT_FUNCTIONS_REQUIRED
1182
1184 _DCRTIMP char* __cdecl getenv(
1185 _In_z_ char const* _VarName
1186 );
1187
1190 _Out_ size_t*, _RequiredCount,
1191 char, _Buffer,
1192 _In_z_ char const*, _VarName
1193 )
1194
1195 #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
1196 #pragma push_macro("_dupenv_s")
1197 #undef _dupenv_s
1198 #endif
1199
1203 _Out_opt_ size_t* _BufferCount,
1204 _In_z_ char const* _VarName
1205 );
1206
1207 #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
1208 #pragma pop_macro("_dupenv_s")
1209 #endif
1210
1212 _In_opt_z_ char const* _Command
1213 );
1214
1215 // The functions below have declspecs in their declarations in the Windows
1216 // headers, causing PREfast to fire 6540 here
1217 #pragma warning(push)
1218 #pragma warning(disable: 6540)
1219
1222 _In_z_ char const* _EnvString
1223 );
1224
1227 _In_z_ char const* _Name,
1228 _In_z_ char const* _Value
1229 );
1230
1231 #pragma warning(pop)
1232
1234 _In_z_ char const* _Filename,
1235 _In_z_ char const* _VarName,
1237 _In_ size_t _BufferCount
1238 );
1239
1242 _In_z_ char const*, _Filename,
1243 _In_z_ char const*, _VarName,
1244 char, _Buffer
1245 )
1246
1249 _In_z_ char const*, _Filename,
1250 _In_z_ char const*, _VarName,
1252 )
1253
1254 // The Win32 API SetErrorMode, Beep and Sleep should be used instead.
1257 _In_ int _Mode
1258 );
1259
1261 _DCRTIMP void __cdecl _beep(
1262 _In_ unsigned _Frequency,
1263 _In_ unsigned _Duration
1264 );
1265
1267 _DCRTIMP void __cdecl _sleep(
1268 _In_ unsigned long _Duration
1269 );
1270
1271#endif // _CRT_FUNCTIONS_REQUIRED
1272
1273
1274//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1275//
1276// Non-ANSI Names for Compatibility
1277//
1278//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1279#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
1280
1281 #ifndef __cplusplus
1282 #define max(a,b) (((a) > (b)) ? (a) : (b))
1283 #define min(a,b) (((a) < (b)) ? (a) : (b))
1284 #endif
1285
1286 #define sys_errlist _sys_errlist
1287 #define sys_nerr _sys_nerr
1288
1289 #pragma warning(push)
1290 #pragma warning(disable: 4141) // Using deprecated twice
1291
1293 _ACRTIMP char* __cdecl ecvt(
1294 _In_ double _Value,
1295 _In_ int _DigitCount,
1296 _Out_ int* _PtDec,
1297 _Out_ int* _PtSign
1298 );
1299
1301 _ACRTIMP char* __cdecl fcvt(
1302 _In_ double _Value,
1304 _Out_ int* _PtDec,
1305 _Out_ int* _PtSign
1306 );
1307
1309 _ACRTIMP char* __cdecl gcvt(
1310 _In_ double _Value,
1311 _In_ int _DigitCount,
1312 _Pre_notnull_ _Post_z_ char* _DstBuf
1313 );
1314
1316 _ACRTIMP char* __cdecl itoa(
1317 _In_ int _Value,
1319 _In_ int _Radix
1320 );
1321
1323 _ACRTIMP char* __cdecl ltoa(
1324 _In_ long _Value,
1326 _In_ int _Radix
1327 );
1328
1329
1331 _ACRTIMP void __cdecl swab(
1332 _Inout_updates_z_(_SizeInBytes) char* _Buf1,
1333 _Inout_updates_z_(_SizeInBytes) char* _Buf2,
1334 _In_ int _SizeInBytes
1335 );
1336
1338 _ACRTIMP char* __cdecl ultoa(
1339 _In_ unsigned long _Value,
1341 _In_ int _Radix
1342 );
1343
1344 #define environ _environ
1345
1348 _In_z_ char const* _EnvString
1349 );
1350
1351 #pragma warning(pop)
1352
1354
1355#endif // _CRT_INTERNAL_NONSTDC_NAMES
1356
1357
1358
1361#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
1362#endif // _INC_STDLIB
#define _X(x)
Definition: CPath.cpp:42
void _exit(int exitcode)
Definition: _exit.c:25
size_t __cdecl _mbstrnlen(char const *const string, size_t const max_size)
Definition: _mbslen.cpp:113
#define __cdecl
Definition: accygwin.h:79
#define __int64
Definition: basetyps.h:16
return
Definition: dirsup.c:529
_Source
_String
_In_ _Value
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_2(_ReturnType, _FuncName, _HType1, _HArg1, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
Definition: corecrt.h:182
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(_ReturnType, _FuncName, _HType1, _HArg1, _DstType, _Dst, _TType1, _TArg1)
Definition: corecrt.h:181
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_2_0(_ReturnType, _FuncName, _HType1, _HArg1, _HType2, _HArg2, _DstType, _Dst)
Definition: corecrt.h:184
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3(_ReturnType, _FuncName, _HType1, _HArg1, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
Definition: corecrt.h:183
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_SPLITPATH(_ReturnType, _FuncName, _DstType, _Src)
Definition: corecrt.h:187
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4(_ReturnType, _FuncName, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3, _TType4, _TArg4)
Definition: corecrt.h:180
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2(_ReturnType, _FuncName, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
Definition: corecrt.h:178
BOOL WINAPI Beep(IN DWORD dwFreq, IN DWORD dwDuration)
Definition: deviceio.c:48
UINT WINAPI SetErrorMode(IN UINT uMode)
Definition: except.c:751
size_t rsize_t
Definition: stubs.c:780
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
void __cdecl quick_exit(int const return_code)
Definition: exit.cpp:304
#define abs(i)
Definition: fconv.c:206
errno_t __cdecl _ecvt_s(char *const buffer, size_t const buffer_count, double const value, int const requested_digits, int *const decimal_point, int *const sign)
Definition: fcvt.cpp:245
errno_t __cdecl _fcvt_s(char *const buffer, size_t const buffer_count, double const value, int const requested_digits, int *const decimal_point, int *const sign)
Definition: fcvt.cpp:124
void __declspec(noinline) __cdecl _free_base(void *const block)
Definition: free_base.cpp:98
int CDECL _gcvt_s(char *buff, size_t size, double number, int digits)
Definition: gcvt.c:47
errno_t __cdecl getenv_s(size_t *const required_count, char *const buffer, size_t const buffer_count, char const *const name)
Definition: getenv.cpp:169
errno_t __cdecl _dupenv_s(char **const buffer_pointer, size_t *const buffer_count, char const *const name)
Definition: getenv.cpp:285
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define abort()
Definition: i386-dis.c:34
_Check_return_ _CRTIMP unsigned long __cdecl _strtoul_l(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix, _In_opt_ _locale_t _Locale)
_CRTIMP errno_t __cdecl _get_fmode(_Out_ int *_PMode)
_invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_In_opt_ _invalid_parameter_handler _Handler)
int(__cdecl * _onexit_t)(void)
Definition: stdlib.h:28
_Check_return_ _CRTIMP int __cdecl putenv(_In_z_ const char *_EnvString)
_CRTIMP int __cdecl ___mb_cur_max_func(void)
Definition: environ.c:438
_Check_return_ _CRTIMP char *__cdecl fcvt(_In_ double _Val, _In_ int _NumOfDec, _Out_ int *_PtDec, _Out_ int *_PtSign)
_CRTIMP char **__cdecl __p__pgmptr()
Definition: environ.c:454
_CRTIMP char ***__cdecl __p___argv()
Definition: getargs.c:483
_CRTIMP char *__cdecl gcvt(_In_ double _Val, _In_ int _NumOfDigits, _Pre_notnull_ _Post_z_ char *_DstBuf)
_CRTIMP __MINGW_ATTRIB_DEPRECATED void __cdecl _beep(_In_ unsigned _Frequency, _In_ unsigned _Duration)
void __cdecl srand(_In_ unsigned int _Seed)
_Check_return_ _CRTIMP int __cdecl _atoldbl_l(_Out_ _LDOUBLE *_Result, _In_z_ char *_Str, _In_opt_ _locale_t _Locale)
_Check_return_ unsigned long __cdecl _byteswap_ulong(_In_ unsigned long _Long)
_Check_return_ _CRTIMP char *__cdecl _ecvt(_In_ double _Val, _In_ int _NumOfDigits, _Out_ int *_PtDec, _Out_ int *_PtSign)
_In_ size_t _MaxCount
Definition: stdlib.h:508
_Check_return_ _CRTIMP int __cdecl _atoldbl(_Out_ _LDOUBLE *_Result, _In_z_ char *_Str)
_CRTIMP wchar_t * _wpgmptr
Definition: environ.c:29
_CRTIMP int _fmode
Definition: fmode.c:4
_invalid_parameter_handler __cdecl _get_invalid_parameter_handler(void)
_Check_return_ _CRTIMP int __cdecl _atoi_l(_In_z_ const char *_Str, _In_opt_ _locale_t _Locale)
_Check_return_ _CRTIMP char *__cdecl _fullpath(_Out_writes_opt_z_(_SizeInBytes) char *_FullPath, _In_z_ const char *_Path, _In_ size_t _SizeInBytes)
_In_ size_t _In_ size_t _Size
Definition: stdlib.h:722
_Check_return_ double __cdecl _atof_l(_In_z_ const char *_String, _In_opt_ _locale_t _Locale)
_Check_return_ unsigned long __cdecl _lrotl(_In_ unsigned long _Val, _In_ int _Shift)
_CRTIMP int __cdecl _mbtowc_l(_Pre_notnull_ _Post_z_ wchar_t *_DstCh, _In_reads_bytes_opt_(_SrcSizeInBytes) _Pre_opt_z_ const char *_SrcCh, _In_ size_t _SrcSizeInBytes, _In_opt_ _locale_t _Locale)
_CRTIMP char *__cdecl ultoa(_In_ unsigned long _Val, _Pre_notnull_ _Post_z_ char *_Dstbuf, _In_ int _Radix)
errno_t __cdecl _set_doserrno(_In_ unsigned long _Value)
_CRTIMP char *__cdecl _gcvt(_In_ double _Val, _In_ int _NumOfDigits, _Pre_notnull_ _Post_z_ char *_DstBuf)
_CRTIMP int __cdecl _wctomb_l(_Pre_maybenull_ _Post_z_ char *_MbCh, _In_ wchar_t _WCh, _In_opt_ _locale_t _Locale)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_Check_return_ _CRTIMP int __cdecl _mblen_l(_In_reads_bytes_opt_(_MaxCount) _Pre_opt_z_ const char *_Ch, _In_ size_t _MaxCount, _In_opt_ _locale_t _Locale)
struct _ldiv_t ldiv_t
void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
#define onexit_t
Definition: stdlib.h:31
_CRTIMP unsigned int __cdecl _set_abort_behavior(_In_ unsigned int _Flags, _In_ unsigned int _Mask)
_Check_return_ _CRTIMP long __cdecl _strtol_l(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix, _In_opt_ _locale_t _Locale)
_CRTIMP char ** __argv
Definition: getargs.c:18
_Check_return_ unsigned int __cdecl _rotl(_In_ unsigned int _Val, _In_ int _Shift)
long __cdecl labs(_In_ long _X)
_CRTIMP wchar_t ***__cdecl __p___wargv()
Definition: getargs.c:491
_Check_return_ _CRTIMP double __cdecl _strtod_l(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_opt_ _locale_t _Locale)
_CRTIMP _purecall_handler __cdecl _get_purecall_handler(void)
_CRTIMP void __cdecl swab(_Inout_updates_z_(_SizeInBytes) char *_Buf1, _Inout_updates_z_(_SizeInBytes) char *_Buf2, _In_ int _SizeInBytes)
_CRTIMP int __cdecl ___mb_cur_max_l_func(_locale_t)
Definition: initctype.cpp:289
__MINGW_EXTENSION _Check_return_ lldiv_t __cdecl lldiv(_In_ long long, _In_ long long)
_Check_return_opt_ _CRTIMP int __cdecl _set_error_mode(_In_ int _Mode)
_Check_return_ unsigned short __cdecl _byteswap_ushort(_In_ unsigned short _Short)
_CRTIMP wchar_t ***__cdecl __p__wenviron()
Definition: environ.c:392
_CRTIMP void __cdecl _splitpath(_In_z_ const char *_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)
_CRTIMP wchar_t **__cdecl __p__wpgmptr()
Definition: environ.c:477
_CRTIMP errno_t __cdecl _get_wpgmptr(_Outptr_result_z_ wchar_t **_Value)
_CRTIMP errno_t __cdecl _get_pgmptr(_Outptr_result_z_ char **_Value)
__CRT_INLINE void __cdecl _Exit(int status)
Definition: stdlib.h:233
errno_t __cdecl _get_doserrno(_Out_ unsigned long *_Value)
_CRTIMP __MINGW_ATTRIB_DEPRECATED void __cdecl _sleep(_In_ unsigned long _Duration)
void(__cdecl * _invalid_parameter_handler)(const wchar_t *, const wchar_t *, const wchar_t *, unsigned int, uintptr_t)
Definition: stdlib.h:125
#define MB_LEN_MAX
Definition: stdlib.h:19
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
_CRTIMP char *__cdecl itoa(_In_ int _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
_CRTIMP char *__cdecl ltoa(_In_ long _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
_CRTIMP unsigned long *__cdecl __doserrno(void)
Definition: errno.c:25
_Check_return_ div_t __cdecl div(_In_ int _Numerator, _In_ int _Denominator)
_CRTIMP int __mb_cur_max
Definition: locale.c:39
_CRTIMP int __argc
Definition: getargs.c:21
_onexit_t __cdecl _onexit(_In_opt_ _onexit_t _Func)
_Check_return_ _CRTIMP int __cdecl _putenv(_In_z_ const char *_EnvString)
_Check_return_ _CRTIMP size_t __cdecl _mbstrlen(_In_z_ const char *_Str)
_CRTIMP void __cdecl _searchenv(_In_z_ const char *_Filename, _In_z_ const char *_EnvVar, _Pre_notnull_ _Post_z_ char *_ResultPath)
_CRTIMP void __cdecl _swab(_Inout_updates_(_SizeInBytes) _Post_readable_size_(_SizeInBytes) char *_Buf1, _Inout_updates_(_SizeInBytes) _Post_readable_size_(_SizeInBytes) char *_Buf2, int _SizeInBytes)
_CRTIMP int *__cdecl __p___argc()
Definition: getargs.c:475
_Check_return_ unsigned int __cdecl _rotr(_In_ unsigned int _Val, _In_ int _Shift)
_CRTIMP errno_t __cdecl _set_fmode(_In_ int _Mode)
_CRTIMP wchar_t ** __wargv
Definition: getargs.c:20
struct _div_t div_t
__MINGW_EXTENSION _Check_return_ __CRT_INLINE long long __cdecl llabs(_In_ long long _j)
Definition: stdlib.h:1435
__MINGW_EXTENSION long long __cdecl strtoll(const char *__restrict__, char **__restrict, int)
Definition: strtox.cpp:119
_CRTIMP _purecall_handler __cdecl _set_purecall_handler(_In_opt_ _purecall_handler _Handler)
_Check_return_ unsigned long __cdecl strtoul(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
_CRTIMP char ***__cdecl __p__environ()
Definition: environ.c:384
_Check_return_ _CRTIMP int __cdecl _atodbl_l(_Out_ _CRT_DOUBLE *_Result, _In_z_ char *_Str, _In_opt_ _locale_t _Locale)
_Check_return_ _CRTIMP int __cdecl _atoflt_l(_Out_ _CRT_FLOAT *_Result, _In_z_ char *_Str, _In_opt_ _locale_t _Locale)
_Check_return_ ldiv_t __cdecl ldiv(_In_ long _Numerator, _In_ long _Denominator)
_Check_return_ _CRTIMP char *__cdecl _fcvt(_In_ double _Val, _In_ int _NumOfDec, _Out_ int *_PtDec, _Out_ int *_PtSign)
int __cdecl system(_In_opt_z_ const char *_Command)
_Check_return_ unsigned long __cdecl _lrotr(_In_ unsigned long _Val, _In_ int _Shift)
void(__cdecl * _purecall_handler)(void)
Definition: stdlib.h:120
onexit_t __cdecl onexit(_In_opt_ onexit_t _Func)
int __cdecl atexit(void(__cdecl *)(void))
Definition: atonexit.c:97
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
_Check_return_ _CRTIMP long __cdecl _atol_l(_In_z_ const char *_Str, _In_opt_ _locale_t _Locale)
_Check_return_ _CRTIMP size_t __cdecl _mbstrnlen_l(_In_z_ const char *_Str, _In_ size_t _MaxCount, _In_opt_ _locale_t _Locale)
_CRTIMP char * _pgmptr
Definition: environ.c:27
_Check_return_ int __cdecl mblen(_In_reads_bytes_opt_(_MaxCount) _Pre_opt_z_ const char *_Ch, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP int __cdecl _atoflt(_Out_ _CRT_FLOAT *_Result, _In_z_ char *_Str)
_Check_return_ double __cdecl strtod(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr)
_Check_return_ _CRTIMP int __cdecl _atodbl(_Out_ _CRT_DOUBLE *_Result, _In_z_ char *_Str)
_Check_return_ _CRTIMP size_t __cdecl _mbstrlen_l(_In_z_ const char *_Str, _In_opt_ _locale_t _Locale)
float __cdecl strtof(const char *nptr, char **endptr)
Definition: strtod.cpp:55
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
_Check_return_ _CRTIMP char *__cdecl ecvt(_In_ double _Val, _In_ int _NumOfDigits, _Out_ int *_PtDec, _Out_ int *_PtSign)
__MINGW_EXTENSION long long __cdecl atoll(const char *)
Definition: stdlib.h:1451
long double __cdecl strtold(const char *__restrict__, char **__restrict__)
Definition: strtod.cpp:89
_CRTIMP __MINGW_ATTRIB_DEPRECATED void __cdecl _seterrormode(_In_ int _Mode)
_CRT_MANAGED_FP_DEPRECATE _In_ unsigned int _Mask
Definition: float.h:240
_In_ size_t _BufferCount
Definition: stdlib.h:629
__RETURN_POLICY_VOID
Definition: stdlib.h:1096
_ACRTIMP _invalid_parameter_handler __cdecl _set_thread_local_invalid_parameter_handler(_In_opt_ _invalid_parameter_handler _Handler)
_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 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_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_ _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)
_Pre_notnull_ _In_opt_z_ char const _In_opt_z_ char const _In_opt_z_ char const _Filename
Definition: stdlib.h:1100
unsigned __int64 __cdecl _rotl64(_In_ unsigned __int64 _Value, _In_ int _Shift)
_ultoa
Definition: stdlib.h:688
unsigned __int64 __cdecl _rotr64(_In_ unsigned __int64 _Value, _In_ int _Shift)
_Check_return_ _ACRTIMP __int64 __cdecl _atoi64_l(_In_z_ char const *_String, _In_opt_ _locale_t _Locale)
_wcstombs_l
Definition: stdlib.h:1039
_Check_return_ _ACRTIMP long long __cdecl _atoll_l(_In_z_ char const *_String, _In_opt_ _locale_t _Locale)
_ltoa
Definition: stdlib.h:665
_Dest
Definition: stdlib.h:926
_In_ size_t _In_ double _In_ int _Out_ int * _PtDec
Definition: stdlib.h:746
_itoa
Definition: stdlib.h:642
_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)
_In_ _Pre_notnull_ _Buffer
Definition: stdlib.h:644
_mbstowcs_s_l
Definition: stdlib.h:951
_Pre_notnull_ _In_opt_z_ char const _In_opt_z_ char const _Dir
Definition: stdlib.h:1099
_mbstowcs_l
Definition: stdlib.h:951
_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)
_In_ size_t _In_ double _In_ int _Out_ int _Out_ int * _PtSign
Definition: stdlib.h:748
_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)
_Check_return_ _ACRTIMP unsigned __int64 __cdecl _strtoui64(_In_z_ char const *_String, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
_ACRTIMP char *__cdecl _ui64toa(_In_ unsigned __int64 _Value, _Pre_notnull_ _Post_z_ char *_Buffer, _In_ int _Radix)
_In_ size_t _In_ double _In_ int _DigitCount
Definition: stdlib.h:745
_wcstombs_s_l
Definition: stdlib.h:1039
__RETURN_POLICY_DST
Definition: stdlib.h:642
_ACRTIMP
Definition: stdlib.h:642
int __cdecl at_quick_exit(void(__cdecl *)(void))
_ACRTIMP _invalid_parameter_handler __cdecl _get_thread_local_invalid_parameter_handler(void)
_Check_return_ _ACRTIMP __int64 __cdecl _strtoi64(_In_z_ char const *_String, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
wcstombs
Definition: stdlib.h:1013
_Check_return_ unsigned __int64 __cdecl _byteswap_uint64(_In_ unsigned __int64 _Number)
_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 __int64 __cdecl _atoi64(_In_z_ char const *_String)
_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)
_makepath
Definition: stdlib.h:1096
_Check_return_ __int64 __cdecl _abs64(_In_ __int64 _Number)
_In_ size_t _SrcSizeInBytes
Definition: stdlib.h:897
_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)
mbstowcs
Definition: stdlib.h:925
_Pre_notnull_ _In_opt_z_ char const _Drive
Definition: stdlib.h:1098
_In_z_ char const * _Path
Definition: stdlib.h:1070
_In_ size_t _In_ double _In_ int _FractionalDigitCount
Definition: stdlib.h:773
_In_ size_t _In_ int _Radix
Definition: stdlib.h:631
char *CDECL _i64toa(__int64 value, char *string, int radix)
Definition: itoa.c:10
int CDECL _ui64toa_s(unsigned __int64 value, char *str, size_t size, int radix)
Definition: itoa.c:156
int CDECL _itoa_s(int value, char *str, size_t size, int radix)
Definition: itoa.c:195
int CDECL _ltoa_s(long value, char *str, size_t size, int radix)
Definition: itoa.c:255
int CDECL _i64toa_s(__int64 value, char *str, size_t size, int radix)
Definition: itoa.c:50
#define f
Definition: ke_i.h:83
unsigned int uintptr_t
Definition: intrin.h:47
#define _splitpath_s(f, d, dl, p, pl, n, nl, e, el)
Definition: utility.h:212
unsigned int *__cdecl __p__fmode(void)
Definition: fmode.c:9
const char * strerror(int err)
Definition: compat_str.c:23
#define _Deref_post_z_
Definition: ms_sal.h:1121
#define _In_reads_or_z_opt_(size)
Definition: ms_sal.h:326
#define _Pre_opt_z_
Definition: ms_sal.h:1274
#define _Outptr_result_z_
Definition: ms_sal.h:434
#define _Outptr_result_buffer_maybenull_(size)
Definition: ms_sal.h:464
#define _Out_writes_to_opt_(s, c)
Definition: no_sal2.h:238
#define _Out_writes_z_(s)
Definition: no_sal2.h:180
#define _Out_opt_
Definition: no_sal2.h:214
#define _Post_readable_size_(s)
Definition: no_sal2.h:536
#define _Inout_updates_(s)
Definition: no_sal2.h:182
#define _Success_(c)
Definition: no_sal2.h:84
#define _Out_writes_opt_(s)
Definition: no_sal2.h:226
#define _In_z_
Definition: no_sal2.h:164
#define _Pre_maybenull_
Definition: no_sal2.h:514
#define _Check_return_
Definition: no_sal2.h:60
#define _In_opt_z_
Definition: no_sal2.h:218
#define _Post_z_
Definition: no_sal2.h:508
#define _Out_writes_bytes_opt_(s)
Definition: no_sal2.h:228
#define _Inout_updates_z_(s)
Definition: no_sal2.h:186
#define _Pre_notnull_
Definition: no_sal2.h:516
#define _In_reads_or_z_(s)
Definition: no_sal2.h:174
#define _Out_writes_opt_z_(s)
Definition: no_sal2.h:230
#define _Outptr_result_maybenull_z_
Definition: no_sal2.h:274
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _Post_satisfies_(e)
Definition: no_sal2.h:66
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Out_writes_bytes_to_opt_(s, c)
Definition: no_sal2.h:240
#define _In_reads_bytes_opt_(s)
Definition: no_sal2.h:224
errno_t __cdecl _putenv_s(char const *const name, char const *const value)
Definition: putenv.cpp:234
_CRTIMP int *__cdecl _errno(void)
Definition: errno.c:17
errno_t __cdecl _get_errno(_Out_ int *_Value)
errno_t __cdecl _set_errno(_In_ int _Value)
_Check_return_ wchar_t _Ch
Definition: string.h:697
_In_ size_t _SizeInBytes
Definition: time.h:146
_In_ size_t _SizeInWords
Definition: time.h:309
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm _In_opt_ _locale_t _Locale
Definition: time.h:159
_Result
Definition: conio.h:347
#define exit(n)
Definition: config.h:202
int CDECL rand_s(unsigned int *pval)
Definition: rand_s.c:18
errno_t __cdecl _searchenv_s(char const *const file_name, char const *const environment_variable, char *const result_buffer, size_t const result_count)
Definition: searchenv.cpp:177
#define strtoull
Definition: stabs.c:58
Definition: stdlib.h:81
Definition: stdlib.h:38
Definition: stdlib.h:43
long quot
Definition: stdlib.h:44
long rem
Definition: stdlib.h:45
long long rem
Definition: stdlib.h:290
long long quot
Definition: stdlib.h:289
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
int *__cdecl __sys_nerr()
Definition: syserr.cpp:142
char **__cdecl __sys_errlist()
Definition: syserr.cpp:147
double atof()
#define wctomb(cp, wc)
Definition: wchar.h:161
#define mbtowc(wp, cp, len)
Definition: wchar.h:155
#define _CRT_OBSOLETE(_NewItem)
Definition: corecrt.h:549
#define _Check_return_opt_
Definition: corecrt.h:224
#define _DCRTIMP
Definition: corecrt.h:154
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_2_0(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _HType1, _HArg1, _HType2, _HArg2, _SalAttributeDst, _DstType, _Dst)
Definition: corecrt.h:860
#define _CRT_NONSTDC_DEPRECATE(_NewName)
Definition: corecrt.h:439
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_1_1(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _HType1, _HArg1, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
Definition: corecrt.h:857
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_SIZE(_DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
Definition: corecrt.h:901
#define _CRTALLOCATOR
Definition: corecrt.h:167
#define _UCRT_DISABLE_CLANG_WARNINGS
Definition: corecrt.h:109
#define _UCRT_RESTORE_CLANG_WARNINGS
Definition: corecrt.h:117
#define _Check_return_wat_
Definition: corecrt.h:230
#define _CRT_INSECURE_DEPRECATE_GLOBALS(replacement)
Definition: corecrt.h:530
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_3_SIZE_EX(_DeclSpec, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
Definition: corecrt.h:1975
#define _CRT_JIT_INTRINSIC
Definition: corecrt.h:175
int errno_t
Definition: corecrt.h:615
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_4(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3, _TType4, _TArg4)
Definition: corecrt.h:854
#define _VCRTIMP
Definition: vcruntime.h:60
#define _CRT_END_C_HEADER
Definition: vcruntime.h:42
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:40
#define _CRT_INSECURE_DEPRECATE(_Replacement)
Definition: vcruntime.h:99
errno_t __cdecl wctomb_s(int *const return_value, char *const destination, size_t const destination_count, wchar_t const wchar)
Definition: wctomb.cpp:160
errno_t __cdecl _ultoa_s(unsigned long const value, char *const buffer, size_t const buffer_count, int const radix)
Definition: xtoa.cpp:152
#define __CRTDECL
Definition: yvals.h:17
#define const
Definition: zconf.h:233