stdlib.h

stdlib.h

stdlib 頭文件即standard library標準庫頭文件。stdlib.h裡面定義了五種類型、一些宏和通用工具函數。類型例如size_t、wchar_t、div_t、ldiv_t和lldiv_t;宏例如EXIT_FAILURE、EXIT_SUCCESS、RAND_MAX和MB_CUR_MAX等等;常用的函數如malloc()、calloc()、realloc()、free()、system()、atoi()、atol()、rand()、srand()、exit()等等。具體的內容可以打開編譯器的include目錄裡面的stdlib.h頭文件查看。

文件簡介


stdlib 頭文件即standard library標準庫函數頭文件
stdlib 頭文件里包含了C、C++語言的最常用的系統函數
該文件包含了C語言標準庫函數的定義

包含的函數


輸入樣式:C語言模式:#include
C++樣式:#include
1函數名稱:calloc
函數原型: void calloc(unsigned n,unsigned size);
函數功能: 分配n個數據項的內存連續空間,每個數據項的大小為 size
函數返回: 分配內存單元的起始地址,如果不成功,返回0
2函數名稱:free
函數原型: void free(void* p);
函數功能: 釋放 p 所指的內存區
函數返回:
參數說明: p- 被釋放的指針
3函數名稱:malloc
函數原型: void * malloc(unsigned size);
函數功能: 分配 size 位元組的存儲區
函數返回: 所分配的內存區地址,如果內存不夠,返回0
4函數名稱: realloc
函數原型: void * realloc(void * p,unsigned size);
函數功能: 將 p 所指出的已分配內存區的大小改為 size,size 可以比原來分配的空間大或小
函數返回: 返回指向該內存區的指針.NULL-分配失敗
5函數名稱: rand
函數原型: int rand(void);
函數功能: 產生0到32767間的隨機整數(0到0x7fff之間)
函數返回: 隨機整數
6函數名稱: abort
函數原型: void abort(void)
函數功能: 異常終止一個進程.
7函數名稱: exit
函數原型: void exit(int state)
函數功能: 程序中止執行,返回調用過程
函數返回:
參數說明: state:0- 正常中止,非 0- 非正常中止
8函數名稱: getenv
函數原型: char* getenv(const char *name)
函數功能: 返回一個指向環境變數的指針
函數返回:環境變數的定義
參數說明: name- 環境字元串
9函數名稱: putenv
函數原型: int putenv(const char *name)
函數功能: 將字元串name增加到DOS環境變數中
函數返回: 0:操作成功,-1:操作失敗
參數說明: name-環境字元串
10函數名稱: labs
函數原型: long labs(long num)
函數功能: 求長整型參數的絕對值
函數返回:絕對值
11函數名稱: atof
函數原型: double atof(char *str)
函數功能: 將字元串轉換成一個雙精度數值
函數返回: 轉換后的數值
參數說明: str- 待轉換浮點型數的字元串
12函數名稱: atoi
函數原型: int atoi(char *str)
函數功能: 將字元串轉換成一個整數值
函數返回: 轉換后的數值
參數說明: str- 待轉換為整型數的字元串
13函數名稱: atol
函數原型: long atol(char *str)
函數功能: 將字元串轉換成一個長整數
函數返回: 轉換后的數值
參數說明: str- 待轉換為長整型的字元串
14函數名稱:ecvt
函數原型: char *ecvt(double value,int ndigit,int *dec,int *sign)
函數功能: 將浮點數轉換為字元串
函數返回: 轉換后的字元串指針
參數說明: value- 待轉換底浮點數,ndigit- 轉換后的字元串長度
15函數名稱:fcvt
函數原型: char *fcvt(double value,int ndigit,int *dec,int *sign)
函數功能: 將浮點數變成一個字元串
函數返回: 轉換后字元串指針
參數說明: value- 待轉換底浮點數,ndigit- 轉換后底字元串長度

文件內容

編輯 語音
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
//
// 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
 
_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 _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)
 
_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
)
 
#pragma warning(push)
#pragma warning(disable: 28719) // __WARNING_BANNED_API_USAGE
#pragma warning(disable: 28726) // __WARNING_BANNED_API_USAGEL2
__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
)
#pragma warning(pop)
 
_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
)
 
#pragma warning(push)
#pragma warning(disable: 28726) // __WARNING_BANNED_API_USAGEL2
__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
)
#pragma warning(pop)
 
_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
)
 
#pragma warning(push)
#pragma warning(disable: 28719) // __WARNING_BANNED_API_USAGE
#pragma warning(disable: 28726) // __WARNING_BANNED_API_USAGEL2
__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
)
#pragma warning(pop)
 
_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 _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
#endif // _INC_STDLIB