| 1 | /** |
| 2 | * This file has no copyright assigned and is placed in the Public Domain. |
| 3 | * This file is part of the mingw-w64 runtime package. |
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| 5 | */ |
| 6 | |
| 7 | #ifndef _INC_CORECRT_WCONIO |
| 8 | #define _INC_CORECRT_WCONIO |
| 9 | |
| 10 | #include <corecrt.h> |
| 11 | #include <corecrt_stdio_config.h> |
| 12 | #include <stddef.h> |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | #ifndef WEOF |
| 19 | #define WEOF (wint_t)(0xFFFF) |
| 20 | #endif |
| 21 | |
| 22 | /** |
| 23 | * Functions to read/write strings from/to console. |
| 24 | */ |
| 25 | |
| 26 | _CRTIMP wchar_t *__cdecl _cgetws(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 27 | _CRTIMP int __cdecl _cputws(const wchar_t *_String); |
| 28 | |
| 29 | /** |
| 30 | * Functions to read/write single characters from/to console. |
| 31 | */ |
| 32 | |
| 33 | _CRTIMP wint_t __cdecl _getwch(void); |
| 34 | _CRTIMP wint_t __cdecl _getwche(void); |
| 35 | _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh); |
| 36 | _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh); |
| 37 | |
| 38 | #if __MSVCRT_VERSION__ >= 0x800 |
| 39 | _CRTIMP wint_t __cdecl _getwch_nolock(void); |
| 40 | _CRTIMP wint_t __cdecl _getwche_nolock(void); |
| 41 | _CRTIMP wint_t __cdecl _putwch_nolock(wchar_t _WCh); |
| 42 | _CRTIMP wint_t __cdecl _ungetwch_nolock(wint_t _WCh); |
| 43 | #endif |
| 44 | |
| 45 | /** |
| 46 | * Formatted console I/O functions. |
| 47 | */ |
| 48 | |
| 49 | #ifdef _UCRT |
| 50 | int __cdecl __conio_common_vcwprintf(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList); |
| 51 | int __cdecl __conio_common_vcwprintf_p(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList); |
| 52 | int __cdecl __conio_common_vcwprintf_s(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList); |
| 53 | int __cdecl __conio_common_vcwscanf(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList); |
| 54 | |
| 55 | __mingw_ovr int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList) |
| 56 | { |
| 57 | return __conio_common_vcwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, NULL, _ArgList); |
| 58 | } |
| 59 | __mingw_ovr int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...) |
| 60 | { |
| 61 | __builtin_va_list _ArgList; |
| 62 | int _Ret; |
| 63 | __builtin_va_start(_ArgList, _Format); |
| 64 | _Ret = _vcwprintf(_Format, _ArgList); |
| 65 | __builtin_va_end(_ArgList); |
| 66 | return _Ret; |
| 67 | } |
| 68 | __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN |
| 69 | int __cdecl _cwscanf(const wchar_t * __restrict__ _Format,...) |
| 70 | { |
| 71 | __builtin_va_list _ArgList; |
| 72 | int _Ret; |
| 73 | __builtin_va_start(_ArgList, _Format); |
| 74 | _Ret = __conio_common_vcwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Format, NULL, _ArgList); |
| 75 | __builtin_va_end(_ArgList); |
| 76 | return _Ret; |
| 77 | } |
| 78 | __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN |
| 79 | int __cdecl _cwscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) |
| 80 | { |
| 81 | __builtin_va_list _ArgList; |
| 82 | int _Ret; |
| 83 | __builtin_va_start(_ArgList, _Locale); |
| 84 | _Ret = __conio_common_vcwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Format, _Locale, _ArgList); |
| 85 | __builtin_va_end(_ArgList); |
| 86 | return _Ret; |
| 87 | } |
| 88 | __mingw_ovr int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList) |
| 89 | { |
| 90 | return __conio_common_vcwprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, NULL, _ArgList); |
| 91 | } |
| 92 | __mingw_ovr int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...) |
| 93 | { |
| 94 | __builtin_va_list _ArgList; |
| 95 | int _Ret; |
| 96 | __builtin_va_start(_ArgList, _Format); |
| 97 | _Ret = _vcwprintf_p(_Format, _ArgList); |
| 98 | __builtin_va_end(_ArgList); |
| 99 | return _Ret; |
| 100 | } |
| 101 | __mingw_ovr int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList) |
| 102 | { |
| 103 | return __conio_common_vcwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, _Locale, _ArgList); |
| 104 | } |
| 105 | __mingw_ovr int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) |
| 106 | { |
| 107 | __builtin_va_list _ArgList; |
| 108 | int _Ret; |
| 109 | __builtin_va_start(_ArgList, _Locale); |
| 110 | _Ret = _vcwprintf_l(_Format, _Locale, _ArgList); |
| 111 | __builtin_va_end(_ArgList); |
| 112 | return _Ret; |
| 113 | } |
| 114 | __mingw_ovr int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList) |
| 115 | { |
| 116 | return __conio_common_vcwprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, _Locale, _ArgList); |
| 117 | } |
| 118 | __mingw_ovr int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) |
| 119 | { |
| 120 | __builtin_va_list _ArgList; |
| 121 | int _Ret; |
| 122 | __builtin_va_start(_ArgList, _Locale); |
| 123 | _Ret = _vcwprintf_p_l(_Format, _Locale, _ArgList); |
| 124 | __builtin_va_end(_ArgList); |
| 125 | return _Ret; |
| 126 | } |
| 127 | #else /* !_UCRT */ |
| 128 | _CRTIMP int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...); |
| 129 | _CRTIMP int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 130 | _CRTIMP int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...); |
| 131 | _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 132 | _CRTIMP int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 133 | _CRTIMP int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 134 | _CRTIMP int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 135 | _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 136 | _CRTIMP int __cdecl _cwscanf(const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 137 | _CRTIMP int __cdecl _cwscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 138 | #endif /* _UCRT */ |
| 139 | |
| 140 | #ifdef __cplusplus |
| 141 | } |
| 142 | #endif |
| 143 | |
| 144 | #include <sec_api/wconio_s.h> |
| 145 | |
| 146 | #endif /* _INC_CORECRT_WCONIO */ |