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
15extern "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
50int __cdecl __conio_common_vcwprintf(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
51int __cdecl __conio_common_vcwprintf_p(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
52int __cdecl __conio_common_vcwprintf_s(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
53int __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
69int __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
79int __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 */