File size: 2,906 Bytes
90219c5 | 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 | //
// cprintf.cpp
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// The standard output functions, which perform formatted output to the
// console.
//
#include <corecrt_internal_stdio_output.h>
using namespace __crt_stdio_output;
template <template <typename, typename> class Base, typename Character>
static int __cdecl common_vcprintf(
unsigned __int64 const options,
Character const* const format,
__crt_cached_ptd_host& ptd,
va_list const arglist
)
{
typedef output_processor<
Character,
console_output_adapter<Character>,
Base<Character, console_output_adapter<Character>>
> processor_type;
processor_type processor(
console_output_adapter<Character>(),
options,
format,
ptd,
arglist);
return processor.process();
}
extern "C" int __cdecl __conio_common_vcprintf(
unsigned __int64 const options,
char const* const format,
_locale_t const locale,
va_list const arglist
)
{
__crt_cached_ptd_host ptd{locale};
return common_vcprintf<standard_base>(options, format, ptd, arglist);
}
extern "C" int __cdecl __conio_common_vcprintf_s(
unsigned __int64 const options,
char const* const format,
_locale_t const locale,
va_list const arglist
)
{
__crt_cached_ptd_host ptd{locale};
return common_vcprintf<format_validation_base>(options, format, ptd, arglist);
}
extern "C" int __cdecl __conio_common_vcprintf_p(
unsigned __int64 const options,
char const* const format,
_locale_t const locale,
va_list const arglist
)
{
__crt_cached_ptd_host ptd{locale};
return common_vcprintf<positional_parameter_base>(options, format, ptd, arglist);
}
extern "C" int __cdecl __conio_common_vcwprintf(
unsigned __int64 const options,
wchar_t const* const format,
_locale_t const locale,
va_list const arglist
)
{
__crt_cached_ptd_host ptd{locale};
return common_vcprintf<standard_base>(options, format, ptd, arglist);
}
extern "C" int __cdecl __conio_common_vcwprintf_s(
unsigned __int64 const options,
wchar_t const* const format,
_locale_t const locale,
va_list const arglist
)
{
__crt_cached_ptd_host ptd{locale};
return common_vcprintf<format_validation_base>(options, format, ptd, arglist);
}
extern "C" int __cdecl __conio_common_vcwprintf_p(
unsigned __int64 const options,
wchar_t const* const format,
_locale_t const locale,
va_list const arglist
)
{
__crt_cached_ptd_host ptd{locale};
return common_vcprintf<positional_parameter_base>(options, format, ptd, arglist);
}
|