Reactos
1//
2// stdio.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The C Standard Library <stdio.h> header.
7//
8#pragma once
9#ifndef _INC_STDIO // include guard for 3rd party interop
10#define _INC_STDIO
11
12#include <corecrt.h>
13#include <corecrt_wstdio.h>
14
15#pragma warning(push)
16#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
17_UCRT_DISABLE_CLANG_WARNINGS
18
19_CRT_BEGIN_C_HEADER
20
21/* Buffered I/O macros */
22
23#define BUFSIZ 512
24
25
26
27/*
28 * Default number of supported streams. _NFILE is confusing and obsolete, but
29 * supported anyway for backwards compatibility.
30 */
31#define _NFILE _NSTREAM_
32
33#define _NSTREAM_ 512
34
35/*
36 * Number of entries in _iob[] (declared below). Note that _NSTREAM_ must be
37 * greater than or equal to _IOB_ENTRIES.
38 */
39#define _IOB_ENTRIES 3
40
41#define EOF (-1)
42
43#define _IOFBF 0x0000
44#define _IOLBF 0x0040
45#define _IONBF 0x0004
46
47
48
49#define L_tmpnam 260 // _MAX_PATH
50#if __STDC_WANT_SECURE_LIB__
51 #define L_tmpnam_s L_tmpnam
52#endif
53
54
55
56/* Seek method constants */
57
58#define SEEK_CUR 1
59#define SEEK_END 2
60#define SEEK_SET 0
61
62
63#define FILENAME_MAX 260
64#define FOPEN_MAX 20
65#define _SYS_OPEN 20
66#define TMP_MAX _CRT_INT_MAX
67#if __STDC_WANT_SECURE_LIB__
68 #define TMP_MAX_S TMP_MAX
69 #define _TMP_MAX_S TMP_MAX
70#endif
71
72
73typedef __int64 fpos_t;
74
75
76
77#if _CRT_FUNCTIONS_REQUIRED
78
79 _Check_return_opt_
80 _ACRTIMP errno_t __cdecl _get_stream_buffer_pointers(
81 _In_ FILE* _Stream,
82 _Out_opt_ char*** _Base,
83 _Out_opt_ char*** _Pointer,
84 _Out_opt_ int** _Count
85 );
86
87
88 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
89 //
90 // Narrow Character Stream I/O Functions
91 //
92 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
93 #if __STDC_WANT_SECURE_LIB__
94
95 _Check_return_wat_
96 _ACRTIMP errno_t __cdecl clearerr_s(
97 _Inout_ FILE* _Stream
98 );
99
100 _Check_return_wat_
101 _Success_(return == 0)
102 _ACRTIMP errno_t __cdecl fopen_s(
103 _Outptr_result_nullonfailure_ FILE** _Stream,
104 _In_z_ char const* _FileName,
105 _In_z_ char const* _Mode
106 );
107
108 _Check_return_opt_
109 _Success_(return != 0)
110 _ACRTIMP size_t __cdecl fread_s(
111 _Out_writes_bytes_to_(_BufferSize, _ElementSize * _ElementCount) void* _Buffer,
112 _In_range_(>=, _ElementSize * _ElementCount) size_t _BufferSize,
113 _In_ size_t _ElementSize,
114 _In_ size_t _ElementCount,
115 _Inout_ FILE* _Stream
116 );
117
118 _Check_return_wat_
119 _ACRTIMP errno_t __cdecl freopen_s(
120 _Outptr_result_maybenull_ FILE** _Stream,
121 _In_z_ char const* _FileName,
122 _In_z_ char const* _Mode,
123 _Inout_ FILE* _OldStream
124 );
125
126 _Success_(return != 0)
127 _ACRTIMP char* __cdecl gets_s(
128 _Out_writes_z_(_Size) char* _Buffer,
129 _In_ rsize_t _Size
130 );
131
132 _Check_return_wat_
133 _ACRTIMP errno_t __cdecl tmpfile_s(
134 _Out_opt_ _Deref_post_valid_ FILE** _Stream
135 );
136
137 _Success_(return == 0)
138 _Check_return_wat_
139 _ACRTIMP errno_t __cdecl tmpnam_s(
140 _Out_writes_z_(_Size) char* _Buffer,
141 _In_ rsize_t _Size
142 );
143
144 #endif
145
146 _ACRTIMP void __cdecl clearerr(
147 _Inout_ FILE* _Stream
148 );
149
150 _Success_(return != -1)
151 _Check_return_opt_
152 _ACRTIMP int __cdecl fclose(
153 _Inout_ FILE* _Stream
154 );
155
156 _Check_return_opt_
157 _ACRTIMP int __cdecl _fcloseall(void);
158
159 _Check_return_
160 _ACRTIMP FILE* __cdecl _fdopen(
161 _In_ int _FileHandle,
162 _In_z_ char const* _Mode
163 );
164
165 _Check_return_
166 _ACRTIMP int __cdecl feof(
167 _In_ FILE* _Stream
168 );
169
170 _Check_return_
171 _ACRTIMP int __cdecl ferror(
172 _In_ FILE* _Stream
173 );
174
175 _Check_return_opt_
176 _ACRTIMP int __cdecl fflush(
177 _Inout_opt_ FILE* _Stream
178 );
179
180 _Success_(return != EOF)
181 _Check_return_opt_
182 _ACRTIMP int __cdecl fgetc(
183 _Inout_ FILE* _Stream
184 );
185
186 _Check_return_opt_
187 _ACRTIMP int __cdecl _fgetchar(void);
188
189 _Success_(return != EOF)
190 _Check_return_opt_
191 _ACRTIMP int __cdecl fgetpos(
192 _Inout_ FILE* _Stream,
193 _Out_ fpos_t* _Position
194 );
195
196 _Success_(return == _Buffer)
197 _Check_return_opt_
198 _ACRTIMP char* __cdecl fgets(
199 _Out_writes_z_(_MaxCount) char* _Buffer,
200 _In_ int _MaxCount,
201 _Inout_ FILE* _Stream
202 );
203
204 _Check_return_
205 _ACRTIMP int __cdecl _fileno(
206 _In_ FILE* _Stream
207 );
208
209 _Check_return_opt_
210 _ACRTIMP int __cdecl _flushall(void);
211
212 _Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s)
213 _ACRTIMP FILE* __cdecl fopen(
214 _In_z_ char const* _FileName,
215 _In_z_ char const* _Mode
216 );
217
218
219 _Success_(return != EOF)
220 _Check_return_opt_
221 _ACRTIMP int __cdecl fputc(
222 _In_ int _Character,
223 _Inout_ FILE* _Stream
224 );
225
226 _Check_return_opt_
227 _ACRTIMP int __cdecl _fputchar(
228 _In_ int _Character
229 );
230
231 _Success_(return != EOF)
232 _Check_return_opt_
233 _ACRTIMP int __cdecl fputs(
234 _In_z_ char const* _Buffer,
235 _Inout_ FILE* _Stream
236 );
237
238 _Check_return_opt_
239 _ACRTIMP size_t __cdecl fread(
240 _Out_writes_bytes_(_ElementSize * _ElementCount) void* _Buffer,
241 _In_ size_t _ElementSize,
242 _In_ size_t _ElementCount,
243 _Inout_ FILE* _Stream
244 );
245
246 _Success_(return != 0)
247 _Check_return_ _CRT_INSECURE_DEPRECATE(freopen_s)
248 _ACRTIMP FILE* __cdecl freopen(
249 _In_z_ char const* _FileName,
250 _In_z_ char const* _Mode,
251 _Inout_ FILE* _Stream
252 );
253
254 _Check_return_
255 _ACRTIMP FILE* __cdecl _fsopen(
256 _In_z_ char const* _FileName,
257 _In_z_ char const* _Mode,
258 _In_ int _ShFlag
259 );
260
261 _Success_(return == 0)
262 _Check_return_opt_
263 _ACRTIMP int __cdecl fsetpos(
264 _Inout_ FILE* _Stream,
265 _In_ fpos_t const* _Position
266 );
267
268 _Success_(return == 0)
269 _Check_return_opt_
270 _ACRTIMP int __cdecl fseek(
271 _Inout_ FILE* _Stream,
272 _In_ long _Offset,
273 _In_ int _Origin
274 );
275
276 _Success_(return == 0)
277 _Check_return_opt_
278 _ACRTIMP int __cdecl _fseeki64(
279 _Inout_ FILE* _Stream,
280 _In_ __int64 _Offset,
281 _In_ int _Origin
282 );
283
284 _Success_(return != -1)
285 _Check_return_
286 _ACRTIMP long __cdecl ftell(
287 _Inout_ FILE* _Stream
288 );
289
290 _Success_(return != -1)
291 _Check_return_
292 _ACRTIMP __int64 __cdecl _ftelli64(
293 _Inout_ FILE* _Stream
294 );
295
296 _Check_return_opt_
297 _ACRTIMP size_t __cdecl fwrite(
298 _In_reads_bytes_(_ElementSize * _ElementCount) void const* _Buffer,
299 _In_ size_t _ElementSize,
300 _In_ size_t _ElementCount,
301 _Inout_ FILE* _Stream
302 );
303
304 _Success_(return != EOF)
305 _Check_return_
306 _ACRTIMP int __cdecl getc(
307 _Inout_ FILE* _Stream
308 );
309
310 _Check_return_
311 _ACRTIMP int __cdecl getchar(void);
312
313 _Check_return_
314 _ACRTIMP int __cdecl _getmaxstdio(void);
315
316 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(
317 char*, gets_s,
318 char, _Buffer)
319
320 _Check_return_
321 _ACRTIMP int __cdecl _getw(
322 _Inout_ FILE* _Stream
323 );
324
325 _ACRTIMP void __cdecl perror(
326 _In_opt_z_ char const* _ErrorMessage
327 );
328
329 #if defined _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
330
331 _Success_(return != -1)
332 _Check_return_opt_
333 _DCRTIMP int __cdecl _pclose(
334 _Inout_ FILE* _Stream
335 );
336
337 _Check_return_
338 _DCRTIMP FILE* __cdecl _popen(
339 _In_z_ char const* _Command,
340 _In_z_ char const* _Mode
341 );
342
343 #endif
344
345 _Success_(return != EOF)
346 _Check_return_opt_
347 _ACRTIMP int __cdecl putc(
348 _In_ int _Character,
349 _Inout_ FILE* _Stream
350 );
351
352 _Check_return_opt_
353 _ACRTIMP int __cdecl putchar(
354 _In_ int _Character
355 );
356
357 _Check_return_opt_
358 _ACRTIMP int __cdecl puts(
359 _In_z_ char const* _Buffer
360 );
361
362 _Success_(return != -1)
363 _Check_return_opt_
364 _ACRTIMP int __cdecl _putw(
365 _In_ int _Word,
366 _Inout_ FILE* _Stream
367 );
368
369 _ACRTIMP int __cdecl remove(
370 _In_z_ char const* _FileName
371 );
372
373 _Check_return_
374 _ACRTIMP int __cdecl rename(
375 _In_z_ char const* _OldFileName,
376 _In_z_ char const* _NewFileName
377 );
378
379 _ACRTIMP int __cdecl _unlink(
380 _In_z_ char const* _FileName
381 );
382
383 #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
384
385 _CRT_NONSTDC_DEPRECATE(_unlink)
386 _ACRTIMP int __cdecl unlink(
387 _In_z_ char const* _FileName
388 );
389
390 #endif
391
392 _ACRTIMP void __cdecl rewind(
393 _Inout_ FILE* _Stream
394 );
395
396 _Check_return_opt_
397 _ACRTIMP int __cdecl _rmtmp(void);
398
399 _CRT_INSECURE_DEPRECATE(setvbuf)
400 _ACRTIMP void __cdecl setbuf(
401 _Inout_ FILE* _Stream,
402 _Inout_updates_opt_(BUFSIZ) _Post_readable_size_(0) char* _Buffer
403 );
404
405 _Check_return_opt_
406 _ACRTIMP int __cdecl _setmaxstdio(
407 _In_ int _Maximum
408 );
409
410 _Success_(return == 0)
411 _Check_return_opt_
412 _ACRTIMP int __cdecl setvbuf(
413 _Inout_ FILE* _Stream,
414 _Inout_updates_opt_(_Size) char* _Buffer,
415 _In_ int _Mode,
416 _In_ size_t _Size
417 );
418
419 #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC
420 #pragma push_macro("_tempnam")
421 #undef _tempnam
422 #endif
423
424 _Check_return_
425 _ACRTIMP _CRTALLOCATOR char* __cdecl _tempnam(
426 _In_opt_z_ char const* _DirectoryName,
427 _In_opt_z_ char const* _FilePrefix
428 );
429
430 #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC
431 #pragma pop_macro("_tempnam")
432 #endif
433
434 _Check_return_ _CRT_INSECURE_DEPRECATE(tmpfile_s)
435 _ACRTIMP FILE* __cdecl tmpfile(void);
436
437 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(
438 _Success_(return == 0)
439 errno_t, tmpnam_s,
440 _Always_(_Post_z_) char, _Buffer
441 )
442
443__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(
444 _Success_(return != 0)
445 char*, __RETURN_POLICY_DST, _ACRTIMP, tmpnam,
446 _Pre_maybenull_ _Always_(_Post_z_), char, _Buffer
447 )
448
449 _Success_(return != EOF)
450 _Check_return_opt_
451 _ACRTIMP int __cdecl ungetc(
452 _In_ int _Character,
453 _Inout_ FILE* _Stream
454 );
455
456
457
458 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
459 //
460 // I/O Synchronization and _nolock family of I/O functions
461 //
462 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
463 _ACRTIMP void __cdecl _lock_file(
464 _Inout_ FILE* _Stream
465 );
466
467 _ACRTIMP void __cdecl _unlock_file(
468 _Inout_ FILE* _Stream
469 );
470
471 _Success_(return != EOF)
472 _Check_return_opt_
473 _ACRTIMP int __cdecl _fclose_nolock(
474 _Inout_ FILE* _Stream
475 );
476
477 _Success_(return != EOF)
478 _Check_return_opt_
479 _ACRTIMP int __cdecl _fflush_nolock(
480 _Inout_opt_ FILE* _Stream
481 );
482
483 _Success_(return != EOF)
484 _Check_return_opt_
485 _ACRTIMP int __cdecl _fgetc_nolock(
486 _Inout_ FILE* _Stream
487 );
488
489 _Success_(return != EOF)
490 _Check_return_opt_
491 _ACRTIMP int __cdecl _fputc_nolock(
492 _In_ int _Character,
493 _Inout_ FILE* _Stream
494 );
495
496 _Check_return_opt_
497 _ACRTIMP size_t __cdecl _fread_nolock(
498 _Out_writes_bytes_(_ElementSize * _ElementCount) void* _Buffer,
499 _In_ size_t _ElementSize,
500 _In_ size_t _ElementCount,
501 _Inout_ FILE* _Stream
502 );
503
504 _Check_return_opt_
505 _Success_(return != 0)
506 _ACRTIMP size_t __cdecl _fread_nolock_s(
507 _Out_writes_bytes_to_(_BufferSize, _ElementSize * _ElementCount) void* _Buffer,
508 _In_range_(>=, _ElementSize * _ElementCount) size_t _BufferSize,
509 _In_ size_t _ElementSize,
510 _In_ size_t _ElementCount,
511 _Inout_ FILE* _Stream
512 );
513
514 _Check_return_opt_
515 _ACRTIMP int __cdecl _fseek_nolock(
516 _Inout_ FILE* _Stream,
517 _In_ long _Offset,
518 _In_ int _Origin
519 );
520
521 _Check_return_opt_
522 _ACRTIMP int __cdecl _fseeki64_nolock(
523 _Inout_ FILE* _Stream,
524 _In_ __int64 _Offset,
525 _In_ int _Origin
526 );
527
528 _Check_return_
529 _ACRTIMP long __cdecl _ftell_nolock(
530 _Inout_ FILE* _Stream
531 );
532
533 _Check_return_
534 _ACRTIMP __int64 __cdecl _ftelli64_nolock(
535 _Inout_ FILE* _Stream
536 );
537
538 _Check_return_opt_
539 _ACRTIMP size_t __cdecl _fwrite_nolock(
540 _In_reads_bytes_(_ElementSize * _ElementCount) void const* _Buffer,
541 _In_ size_t _ElementSize,
542 _In_ size_t _ElementCount,
543 _Inout_ FILE* _Stream
544 );
545
546 _Check_return_opt_
547 _ACRTIMP int __cdecl _getc_nolock(
548 _Inout_ FILE* _Stream
549 );
550
551 _Check_return_opt_
552 _ACRTIMP int __cdecl _putc_nolock(
553 _In_ int _Character,
554 _Inout_ FILE* _Stream
555 );
556
557 _Check_return_opt_
558 _ACRTIMP int __cdecl _ungetc_nolock(
559 _In_ int _Character,
560 _Inout_ FILE* _Stream
561 );
562
563 #define _getchar_nolock() _getc_nolock(stdin)
564 #define _putchar_nolock(_Ch) _putc_nolock(_Ch, stdout)
565 #define _getwchar_nolock() _getwc_nolock(stdin)
566 #define _putwchar_nolock(_Ch) _putwc_nolock(_Ch, stdout)
567
568
569
570 #if defined _CRT_DISABLE_PERFCRIT_LOCKS && !defined _DLL
571 #define fclose(_Stream) _fclose_nolock(_Stream)
572 #define fflush(_Stream) _fflush_nolock(_Stream)
573 #define fgetc(_Stream) _fgetc_nolock(_Stream)
574 #define fputc(_Ch, _Stream) _fputc_nolock(_Ch, _Stream)
575 #define fread(_DstBuf, _ElementSize, _Count, _Stream) _fread_nolock(_DstBuf, _ElementSize, _Count, _Stream)
576 #define fread_s(_DstBuf, _DstSize, _ElementSize, _Count, _Stream) _fread_nolock_s(_DstBuf, _DstSize, _ElementSize, _Count, _Stream)
577 #define fseek(_Stream, _Offset, _Origin) _fseek_nolock(_Stream, _Offset, _Origin)
578 #define _fseeki64(_Stream, _Offset, _Origin) _fseeki64_nolock(_Stream, _Offset, _Origin)
579 #define ftell(_Stream) _ftell_nolock(_Stream)
580 #define _ftelli64(_Stream) _ftelli64_nolock(_Stream)
581 #define fwrite(_SrcBuf, _ElementSize, _Count, _Stream) _fwrite_nolock(_SrcBuf, _ElementSize, _Count, _Stream)
582 #define getc(_Stream) _getc_nolock(_Stream)
583 #define putc(_Ch, _Stream) _putc_nolock(_Ch, _Stream)
584 #define ungetc(_Ch, _Stream) _ungetc_nolock(_Ch, _Stream)
585 #endif
586
587
588
589 _ACRTIMP int* __cdecl __p__commode(void);
590
591 #ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY
592 extern int _commode;
593 #else
594 #define _commode (*__p__commode())
595 #endif
596
597
598
599 // Variadic functions are not supported in managed code under /clr
600 #if defined _M_CEE_MIXED
601 #pragma managed(push, off)
602 #endif
603
604 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
605 //
606 // Narrow Character Formatted Output Functions (Stream)
607 //
608 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
609 _ACRTIMP int __cdecl __stdio_common_vfprintf(
610 _In_ unsigned __int64 _Options,
611 _Inout_ FILE* _Stream,
612 _In_z_ _Printf_format_string_params_(2) char const* _Format,
613 _In_opt_ _locale_t _Locale,
614 va_list _ArgList
615 );
616
617 _ACRTIMP int __cdecl __stdio_common_vfprintf_s(
618 _In_ unsigned __int64 _Options,
619 _Inout_ FILE* _Stream,
620 _In_z_ _Printf_format_string_params_(2) char const* _Format,
621 _In_opt_ _locale_t _Locale,
622 va_list _ArgList
623 );
624
625 _Success_(return >= 0)
626 _ACRTIMP int __cdecl __stdio_common_vfprintf_p(
627 _In_ unsigned __int64 _Options,
628 _Inout_ FILE* _Stream,
629 _In_z_ _Printf_format_string_params_(2) char const* _Format,
630 _In_opt_ _locale_t _Locale,
631 va_list _ArgList
632 );
633
634 _Check_return_opt_
635 _CRT_STDIO_INLINE int __CRTDECL _vfprintf_l(
636 _Inout_ FILE* const _Stream,
637 _In_z_ char const* const _Format,
638 _In_opt_ _locale_t const _Locale,
639 va_list _ArgList
640 )
641 #if defined _NO_CRT_STDIO_INLINE
642 ;
643 #else
644 {
645 return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList);
646 }
647 #endif
648
649 _Check_return_opt_
650 _CRT_STDIO_INLINE int __CRTDECL vfprintf(
651 _Inout_ FILE* const _Stream,
652 _In_z_ _Printf_format_string_ char const* const _Format,
653 va_list _ArgList
654 )
655 #if defined _NO_CRT_STDIO_INLINE
656 ;
657 #else
658 {
659 return _vfprintf_l(_Stream, _Format, NULL, _ArgList);
660 }
661 #endif
662
663 _Check_return_opt_
664 _CRT_STDIO_INLINE int __CRTDECL _vfprintf_s_l(
665 _Inout_ FILE* const _Stream,
666 _In_z_ char const* const _Format,
667 _In_opt_ _locale_t const _Locale,
668 va_list _ArgList
669 )
670 #if defined _NO_CRT_STDIO_INLINE
671 ;
672 #else
673 {
674 return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList);
675 }
676 #endif
677
678 #if __STDC_WANT_SECURE_LIB__
679
680 _Check_return_opt_
681 _CRT_STDIO_INLINE int __CRTDECL vfprintf_s(
682 _Inout_ FILE* const _Stream,
683 _In_z_ _Printf_format_string_ char const* const _Format,
684 va_list _ArgList
685 )
686 #if defined _NO_CRT_STDIO_INLINE
687 ;
688 #else
689 {
690 return _vfprintf_s_l(_Stream, _Format, NULL, _ArgList);
691 }
692 #endif
693
694 #endif
695
696 _Check_return_opt_
697 _CRT_STDIO_INLINE int __CRTDECL _vfprintf_p_l(
698 _Inout_ FILE* const _Stream,
699 _In_z_ char const* const _Format,
700 _In_opt_ _locale_t const _Locale,
701 va_list _ArgList
702 )
703 #if defined _NO_CRT_STDIO_INLINE
704 ;
705 #else
706 {
707 return __stdio_common_vfprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList);
708 }
709 #endif
710
711 _Check_return_opt_
712 _CRT_STDIO_INLINE int __CRTDECL _vfprintf_p(
713 _Inout_ FILE* const _Stream,
714 _In_z_ _Printf_format_string_ char const* const _Format,
715 va_list _ArgList
716 )
717 #if defined _NO_CRT_STDIO_INLINE
718 ;
719 #else
720 {
721 return _vfprintf_p_l(_Stream, _Format, NULL, _ArgList);
722 }
723 #endif
724
725 _Check_return_opt_
726 _CRT_STDIO_INLINE int __CRTDECL _vprintf_l(
727 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
728 _In_opt_ _locale_t const _Locale,
729 va_list _ArgList
730 )
731 #if defined _NO_CRT_STDIO_INLINE
732 ;
733 #else
734 {
735 return _vfprintf_l(stdout, _Format, _Locale, _ArgList);
736 }
737 #endif
738
739 _Check_return_opt_
740 _CRT_STDIO_INLINE int __CRTDECL vprintf(
741 _In_z_ _Printf_format_string_ char const* const _Format,
742 va_list _ArgList
743 )
744 #if defined _NO_CRT_STDIO_INLINE
745 ;
746 #else
747 {
748 return _vfprintf_l(stdout, _Format, NULL, _ArgList);
749 }
750 #endif
751
752 _Check_return_opt_
753 _CRT_STDIO_INLINE int __CRTDECL _vprintf_s_l(
754 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
755 _In_opt_ _locale_t const _Locale,
756 va_list _ArgList
757 )
758 #if defined _NO_CRT_STDIO_INLINE
759 ;
760 #else
761 {
762 return _vfprintf_s_l(stdout, _Format, _Locale, _ArgList);
763 }
764 #endif
765
766 #if __STDC_WANT_SECURE_LIB__
767
768 _Check_return_opt_
769 _CRT_STDIO_INLINE int __CRTDECL vprintf_s(
770 _In_z_ _Printf_format_string_ char const* const _Format,
771 va_list _ArgList
772 )
773 #if defined _NO_CRT_STDIO_INLINE
774 ;
775 #else
776 {
777 return _vfprintf_s_l(stdout, _Format, NULL, _ArgList);
778 }
779 #endif
780
781 #endif
782
783 _Check_return_opt_
784 _CRT_STDIO_INLINE int __CRTDECL _vprintf_p_l(
785 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
786 _In_opt_ _locale_t const _Locale,
787 va_list _ArgList
788 )
789 #if defined _NO_CRT_STDIO_INLINE
790 ;
791 #else
792 {
793 return _vfprintf_p_l(stdout, _Format, _Locale, _ArgList);
794 }
795 #endif
796
797 _Check_return_opt_
798 _CRT_STDIO_INLINE int __CRTDECL _vprintf_p(
799 _In_z_ _Printf_format_string_ char const* const _Format,
800 va_list _ArgList
801 )
802 #if defined _NO_CRT_STDIO_INLINE
803 ;
804 #else
805 {
806 return _vfprintf_p_l(stdout, _Format, NULL, _ArgList);
807 }
808 #endif
809
810 _Check_return_opt_
811 _CRT_STDIO_INLINE int __CRTDECL _fprintf_l(
812 _Inout_ FILE* const _Stream,
813 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
814 _In_opt_ _locale_t const _Locale,
815 ...)
816 #if defined _NO_CRT_STDIO_INLINE
817 ;
818 #else
819 {
820 int _Result;
821 va_list _ArgList;
822 __crt_va_start(_ArgList, _Locale);
823 _Result = _vfprintf_l(_Stream, _Format, _Locale, _ArgList);
824 __crt_va_end(_ArgList);
825 return _Result;
826 }
827 #endif
828
829 _Check_return_opt_
830 _CRT_STDIO_INLINE int __CRTDECL fprintf(
831 _Inout_ FILE* const _Stream,
832 _In_z_ _Printf_format_string_ char const* const _Format,
833 ...)
834 #if defined _NO_CRT_STDIO_INLINE
835 ;
836 #else
837 {
838 int _Result;
839 va_list _ArgList;
840 __crt_va_start(_ArgList, _Format);
841 _Result = _vfprintf_l(_Stream, _Format, NULL, _ArgList);
842 __crt_va_end(_ArgList);
843 return _Result;
844 }
845 #endif
846
847 _ACRTIMP int __cdecl _set_printf_count_output(
848 _In_ int _Value
849 );
850
851 _ACRTIMP int __cdecl _get_printf_count_output(void);
852
853 _Check_return_opt_
854 _CRT_STDIO_INLINE int __CRTDECL _fprintf_s_l(
855 _Inout_ FILE* const _Stream,
856 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
857 _In_opt_ _locale_t const _Locale,
858 ...)
859 #if defined _NO_CRT_STDIO_INLINE
860 ;
861 #else
862 {
863 int _Result;
864 va_list _ArgList;
865 __crt_va_start(_ArgList, _Locale);
866 _Result = _vfprintf_s_l(_Stream, _Format, _Locale, _ArgList);
867 __crt_va_end(_ArgList);
868 return _Result;
869 }
870 #endif
871
872 #if __STDC_WANT_SECURE_LIB__
873
874 _Check_return_opt_
875 _CRT_STDIO_INLINE int __CRTDECL fprintf_s(
876 _Inout_ FILE* const _Stream,
877 _In_z_ _Printf_format_string_ char const* const _Format,
878 ...)
879 #if defined _NO_CRT_STDIO_INLINE
880 ;
881 #else
882 {
883 int _Result;
884 va_list _ArgList;
885 __crt_va_start(_ArgList, _Format);
886 _Result = _vfprintf_s_l(_Stream, _Format, NULL, _ArgList);
887 __crt_va_end(_ArgList);
888 return _Result;
889 }
890 #endif
891
892 #endif
893
894 _Check_return_opt_
895 _CRT_STDIO_INLINE int __CRTDECL _fprintf_p_l(
896 _Inout_ FILE* const _Stream,
897 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
898 _In_opt_ _locale_t const _Locale,
899 ...)
900 #if defined _NO_CRT_STDIO_INLINE
901 ;
902 #else
903 {
904 int _Result;
905 va_list _ArgList;
906 __crt_va_start(_ArgList, _Locale);
907 _Result = _vfprintf_p_l(_Stream, _Format, _Locale, _ArgList);
908 __crt_va_end(_ArgList);
909 return _Result;
910 }
911 #endif
912
913 _Check_return_opt_
914 _CRT_STDIO_INLINE int __CRTDECL _fprintf_p(
915 _Inout_ FILE* const _Stream,
916 _In_z_ _Printf_format_string_ char const* const _Format,
917 ...)
918 #if defined _NO_CRT_STDIO_INLINE
919 ;
920 #else
921 {
922 int _Result;
923 va_list _ArgList;
924 __crt_va_start(_ArgList, _Format);
925 _Result = _vfprintf_p_l(_Stream, _Format, NULL, _ArgList);
926 __crt_va_end(_ArgList);
927 return _Result;
928 }
929 #endif
930
931 _Check_return_opt_
932 _CRT_STDIO_INLINE int __CRTDECL _printf_l(
933 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
934 _In_opt_ _locale_t const _Locale,
935 ...)
936 #if defined _NO_CRT_STDIO_INLINE
937 ;
938 #else
939 {
940 int _Result;
941 va_list _ArgList;
942 __crt_va_start(_ArgList, _Locale);
943 _Result = _vfprintf_l(stdout, _Format, _Locale, _ArgList);
944 __crt_va_end(_ArgList);
945 return _Result;
946 }
947 #endif
948
949 _Check_return_opt_
950 _CRT_STDIO_INLINE int __CRTDECL printf(
951 _In_z_ _Printf_format_string_ char const* const _Format,
952 ...)
953 #if defined _NO_CRT_STDIO_INLINE
954 ;
955 #else
956 {
957 int _Result;
958 va_list _ArgList;
959 __crt_va_start(_ArgList, _Format);
960 _Result = _vfprintf_l(stdout, _Format, NULL, _ArgList);
961 __crt_va_end(_ArgList);
962 return _Result;
963 }
964 #endif
965
966 _Check_return_opt_
967 _CRT_STDIO_INLINE int __CRTDECL _printf_s_l(
968 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
969 _In_opt_ _locale_t const _Locale,
970 ...)
971 #if defined _NO_CRT_STDIO_INLINE
972 ;
973 #else
974 {
975 int _Result;
976 va_list _ArgList;
977 __crt_va_start(_ArgList, _Locale);
978 _Result = _vfprintf_s_l(stdout, _Format, _Locale, _ArgList);
979 __crt_va_end(_ArgList);
980 return _Result;
981 }
982 #endif
983
984 #if __STDC_WANT_SECURE_LIB__
985
986 _Check_return_opt_
987 _CRT_STDIO_INLINE int __CRTDECL printf_s(
988 _In_z_ _Printf_format_string_ char const* const _Format,
989 ...)
990 #if defined _NO_CRT_STDIO_INLINE
991 ;
992 #else
993 {
994 int _Result;
995 va_list _ArgList;
996 __crt_va_start(_ArgList, _Format);
997 _Result = _vfprintf_s_l(stdout, _Format, NULL, _ArgList);
998 __crt_va_end(_ArgList);
999 return _Result;
1000 }
1001 #endif
1002
1003 #endif
1004
1005 _Check_return_opt_
1006 _CRT_STDIO_INLINE int __CRTDECL _printf_p_l(
1007 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
1008 _In_opt_ _locale_t const _Locale,
1009 ...)
1010 #if defined _NO_CRT_STDIO_INLINE
1011 ;
1012 #else
1013 {
1014 int _Result;
1015 va_list _ArgList;
1016 __crt_va_start(_ArgList, _Locale);
1017 _Result = _vfprintf_p_l(stdout, _Format, _Locale, _ArgList);
1018 __crt_va_end(_ArgList);
1019 return _Result;
1020 }
1021 #endif
1022
1023 _Check_return_opt_
1024 _CRT_STDIO_INLINE int __CRTDECL _printf_p(
1025 _In_z_ _Printf_format_string_ char const* const _Format,
1026 ...)
1027 #if defined _NO_CRT_STDIO_INLINE
1028 ;
1029 #else
1030 {
1031 int _Result;
1032 va_list _ArgList;
1033 __crt_va_start(_ArgList, _Format);
1034 _Result = _vfprintf_p_l(stdout, _Format, NULL, _ArgList);
1035 __crt_va_end(_ArgList);
1036 return _Result;
1037 }
1038 #endif
1039
1040
1041 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1042 //
1043 // Narrow Character Formatted Input Functions (Stream)
1044 //
1045 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1046 _ACRTIMP int __cdecl __stdio_common_vfscanf(
1047 _In_ unsigned __int64 _Options,
1048 _Inout_ FILE* _Stream,
1049 _In_z_ _Scanf_format_string_params_(2) char const* _Format,
1050 _In_opt_ _locale_t _Locale,
1051 va_list _Arglist
1052 );
1053
1054 _Check_return_opt_
1055 _CRT_STDIO_INLINE int __CRTDECL _vfscanf_l(
1056 _Inout_ FILE* const _Stream,
1057 _In_z_ _Printf_format_string_ char const* const _Format,
1058 _In_opt_ _locale_t const _Locale,
1059 va_list _ArgList
1060 )
1061 #if defined _NO_CRT_STDIO_INLINE
1062 ;
1063 #else
1064 {
1065 return __stdio_common_vfscanf(
1066 _CRT_INTERNAL_LOCAL_SCANF_OPTIONS,
1067 _Stream, _Format, _Locale, _ArgList);
1068 }
1069 #endif
1070
1071 _Check_return_opt_
1072 _CRT_STDIO_INLINE int __CRTDECL vfscanf(
1073 _Inout_ FILE* const _Stream,
1074 _In_z_ _Printf_format_string_ char const* const _Format,
1075 va_list _ArgList
1076 )
1077 #if defined _NO_CRT_STDIO_INLINE
1078 ;
1079 #else
1080 {
1081 return _vfscanf_l(_Stream, _Format, NULL, _ArgList);
1082 }
1083 #endif
1084
1085 _Check_return_opt_
1086 _CRT_STDIO_INLINE int __CRTDECL _vfscanf_s_l(
1087 _Inout_ FILE* const _Stream,
1088 _In_z_ _Printf_format_string_ char const* const _Format,
1089 _In_opt_ _locale_t const _Locale,
1090 va_list _ArgList
1091 )
1092 #if defined _NO_CRT_STDIO_INLINE
1093 ;
1094 #else
1095 {
1096 return __stdio_common_vfscanf(
1097 _CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT,
1098 _Stream, _Format, _Locale, _ArgList);
1099 }
1100 #endif
1101
1102
1103 #if __STDC_WANT_SECURE_LIB__
1104
1105 _Check_return_opt_
1106 _CRT_STDIO_INLINE int __CRTDECL vfscanf_s(
1107 _Inout_ FILE* const _Stream,
1108 _In_z_ _Printf_format_string_ char const* const _Format,
1109 va_list _ArgList
1110 )
1111 #if defined _NO_CRT_STDIO_INLINE
1112 ;
1113 #else
1114 {
1115 return _vfscanf_s_l(_Stream, _Format, NULL, _ArgList);
1116 }
1117 #endif
1118
1119 #endif
1120
1121 _Check_return_opt_
1122 _CRT_STDIO_INLINE int __CRTDECL _vscanf_l(
1123 _In_z_ _Printf_format_string_ char const* const _Format,
1124 _In_opt_ _locale_t const _Locale,
1125 va_list _ArgList
1126 )
1127 #if defined _NO_CRT_STDIO_INLINE
1128 ;
1129 #else
1130 {
1131 return _vfscanf_l(stdin, _Format, _Locale, _ArgList);
1132 }
1133 #endif
1134
1135 _Check_return_opt_
1136 _CRT_STDIO_INLINE int __CRTDECL vscanf(
1137 _In_z_ _Printf_format_string_ char const* const _Format,
1138 va_list _ArgList
1139 )
1140 #if defined _NO_CRT_STDIO_INLINE
1141 ;
1142 #else
1143 {
1144 return _vfscanf_l(stdin, _Format, NULL, _ArgList);
1145 }
1146 #endif
1147
1148 _Check_return_opt_
1149 _CRT_STDIO_INLINE int __CRTDECL _vscanf_s_l(
1150 _In_z_ _Printf_format_string_ char const* const _Format,
1151 _In_opt_ _locale_t const _Locale,
1152 va_list _ArgList
1153 )
1154 #if defined _NO_CRT_STDIO_INLINE
1155 ;
1156 #else
1157 {
1158 return _vfscanf_s_l(stdin, _Format, _Locale, _ArgList);
1159 }
1160 #endif
1161
1162 #if __STDC_WANT_SECURE_LIB__
1163
1164 _Check_return_opt_
1165 _CRT_STDIO_INLINE int __CRTDECL vscanf_s(
1166 _In_z_ _Printf_format_string_ char const* const _Format,
1167 va_list _ArgList
1168 )
1169 #if defined _NO_CRT_STDIO_INLINE
1170 ;
1171 #else
1172 {
1173 return _vfscanf_s_l(stdin, _Format, NULL, _ArgList);
1174 }
1175 #endif
1176
1177 #endif
1178
1179 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_fscanf_s_l)
1180 _CRT_STDIO_INLINE int __CRTDECL _fscanf_l(
1181 _Inout_ FILE* const _Stream,
1182 _In_z_ _Scanf_format_string_params_(0) char const* const _Format,
1183 _In_opt_ _locale_t const _Locale,
1184 ...)
1185 #if defined _NO_CRT_STDIO_INLINE // SCANF
1186 ;
1187 #else
1188 {
1189 int _Result;
1190 va_list _ArgList;
1191 __crt_va_start(_ArgList, _Locale);
1192 _Result = _vfscanf_l(_Stream, _Format, _Locale, _ArgList);
1193 __crt_va_end(_ArgList);
1194 return _Result;
1195 }
1196 #endif
1197
1198 _Check_return_ _CRT_INSECURE_DEPRECATE(fscanf_s)
1199 _CRT_STDIO_INLINE int __CRTDECL fscanf(
1200 _Inout_ FILE* const _Stream,
1201 _In_z_ _Scanf_format_string_ char const* const _Format,
1202 ...)
1203 #if defined _NO_CRT_STDIO_INLINE // SCANF
1204 ;
1205 #else
1206 {
1207 int _Result;
1208 va_list _ArgList;
1209 __crt_va_start(_ArgList, _Format);
1210 _Result = _vfscanf_l(_Stream, _Format, NULL, _ArgList);
1211 __crt_va_end(_ArgList);
1212 return _Result;
1213 }
1214 #endif
1215
1216 _Check_return_opt_
1217 _CRT_STDIO_INLINE int __CRTDECL _fscanf_s_l(
1218 _Inout_ FILE* const _Stream,
1219 _In_z_ _Scanf_s_format_string_params_(0) char const* const _Format,
1220 _In_opt_ _locale_t const _Locale,
1221 ...)
1222 #if defined _NO_CRT_STDIO_INLINE // SCANF
1223 ;
1224 #else
1225 {
1226 int _Result;
1227 va_list _ArgList;
1228 __crt_va_start(_ArgList, _Locale);
1229 _Result = _vfscanf_s_l(_Stream, _Format, _Locale, _ArgList);
1230 __crt_va_end(_ArgList);
1231 return _Result;
1232 }
1233 #endif
1234
1235 #if __STDC_WANT_SECURE_LIB__
1236
1237 _Check_return_opt_
1238 _CRT_STDIO_INLINE int __CRTDECL fscanf_s(
1239 _Inout_ FILE* const _Stream,
1240 _In_z_ _Scanf_s_format_string_ char const* const _Format,
1241 ...)
1242 #if defined _NO_CRT_STDIO_INLINE // SCANF
1243 ;
1244 #else
1245 {
1246 int _Result;
1247 va_list _ArgList;
1248 __crt_va_start(_ArgList, _Format);
1249 _Result = _vfscanf_s_l(_Stream, _Format, NULL, _ArgList);
1250 __crt_va_end(_ArgList);
1251 return _Result;
1252 }
1253 #endif
1254
1255 #endif
1256
1257 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_scanf_s_l)
1258 _CRT_STDIO_INLINE int __CRTDECL _scanf_l(
1259 _In_z_ _Scanf_format_string_params_(0) char const* const _Format,
1260 _In_opt_ _locale_t const _Locale,
1261 ...)
1262 #if defined _NO_CRT_STDIO_INLINE // SCANF
1263 ;
1264 #else
1265 {
1266 int _Result;
1267 va_list _ArgList;
1268 __crt_va_start(_ArgList, _Locale);
1269 _Result = _vfscanf_l(stdin, _Format, _Locale, _ArgList);
1270 __crt_va_end(_ArgList);
1271 return _Result;
1272 }
1273 #endif
1274
1275 _Check_return_ _CRT_INSECURE_DEPRECATE(scanf_s)
1276 _CRT_STDIO_INLINE int __CRTDECL scanf(
1277 _In_z_ _Scanf_format_string_ char const* const _Format,
1278 ...)
1279 #if defined _NO_CRT_STDIO_INLINE // SCANF
1280 ;
1281 #else
1282 {
1283 int _Result;
1284 va_list _ArgList;
1285 __crt_va_start(_ArgList, _Format);
1286 _Result = _vfscanf_l(stdin, _Format, NULL, _ArgList);
1287 __crt_va_end(_ArgList);
1288 return _Result;
1289 }
1290 #endif
1291
1292 _Check_return_opt_
1293 _CRT_STDIO_INLINE int __CRTDECL _scanf_s_l(
1294 _In_z_ _Scanf_s_format_string_params_(0) char const* const _Format,
1295 _In_opt_ _locale_t const _Locale,
1296 ...)
1297 #if defined _NO_CRT_STDIO_INLINE // SCANF
1298 ;
1299 #else
1300 {
1301 int _Result;
1302 va_list _ArgList;
1303 __crt_va_start(_ArgList, _Locale);
1304 _Result = _vfscanf_s_l(stdin, _Format, _Locale, _ArgList);
1305 __crt_va_end(_ArgList);
1306 return _Result;
1307 }
1308 #endif
1309
1310 #if __STDC_WANT_SECURE_LIB__
1311
1312 _Check_return_opt_
1313 _CRT_STDIO_INLINE int __CRTDECL scanf_s(
1314 _In_z_ _Scanf_s_format_string_ char const* const _Format,
1315 ...)
1316 #if defined _NO_CRT_STDIO_INLINE // SCANF
1317 ;
1318 #else
1319 {
1320 int _Result;
1321 va_list _ArgList;
1322 __crt_va_start(_ArgList, _Format);
1323 _Result = _vfscanf_s_l(stdin, _Format, NULL, _ArgList);
1324 __crt_va_end(_ArgList);
1325 return _Result;
1326 }
1327 #endif
1328
1329 #endif
1330
1331
1332
1333 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1334 //
1335 // Narrow Character Formatted Output Functions (String)
1336 //
1337 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1338 _Success_(return >= 0)
1339 _ACRTIMP int __cdecl __stdio_common_vsprintf(
1340 _In_ unsigned __int64 _Options,
1341 _Out_writes_opt_z_(_BufferCount) char* _Buffer,
1342 _In_ size_t _BufferCount,
1343 _In_z_ _Printf_format_string_params_(2) char const* _Format,
1344 _In_opt_ _locale_t _Locale,
1345 va_list _ArgList
1346 );
1347
1348 _Success_(return >= 0)
1349 _ACRTIMP int __cdecl __stdio_common_vsprintf_s(
1350 _In_ unsigned __int64 _Options,
1351 _Out_writes_z_(_BufferCount) char* _Buffer,
1352 _In_ size_t _BufferCount,
1353 _In_z_ _Printf_format_string_params_(2) char const* _Format,
1354 _In_opt_ _locale_t _Locale,
1355 va_list _ArgList
1356 );
1357
1358 _Success_(return >= 0)
1359 _ACRTIMP int __cdecl __stdio_common_vsnprintf_s(
1360 _In_ unsigned __int64 _Options,
1361 _Out_writes_opt_z_(_BufferCount) char* _Buffer,
1362 _In_ size_t _BufferCount,
1363 _In_ size_t _MaxCount,
1364 _In_z_ _Printf_format_string_params_(2) char const* _Format,
1365 _In_opt_ _locale_t _Locale,
1366 va_list _ArgList
1367 );
1368
1369 _Success_(return >= 0)
1370 _ACRTIMP int __cdecl __stdio_common_vsprintf_p(
1371 _In_ unsigned __int64 _Options,
1372 _Out_writes_z_(_BufferCount) char* _Buffer,
1373 _In_ size_t _BufferCount,
1374 _In_z_ _Printf_format_string_params_(2) char const* _Format,
1375 _In_opt_ _locale_t _Locale,
1376 va_list _ArgList
1377 );
1378
1379 _Success_(return >= 0)
1380 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_vsnprintf_s_l)
1381 _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_l(
1382 _Out_writes_opt_(_BufferCount) _Post_maybez_ char* const _Buffer,
1383 _In_ size_t const _BufferCount,
1384 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
1385 _In_opt_ _locale_t const _Locale,
1386 va_list _ArgList
1387 )
1388 #if defined _NO_CRT_STDIO_INLINE
1389 ;
1390 #else
1391 {
1392 int const _Result = __stdio_common_vsprintf(
1393 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
1394 _Buffer, _BufferCount, _Format, _Locale, _ArgList);
1395
1396 return _Result < 0 ? -1 : _Result;
1397 }
1398 #endif
1399
1400 _Success_(return >= 0)
1401 _Check_return_opt_
1402 _CRT_STDIO_INLINE int __CRTDECL _vsnprintf(
1403 _Out_writes_opt_(_BufferCount) _Post_maybez_ char* const _Buffer,
1404 _In_ size_t const _BufferCount,
1405 _In_z_ _Printf_format_string_ char const* const _Format,
1406 va_list _ArgList
1407 )
1408 #if defined _NO_CRT_STDIO_INLINE
1409 ;
1410 #else
1411 {
1412 return _vsnprintf_l(_Buffer, _BufferCount, _Format, NULL, _ArgList);
1413 }
1414 #endif
1415
1416 #if defined vsnprintf
1417 // This definition of vsnprintf will generate "warning C4005: 'vsnprintf': macro
1418 // redefinition" with a subsequent line indicating where the previous definition
1419 // of vsnprintf was. This makes it easier to find where vsnprintf was defined.
1420 #pragma warning(push, 1)
1421 #pragma warning(1: 4005) // macro redefinition
1422 #define vsnprintf Do not define vsnprintf as a macro
1423 #pragma warning(pop)
1424 #error Macro definition of vsnprintf conflicts with Standard Library function declaration
1425 #endif
1426
1427 _Success_(return >= 0)
1428 _Check_return_opt_
1429 _CRT_STDIO_INLINE int __CRTDECL vsnprintf(
1430 _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1431 _In_ size_t const _BufferCount,
1432 _In_z_ _Printf_format_string_ char const* const _Format,
1433 va_list _ArgList
1434 )
1435 #if defined _NO_CRT_STDIO_INLINE
1436 ;
1437 #else
1438 {
1439 int const _Result = __stdio_common_vsprintf(
1440 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
1441 _Buffer, _BufferCount, _Format, NULL, _ArgList);
1442
1443 return _Result < 0 ? -1 : _Result;
1444 }
1445 #endif
1446
1447 _Success_(return >= 0)
1448 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_vsprintf_s_l)
1449 _CRT_STDIO_INLINE int __CRTDECL _vsprintf_l(
1450 _Pre_notnull_ _Always_(_Post_z_) char* const _Buffer,
1451 _In_z_ char const* const _Format,
1452 _In_opt_ _locale_t const _Locale,
1453 va_list _ArgList
1454 )
1455 #if defined _NO_CRT_STDIO_INLINE
1456 ;
1457 #else
1458 {
1459 return _vsnprintf_l(_Buffer, (size_t)-1, _Format, _Locale, _ArgList);
1460 }
1461 #endif
1462
1463 _Success_(return >= 0)
1464 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(vsprintf_s)
1465 _CRT_STDIO_INLINE int __CRTDECL vsprintf(
1466 _Pre_notnull_ _Always_(_Post_z_) char* const _Buffer,
1467 _In_z_ _Printf_format_string_ char const* const _Format,
1468 va_list _ArgList
1469 )
1470 #if defined _NO_CRT_STDIO_INLINE
1471 ;
1472 #else
1473 {
1474 return _vsnprintf_l(_Buffer, (size_t)-1, _Format, NULL, _ArgList);
1475 }
1476 #endif
1477
1478 _Success_(return >= 0)
1479 _Check_return_opt_
1480 _CRT_STDIO_INLINE int __CRTDECL _vsprintf_s_l(
1481 _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1482 _In_ size_t const _BufferCount,
1483 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
1484 _In_opt_ _locale_t const _Locale,
1485 va_list _ArgList
1486 )
1487 #if defined _NO_CRT_STDIO_INLINE
1488 ;
1489 #else
1490 {
1491 int const _Result = __stdio_common_vsprintf_s(
1492 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS,
1493 _Buffer, _BufferCount, _Format, _Locale, _ArgList);
1494
1495 return _Result < 0 ? -1 : _Result;
1496 }
1497 #endif
1498
1499 #if __STDC_WANT_SECURE_LIB__
1500
1501 _Success_(return >= 0)
1502 _Check_return_opt_
1503 _CRT_STDIO_INLINE int __CRTDECL vsprintf_s(
1504 _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1505 _In_ size_t const _BufferCount,
1506 _In_z_ _Printf_format_string_ char const* const _Format,
1507 va_list _ArgList
1508 )
1509 #if defined _NO_CRT_STDIO_INLINE
1510 ;
1511 #else
1512 {
1513 return _vsprintf_s_l(_Buffer, _BufferCount, _Format, NULL, _ArgList);
1514 }
1515 #endif
1516
1517 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2(
1518 _Success_(return >= 0)
1519 int, vsprintf_s,
1520 _Always_(_Post_z_) char, _Buffer,
1521 _In_z_ _Printf_format_string_ char const*, _Format,
1522 va_list, _ArgList
1523 )
1524
1525 #endif
1526
1527 _Success_(return >= 0)
1528 _Check_return_opt_
1529 _CRT_STDIO_INLINE int __CRTDECL _vsprintf_p_l(
1530 _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1531 _In_ size_t const _BufferCount,
1532 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
1533 _In_opt_ _locale_t const _Locale,
1534 va_list _ArgList
1535 )
1536 #if defined _NO_CRT_STDIO_INLINE
1537 ;
1538 #else
1539 {
1540 int const _Result = __stdio_common_vsprintf_p(
1541 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS,
1542 _Buffer, _BufferCount, _Format, _Locale, _ArgList);
1543
1544 return _Result < 0 ? -1 : _Result;
1545 }
1546 #endif
1547
1548 _Success_(return >= 0)
1549 _Check_return_opt_
1550 _CRT_STDIO_INLINE int __CRTDECL _vsprintf_p(
1551 _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1552 _In_ size_t const _BufferCount,
1553 _In_z_ _Printf_format_string_ char const* const _Format,
1554 va_list _ArgList
1555 )
1556 #if defined _NO_CRT_STDIO_INLINE
1557 ;
1558 #else
1559 {
1560 return _vsprintf_p_l(_Buffer, _BufferCount, _Format, NULL, _ArgList);
1561 }
1562 #endif
1563
1564 _Success_(return >= 0)
1565 _Check_return_opt_
1566 _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_s_l(
1567 _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1568 _In_ size_t const _BufferCount,
1569 _In_ size_t const _MaxCount,
1570 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
1571 _In_opt_ _locale_t const _Locale,
1572 va_list _ArgList
1573 )
1574 #if defined _NO_CRT_STDIO_INLINE
1575 ;
1576 #else
1577 {
1578 int const _Result = __stdio_common_vsnprintf_s(
1579 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS,
1580 _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);
1581
1582 return _Result < 0 ? -1 : _Result;
1583 }
1584 #endif
1585
1586 _Success_(return >= 0)
1587 _Check_return_opt_
1588 _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_s(
1589 _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1590 _In_ size_t const _BufferCount,
1591 _In_ size_t const _MaxCount,
1592 _In_z_ _Printf_format_string_ char const* const _Format,
1593 va_list _ArgList
1594 )
1595 #if defined _NO_CRT_STDIO_INLINE
1596 ;
1597 #else
1598 {
1599 return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, NULL, _ArgList);
1600 }
1601 #endif
1602
1603 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_3(
1604 _Success_(return >= 0)
1605 int, _vsnprintf_s,
1606 _Always_(_Post_z_) char, _Buffer,
1607 _In_ size_t, _BufferCount,
1608 _In_z_ _Printf_format_string_ char const*, _Format,
1609 va_list, _ArgList
1610 )
1611
1612 #if __STDC_WANT_SECURE_LIB__
1613
1614 _Success_(return >= 0)
1615 _Check_return_opt_
1616 _CRT_STDIO_INLINE int __CRTDECL vsnprintf_s(
1617 _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1618 _In_ size_t const _BufferCount,
1619 _In_ size_t const _MaxCount,
1620 _In_z_ _Printf_format_string_ char const* const _Format,
1621 va_list _ArgList
1622 )
1623 #if defined _NO_CRT_STDIO_INLINE
1624 ;
1625 #else
1626 {
1627 return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, NULL, _ArgList);
1628 }
1629 #endif
1630
1631 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_3(
1632 _Success_(return >= 0)
1633 int, vsnprintf_s,
1634 _Always_(_Post_z_) char, _Buffer,
1635 _In_ size_t, _BufferCount,
1636 _In_z_ _Printf_format_string_ char const*, _Format,
1637 va_list, _ArgList
1638 )
1639
1640 #endif
1641
1642 _Check_return_opt_
1643 _CRT_STDIO_INLINE int __CRTDECL _vscprintf_l(
1644 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
1645 _In_opt_ _locale_t const _Locale,
1646 va_list _ArgList
1647 )
1648 #if defined _NO_CRT_STDIO_INLINE
1649 ;
1650 #else
1651 {
1652 int const _Result = __stdio_common_vsprintf(
1653 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
1654 NULL, 0, _Format, _Locale, _ArgList);
1655
1656 return _Result < 0 ? -1 : _Result;
1657 }
1658 #endif
1659
1660 _Check_return_
1661 _CRT_STDIO_INLINE int __CRTDECL _vscprintf(
1662 _In_z_ _Printf_format_string_ char const* const _Format,
1663 va_list _ArgList
1664 )
1665 #if defined _NO_CRT_STDIO_INLINE
1666 ;
1667 #else
1668 {
1669 return _vscprintf_l(_Format, NULL, _ArgList);
1670 }
1671 #endif
1672
1673 _Check_return_opt_
1674 _CRT_STDIO_INLINE int __CRTDECL _vscprintf_p_l(
1675 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
1676 _In_opt_ _locale_t const _Locale,
1677 va_list _ArgList
1678 )
1679 #if defined _NO_CRT_STDIO_INLINE
1680 ;
1681 #else
1682 {
1683 int const _Result = __stdio_common_vsprintf_p(
1684 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
1685 NULL, 0, _Format, _Locale, _ArgList);
1686
1687 return _Result < 0 ? -1 : _Result;
1688 }
1689 #endif
1690
1691 _Check_return_
1692 _CRT_STDIO_INLINE int __CRTDECL _vscprintf_p(
1693 _In_z_ _Printf_format_string_ char const* const _Format,
1694 va_list _ArgList
1695 )
1696 #if defined _NO_CRT_STDIO_INLINE
1697 ;
1698 #else
1699 {
1700 return _vscprintf_p_l(_Format, NULL, _ArgList);
1701 }
1702 #endif
1703
1704 _Check_return_opt_
1705 _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_c_l(
1706 _Out_writes_opt_(_BufferCount) char* const _Buffer,
1707 _In_ size_t const _BufferCount,
1708 _In_z_ _Printf_format_string_params_(2) char const* const _Format,
1709 _In_opt_ _locale_t const _Locale,
1710 va_list _ArgList
1711 )
1712 #if defined _NO_CRT_STDIO_INLINE
1713 ;
1714 #else
1715 {
1716 int const _Result = __stdio_common_vsprintf(
1717 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS,
1718 _Buffer, _BufferCount, _Format, _Locale, _ArgList);
1719
1720 return _Result < 0 ? -1 : _Result;
1721 }
1722 #endif
1723
1724 _Success_(return >= 0)
1725 _Check_return_opt_
1726 _CRT_STDIO_INLINE int __CRTDECL _vsnprintf_c(
1727 _Out_writes_opt_(_BufferCount) char* const _Buffer,
1728 _In_ size_t const _BufferCount,
1729 _In_z_ _Printf_format_string_ char const* const _Format,
1730 va_list _ArgList
1731 )
1732 #if defined _NO_CRT_STDIO_INLINE
1733 ;
1734 #else
1735 {
1736 return _vsnprintf_c_l(_Buffer, _BufferCount, _Format, NULL, _ArgList);
1737 }
1738 #endif
1739
1740 _Success_(return >= 0)
1741 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_sprintf_s_l)
1742 _CRT_STDIO_INLINE int __CRTDECL _sprintf_l(
1743 _Pre_notnull_ _Always_(_Post_z_) char* const _Buffer,
1744 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
1745 _In_opt_ _locale_t const _Locale,
1746 ...)
1747 #if defined _NO_CRT_STDIO_INLINE
1748 ;
1749 #else
1750 {
1751 int _Result;
1752 va_list _ArgList;
1753 __crt_va_start(_ArgList, _Locale);
1754
1755 _Result = _vsprintf_l(_Buffer, _Format, _Locale, _ArgList);
1756
1757 __crt_va_end(_ArgList);
1758 return _Result;
1759 }
1760 #endif
1761
1762 _Success_(return >= 0)
1763 _Check_return_opt_
1764 _CRT_STDIO_INLINE int __CRTDECL sprintf(
1765 _Pre_notnull_ _Always_(_Post_z_) char* const _Buffer,
1766 _In_z_ _Printf_format_string_ char const* const _Format,
1767 ...)
1768 #if defined _NO_CRT_STDIO_INLINE
1769 ;
1770 #else
1771 {
1772 int _Result;
1773 va_list _ArgList;
1774 __crt_va_start(_ArgList, _Format);
1775
1776 _Result = _vsprintf_l(_Buffer, _Format, NULL, _ArgList);
1777
1778 __crt_va_end(_ArgList);
1779 return _Result;
1780 }
1781 #endif
1782
1783 __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST(
1784 _Success_(return >= 0)
1785 int, __RETURN_POLICY_SAME, __EMPTY_DECLSPEC, __CRTDECL, sprintf, vsprintf,
1786 _Pre_notnull_ _Always_(_Post_z_), char, _Buffer,
1787 _In_z_ _Printf_format_string_ char const*, _Format
1788 )
1789
1790 _Success_(return >= 0)
1791 _Check_return_opt_
1792 _CRT_STDIO_INLINE int __CRTDECL _sprintf_s_l(
1793 _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1794 _In_ size_t const _BufferCount,
1795 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
1796 _In_opt_ _locale_t const _Locale,
1797 ...)
1798 #if defined _NO_CRT_STDIO_INLINE
1799 ;
1800 #else
1801 {
1802 int _Result;
1803 va_list _ArgList;
1804 __crt_va_start(_ArgList, _Locale);
1805 _Result = _vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);
1806 __crt_va_end(_ArgList);
1807 return _Result;
1808 }
1809 #endif
1810
1811 #if __STDC_WANT_SECURE_LIB__
1812
1813 _Success_(return >= 0)
1814 _Check_return_opt_
1815 _CRT_STDIO_INLINE int __CRTDECL sprintf_s(
1816 _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1817 _In_ size_t const _BufferCount,
1818 _In_z_ _Printf_format_string_ char const* const _Format,
1819 ...)
1820 #if defined _NO_CRT_STDIO_INLINE
1821 ;
1822 #else
1823 {
1824 int _Result;
1825 va_list _ArgList;
1826 __crt_va_start(_ArgList, _Format);
1827 _Result = _vsprintf_s_l(_Buffer, _BufferCount, _Format, NULL, _ArgList);
1828 __crt_va_end(_ArgList);
1829 return _Result;
1830 }
1831 #endif
1832
1833 #endif
1834
1835 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1_ARGLIST(
1836 _Success_(return >= 0)
1837 int, sprintf_s, vsprintf_s,
1838 _Always_(_Post_z_) char, _Buffer,
1839 _In_z_ _Printf_format_string_ char const*, _Format
1840 )
1841
1842 _Success_(return >= 0)
1843 _Check_return_opt_
1844 _CRT_STDIO_INLINE int __CRTDECL _sprintf_p_l(
1845 _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1846 _In_ size_t const _BufferCount,
1847 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
1848 _In_opt_ _locale_t const _Locale,
1849 ...)
1850 #if defined _NO_CRT_STDIO_INLINE
1851 ;
1852 #else
1853 {
1854 int _Result;
1855 va_list _ArgList;
1856 __crt_va_start(_ArgList, _Locale);
1857 _Result = _vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);
1858 __crt_va_end(_ArgList);
1859 return _Result;
1860 }
1861 #endif
1862
1863 _Success_(return >= 0)
1864 _Check_return_opt_
1865 _CRT_STDIO_INLINE int __CRTDECL _sprintf_p(
1866 _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1867 _In_ size_t const _BufferCount,
1868 _In_z_ _Printf_format_string_ char const* const _Format,
1869 ...)
1870 #if defined _NO_CRT_STDIO_INLINE
1871 ;
1872 #else
1873 {
1874 int _Result;
1875 va_list _ArgList;
1876 __crt_va_start(_ArgList, _Format);
1877 _Result = _vsprintf_p_l(_Buffer, _BufferCount, _Format, NULL, _ArgList);
1878 __crt_va_end(_ArgList);
1879 return _Result;
1880 }
1881 #endif
1882
1883 _Success_(return >= 0)
1884 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snprintf_s_l)
1885 _CRT_STDIO_INLINE int __CRTDECL _snprintf_l(
1886 _Out_writes_opt_(_BufferCount) _Post_maybez_ char* const _Buffer,
1887 _In_ size_t const _BufferCount,
1888 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
1889 _In_opt_ _locale_t const _Locale,
1890 ...)
1891 #if defined _NO_CRT_STDIO_INLINE
1892 ;
1893 #else
1894 {
1895 int _Result;
1896 va_list _ArgList;
1897 __crt_va_start(_ArgList, _Locale);
1898
1899 _Result = _vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);
1900
1901 __crt_va_end(_ArgList);
1902 return _Result;
1903 }
1904 #endif
1905
1906 #if defined snprintf
1907 // This definition of snprintf will generate "warning C4005: 'snprintf': macro
1908 // redefinition" with a subsequent line indicating where the previous definition
1909 // of snprintf was. This makes it easier to find where snprintf was defined.
1910 #pragma warning(push, 1)
1911 #pragma warning(1: 4005) // macro redefinition
1912 #define snprintf Do not define snprintf as a macro
1913 #pragma warning(pop)
1914 #error Macro definition of snprintf conflicts with Standard Library function declaration
1915 #endif
1916
1917 _Success_(return >= 0)
1918 _Check_return_opt_
1919 _CRT_STDIO_INLINE int __CRTDECL snprintf(
1920 _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
1921 _In_ size_t const _BufferCount,
1922 _In_z_ _Printf_format_string_ char const* const _Format,
1923 ...)
1924 #if defined _NO_CRT_STDIO_INLINE
1925 ;
1926 #else
1927 {
1928 int _Result;
1929 va_list _ArgList;
1930 __crt_va_start(_ArgList, _Format);
1931 _Result = vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);
1932 __crt_va_end(_ArgList);
1933 return _Result;
1934 }
1935 #endif
1936
1937 _Success_(return >= 0)
1938 _Check_return_opt_
1939 _CRT_STDIO_INLINE int __CRTDECL _snprintf(
1940 _Out_writes_opt_(_BufferCount) _Post_maybez_ char* const _Buffer,
1941 _In_ size_t const _BufferCount,
1942 _In_z_ _Printf_format_string_ char const* const _Format,
1943 ...)
1944 #if defined _NO_CRT_STDIO_INLINE
1945 ;
1946 #else
1947 {
1948 int _Result;
1949 va_list _ArgList;
1950 __crt_va_start(_ArgList, _Format);
1951 _Result = _vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);
1952 __crt_va_end(_ArgList);
1953 return _Result;
1954 }
1955 #endif
1956
1957 __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX(
1958 _Success_(return >= 0)
1959 int, __RETURN_POLICY_SAME, __EMPTY_DECLSPEC, __CRTDECL, _snprintf, _vsnprintf,
1960 _Pre_notnull_ _Post_maybez_ char,
1961 _Out_writes_opt_(_BufferCount) _Post_maybez_, char, _Buffer,
1962 _In_ size_t, _BufferCount,
1963 _In_z_ _Printf_format_string_ char const*, _Format
1964 )
1965
1966 _Success_(return >= 0)
1967 _Check_return_opt_
1968 _CRT_STDIO_INLINE int __CRTDECL _snprintf_c_l(
1969 _Out_writes_opt_(_BufferCount) char* const _Buffer,
1970 _In_ size_t const _BufferCount,
1971 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
1972 _In_opt_ _locale_t const _Locale,
1973 ...)
1974 #if defined _NO_CRT_STDIO_INLINE
1975 ;
1976 #else
1977 {
1978 int _Result;
1979 va_list _ArgList;
1980 __crt_va_start(_ArgList, _Locale);
1981 _Result = _vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);
1982 __crt_va_end(_ArgList);
1983 return _Result;
1984 }
1985 #endif
1986
1987 _Success_(return >= 0)
1988 _Check_return_opt_
1989 _CRT_STDIO_INLINE int __CRTDECL _snprintf_c(
1990 _Out_writes_opt_(_BufferCount) char* const _Buffer,
1991 _In_ size_t const _BufferCount,
1992 _In_z_ _Printf_format_string_ char const* const _Format,
1993 ...)
1994 #if defined _NO_CRT_STDIO_INLINE
1995 ;
1996 #else
1997 {
1998 int _Result;
1999 va_list _ArgList;
2000 __crt_va_start(_ArgList, _Format);
2001 _Result = _vsnprintf_c_l(_Buffer, _BufferCount, _Format, NULL, _ArgList);
2002 __crt_va_end(_ArgList);
2003 return _Result;
2004 }
2005 #endif
2006
2007 _Success_(return >= 0)
2008 _Check_return_opt_
2009 _CRT_STDIO_INLINE int __CRTDECL _snprintf_s_l(
2010 _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
2011 _In_ size_t const _BufferCount,
2012 _In_ size_t const _MaxCount,
2013 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
2014 _In_opt_ _locale_t const _Locale,
2015 ...)
2016 #if defined _NO_CRT_STDIO_INLINE
2017 ;
2018 #else
2019 {
2020 int _Result;
2021 va_list _ArgList;
2022 __crt_va_start(_ArgList, _Locale);
2023 _Result = _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);
2024 __crt_va_end(_ArgList);
2025 return _Result;
2026 }
2027 #endif
2028
2029 _Success_(return >= 0)
2030 _Check_return_opt_
2031 _CRT_STDIO_INLINE int __CRTDECL _snprintf_s(
2032 _Out_writes_opt_(_BufferCount) _Always_(_Post_z_) char* const _Buffer,
2033 _In_ size_t const _BufferCount,
2034 _In_ size_t const _MaxCount,
2035 _In_z_ _Printf_format_string_ char const* const _Format,
2036 ...)
2037 #if defined _NO_CRT_STDIO_INLINE
2038 ;
2039 #else
2040 {
2041 int _Result;
2042 va_list _ArgList;
2043 __crt_va_start(_ArgList, _Format);
2044 _Result = _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, NULL, _ArgList);
2045 __crt_va_end(_ArgList);
2046 return _Result;
2047 }
2048 #endif
2049
2050 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2_ARGLIST(
2051 _Success_(return >= 0)
2052 int, _snprintf_s, _vsnprintf_s,
2053 _Always_(_Post_z_) char, _Buffer,
2054 _In_ size_t, _BufferCount,
2055 _In_z_ _Printf_format_string_ char const*, _Format
2056 )
2057
2058 _Check_return_opt_
2059 _CRT_STDIO_INLINE int __CRTDECL _scprintf_l(
2060 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
2061 _In_opt_ _locale_t const _Locale,
2062 ...)
2063 #if defined _NO_CRT_STDIO_INLINE
2064 ;
2065 #else
2066 {
2067 int _Result;
2068 va_list _ArgList;
2069 __crt_va_start(_ArgList, _Locale);
2070 _Result = _vscprintf_l(_Format, _Locale, _ArgList);
2071 __crt_va_end(_ArgList);
2072 return _Result;
2073 }
2074 #endif
2075
2076 _Check_return_
2077 _CRT_STDIO_INLINE int __CRTDECL _scprintf(
2078 _In_z_ _Printf_format_string_ char const* const _Format,
2079 ...)
2080 #if defined _NO_CRT_STDIO_INLINE
2081 ;
2082 #else
2083 {
2084 int _Result;
2085 va_list _ArgList;
2086 __crt_va_start(_ArgList, _Format);
2087 _Result = _vscprintf_l(_Format, NULL, _ArgList);
2088 __crt_va_end(_ArgList);
2089 return _Result;
2090 }
2091 #endif
2092
2093 _Check_return_opt_
2094 _CRT_STDIO_INLINE int __CRTDECL _scprintf_p_l(
2095 _In_z_ _Printf_format_string_params_(0) char const* const _Format,
2096 _In_opt_ _locale_t const _Locale,
2097 ...)
2098 #if defined _NO_CRT_STDIO_INLINE
2099 ;
2100 #else
2101 {
2102 int _Result;
2103 va_list _ArgList;
2104 __crt_va_start(_ArgList, _Locale);
2105 _Result = _vscprintf_p_l(_Format, _Locale, _ArgList);
2106 __crt_va_end(_ArgList);
2107 return _Result;
2108 }
2109 #endif
2110
2111 _Check_return_
2112 _CRT_STDIO_INLINE int __CRTDECL _scprintf_p(
2113 _In_z_ _Printf_format_string_ char const* const _Format,
2114 ...)
2115 #if defined _NO_CRT_STDIO_INLINE
2116 ;
2117 #else
2118 {
2119 int _Result;
2120 va_list _ArgList;
2121 __crt_va_start(_ArgList, _Format);
2122 _Result = _vscprintf_p(_Format, _ArgList);
2123 __crt_va_end(_ArgList);
2124 return _Result;
2125 }
2126 #endif
2127
2128 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2129 //
2130 // Narrow Character Formatted Input Functions (String)
2131 //
2132 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2133 _ACRTIMP int __cdecl __stdio_common_vsscanf(
2134 _In_ unsigned __int64 _Options,
2135 _In_reads_(_BufferCount) _Pre_z_ char const* _Buffer,
2136 _In_ size_t _BufferCount,
2137 _In_z_ _Scanf_format_string_params_(2) char const* _Format,
2138 _In_opt_ _locale_t _Locale,
2139 va_list _ArgList
2140 );
2141
2142 _Check_return_opt_
2143 _CRT_STDIO_INLINE int __CRTDECL _vsscanf_l(
2144 _In_z_ char const* const _Buffer,
2145 _In_z_ _Printf_format_string_ char const* const _Format,
2146 _In_opt_ _locale_t const _Locale,
2147 va_list _ArgList
2148 )
2149 #if defined _NO_CRT_STDIO_INLINE
2150 ;
2151 #else
2152 {
2153 return __stdio_common_vsscanf(
2154 _CRT_INTERNAL_LOCAL_SCANF_OPTIONS,
2155 _Buffer, (size_t)-1, _Format, _Locale, _ArgList);
2156 }
2157 #endif
2158
2159 _Check_return_opt_
2160 _CRT_STDIO_INLINE int __CRTDECL vsscanf(
2161 _In_z_ char const* const _Buffer,
2162 _In_z_ _Printf_format_string_ char const* const _Format,
2163 va_list _ArgList
2164 )
2165 #if defined _NO_CRT_STDIO_INLINE
2166 ;
2167 #else
2168 {
2169 return _vsscanf_l(_Buffer, _Format, NULL, _ArgList);
2170 }
2171 #endif
2172
2173 _Check_return_opt_
2174 _CRT_STDIO_INLINE int __CRTDECL _vsscanf_s_l(
2175 _In_z_ char const* const _Buffer,
2176 _In_z_ _Printf_format_string_ char const* const _Format,
2177 _In_opt_ _locale_t const _Locale,
2178 va_list _ArgList
2179 )
2180 #if defined _NO_CRT_STDIO_INLINE
2181 ;
2182 #else
2183 {
2184 return __stdio_common_vsscanf(
2185 _CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT,
2186 _Buffer, (size_t)-1, _Format, _Locale, _ArgList);
2187 }
2188 #endif
2189
2190 #if __STDC_WANT_SECURE_LIB__
2191
2192 #pragma warning(push)
2193 #pragma warning(disable: 6530) // Unrecognized SAL format string
2194
2195 _Check_return_opt_
2196 _CRT_STDIO_INLINE int __CRTDECL vsscanf_s(
2197 _In_z_ char const* const _Buffer,
2198 _In_z_ _Printf_format_string_ char const* const _Format,
2199 va_list _ArgList
2200 )
2201 #if defined _NO_CRT_STDIO_INLINE
2202 ;
2203 #else
2204 {
2205 return _vsscanf_s_l(_Buffer, _Format, NULL, _ArgList);
2206 }
2207 #endif
2208
2209 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2(
2210 int, vsscanf_s,
2211 _In_z_ char const, _Buffer,
2212 _In_z_ _Printf_format_string_ char const*, _Format,
2213 va_list, _ArgList
2214 )
2215
2216 #pragma warning(pop)
2217
2218 #endif
2219
2220 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_sscanf_s_l)
2221 _CRT_STDIO_INLINE int __CRTDECL _sscanf_l(
2222 _In_z_ char const* const _Buffer,
2223 _In_z_ _Scanf_format_string_params_(0) char const* const _Format,
2224 _In_opt_ _locale_t const _Locale,
2225 ...)
2226 #if defined _NO_CRT_STDIO_INLINE // SCANF
2227 ;
2228 #else
2229 {
2230 int _Result;
2231 va_list _ArgList;
2232 __crt_va_start(_ArgList, _Locale);
2233 _Result = _vsscanf_l(_Buffer, _Format, _Locale, _ArgList);
2234 __crt_va_end(_ArgList);
2235 return _Result;
2236 }
2237 #endif
2238
2239 _Check_return_ _CRT_INSECURE_DEPRECATE(sscanf_s)
2240 _CRT_STDIO_INLINE int __CRTDECL sscanf(
2241 _In_z_ char const* const _Buffer,
2242 _In_z_ _Scanf_format_string_ char const* const _Format,
2243 ...)
2244 #if defined _NO_CRT_STDIO_INLINE // SCANF
2245 ;
2246 #else
2247 {
2248 int _Result;
2249 va_list _ArgList;
2250 __crt_va_start(_ArgList, _Format);
2251 _Result = _vsscanf_l(_Buffer, _Format, NULL, _ArgList);
2252 __crt_va_end(_ArgList);
2253 return _Result;
2254 }
2255 #endif
2256
2257 _Check_return_opt_
2258 _CRT_STDIO_INLINE int __CRTDECL _sscanf_s_l(
2259 _In_z_ char const* const _Buffer,
2260 _In_z_ _Scanf_s_format_string_params_(0) char const* const _Format,
2261 _In_opt_ _locale_t const _Locale,
2262 ...)
2263 #if defined _NO_CRT_STDIO_INLINE // SCANF
2264 ;
2265 #else
2266 {
2267 int _Result;
2268 va_list _ArgList;
2269 __crt_va_start(_ArgList, _Locale);
2270 _Result = _vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList);
2271 __crt_va_end(_ArgList);
2272 return _Result;
2273 }
2274 #endif
2275
2276 #if __STDC_WANT_SECURE_LIB__
2277
2278 _Check_return_opt_
2279 _CRT_STDIO_INLINE int __CRTDECL sscanf_s(
2280 _In_z_ char const* const _Buffer,
2281 _In_z_ _Scanf_s_format_string_ char const* const _Format,
2282 ...)
2283 #if defined _NO_CRT_STDIO_INLINE // SCANF
2284 ;
2285 #else
2286 {
2287 int _Result;
2288 va_list _ArgList;
2289 __crt_va_start(_ArgList, _Format);
2290
2291 _Result = vsscanf_s(_Buffer, _Format, _ArgList);
2292
2293 __crt_va_end(_ArgList);
2294 return _Result;
2295 }
2296 #endif
2297
2298 #endif
2299
2300 #pragma warning(push)
2301 #pragma warning(disable: 6530) // Unrecognized SAL format string
2302
2303 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snscanf_s_l)
2304 _CRT_STDIO_INLINE int __CRTDECL _snscanf_l(
2305 _In_reads_bytes_(_BufferCount) _Pre_z_ char const* const _Buffer,
2306 _In_ size_t const _BufferCount,
2307 _In_z_ _Scanf_format_string_params_(0) char const* const _Format,
2308 _In_opt_ _locale_t const _Locale,
2309 ...)
2310 #if defined _NO_CRT_STDIO_INLINE // SCANF
2311 ;
2312 #else
2313 {
2314 int _Result;
2315 va_list _ArgList;
2316 __crt_va_start(_ArgList, _Locale);
2317
2318 _Result = __stdio_common_vsscanf(
2319 _CRT_INTERNAL_LOCAL_SCANF_OPTIONS,
2320 _Buffer, _BufferCount, _Format, _Locale, _ArgList);
2321
2322 __crt_va_end(_ArgList);
2323 return _Result;
2324 }
2325 #endif
2326
2327 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snscanf_s)
2328 _CRT_STDIO_INLINE int __CRTDECL _snscanf(
2329 _In_reads_bytes_(_BufferCount) _Pre_z_ char const* const _Buffer,
2330 _In_ size_t const _BufferCount,
2331 _In_z_ _Scanf_format_string_ char const* const _Format,
2332 ...)
2333 #if defined _NO_CRT_STDIO_INLINE // SCANF
2334 ;
2335 #else
2336 {
2337 int _Result;
2338 va_list _ArgList;
2339 __crt_va_start(_ArgList, _Format);
2340
2341 _Result = __stdio_common_vsscanf(
2342 _CRT_INTERNAL_LOCAL_SCANF_OPTIONS,
2343 _Buffer, _BufferCount, _Format, NULL, _ArgList);
2344
2345 __crt_va_end(_ArgList);
2346 return _Result;
2347 }
2348 #endif
2349
2350
2351 _Check_return_opt_
2352 _CRT_STDIO_INLINE int __CRTDECL _snscanf_s_l(
2353 _In_reads_bytes_(_BufferCount) _Pre_z_ char const* const _Buffer,
2354 _In_ size_t const _BufferCount,
2355 _In_z_ _Scanf_s_format_string_params_(0) char const* const _Format,
2356 _In_opt_ _locale_t const _Locale,
2357 ...)
2358 #if defined _NO_CRT_STDIO_INLINE // SCANF
2359 ;
2360 #else
2361 {
2362 int _Result;
2363 va_list _ArgList;
2364 __crt_va_start(_ArgList, _Locale);
2365
2366 _Result = __stdio_common_vsscanf(
2367 _CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT,
2368 _Buffer, _BufferCount, _Format, _Locale, _ArgList);
2369
2370 __crt_va_end(_ArgList);
2371 return _Result;
2372 }
2373 #endif
2374
2375 _Check_return_opt_
2376 _CRT_STDIO_INLINE int __CRTDECL _snscanf_s(
2377 _In_reads_bytes_(_BufferCount) _Pre_z_ char const* const _Buffer,
2378 _In_ size_t const _BufferCount,
2379 _In_z_ _Scanf_s_format_string_ char const* const _Format,
2380 ...)
2381 #if defined _NO_CRT_STDIO_INLINE // SCANF
2382 ;
2383 #else
2384 {
2385 int _Result;
2386 va_list _ArgList;
2387 __crt_va_start(_ArgList, _Format);
2388
2389 _Result = __stdio_common_vsscanf(
2390 _CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT,
2391 _Buffer, _BufferCount, _Format, NULL, _ArgList);
2392
2393 __crt_va_end(_ArgList);
2394 return _Result;
2395 }
2396 #endif
2397
2398 #pragma warning(pop)
2399
2400 #if defined _M_CEE_MIXED
2401 #pragma managed(pop)
2402 #endif
2403
2404
2405
2406 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2407 //
2408 // Non-ANSI Names for Compatibility
2409 //
2410 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2411 #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
2412
2413 #define SYS_OPEN _SYS_OPEN
2414
2415 #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC
2416 #pragma push_macro("tempnam")
2417 #undef tempnam
2418 #endif
2419
2420 _CRT_NONSTDC_DEPRECATE(_tempnam)
2421 _ACRTIMP char* __cdecl tempnam(
2422 _In_opt_z_ char const* _Directory,
2423 _In_opt_z_ char const* _FilePrefix
2424 );
2425
2426 #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC
2427 #pragma pop_macro("tempnam")
2428 #endif
2429
2430 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_fcloseall) _ACRTIMP int __cdecl fcloseall(void);
2431 _Check_return_ _CRT_NONSTDC_DEPRECATE(_fdopen) _ACRTIMP FILE* __cdecl fdopen(_In_ int _FileHandle, _In_z_ char const* _Format);
2432 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_fgetchar) _ACRTIMP int __cdecl fgetchar(void);
2433 _Check_return_ _CRT_NONSTDC_DEPRECATE(_fileno) _ACRTIMP int __cdecl fileno(_In_ FILE* _Stream);
2434 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_flushall) _ACRTIMP int __cdecl flushall(void);
2435 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_fputchar) _ACRTIMP int __cdecl fputchar(_In_ int _Ch);
2436 _Check_return_ _CRT_NONSTDC_DEPRECATE(_getw) _ACRTIMP int __cdecl getw(_Inout_ FILE* _Stream);
2437 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_putw) _ACRTIMP int __cdecl putw(_In_ int _Ch, _Inout_ FILE* _Stream);
2438 _Check_return_ _CRT_NONSTDC_DEPRECATE(_rmtmp) _ACRTIMP int __cdecl rmtmp(void);
2439
2440 #endif // _CRT_INTERNAL_NONSTDC_NAMES
2441#endif // _CRT_FUNCTIONS_REQUIRED
2442
2443
2444
2445_CRT_END_C_HEADER
2446_UCRT_RESTORE_CLANG_WARNINGS
2447#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
2448#endif // _INC_STDIO