STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
conio.h
Go to the documentation of this file.
1 /***
2 *conio.h - console and port I/O declarations
3 *
4 * Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 * This include file contains the function declarations for
8 * the MS C V2.03 compatible console I/O routines.
9 *
10 * [Public]
11 *
12 ****/
13 
14 #pragma once
15 
16 #ifndef _INC_CONIO
17 #define _INC_CONIO
18 
19 #include <crtdefs.h>
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23 
24 /* Function prototypes */
25 
26 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
27 
28 _Check_return_wat_ _CRTIMP errno_t __cdecl _cgets_s(_Out_writes_z_(_Size) char * _Buffer, size_t _Size, _Out_ size_t * _SizeRead);
29 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(errno_t, _cgets_s, _Out_writes_z_(*_Buffer) char, _Buffer, _Out_ size_t *, _SizeRead)
31 _Check_return_opt_ _CRTIMP int __cdecl _cprintf(_In_z_ _Printf_format_string_ const char * _Format, ...);
32 _Check_return_opt_ _CRTIMP int __cdecl _cprintf_s(_In_z_ _Printf_format_string_ const char * _Format, ...);
33 _Check_return_opt_ _CRTIMP int __cdecl _cputs(_In_z_ const char * _Str);
34 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_cscanf_s) _CRTIMP int __cdecl _cscanf(_In_z_ _Scanf_format_string_ const char * _Format, ...);
35 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_cscanf_s_l) _CRTIMP int __cdecl _cscanf_l(_In_z_ _Scanf_format_string_params_(0) const char * _Format, _In_opt_ _locale_t _Locale, ...);
36 _Check_return_opt_ _CRTIMP int __cdecl _cscanf_s(_In_z_ _Scanf_format_string_ const char * _Format, ...);
37 _Check_return_opt_ _CRTIMP int __cdecl _cscanf_s_l(_In_z_ _Scanf_format_string_params_(0) const char * _Format, _In_opt_ _locale_t _Locale, ...);
38 _Check_return_ _CRTIMP int __cdecl _getch(void);
39 _Check_return_ _CRTIMP int __cdecl _getche(void);
40 _Check_return_opt_ _CRTIMP int __cdecl _vcprintf(_In_z_ _Printf_format_string_ const char * _Format, va_list _ArgList);
41 _Check_return_opt_ _CRTIMP int __cdecl _vcprintf_s(_In_z_ _Printf_format_string_ const char * _Format, va_list _ArgList);
42 
43 _Check_return_opt_ _CRTIMP int __cdecl _cprintf_p(_In_z_ _Printf_format_string_ const char * _Format, ...);
44 _Check_return_opt_ _CRTIMP int __cdecl _vcprintf_p(_In_z_ const char * _Format, va_list _ArgList);
45 
46 _Check_return_opt_ _CRTIMP int __cdecl _cprintf_l(_In_z_ _Printf_format_string_params_(0) const char * _Format, _In_opt_ _locale_t _Locale, ...);
47 _Check_return_opt_ _CRTIMP int __cdecl _cprintf_s_l(_In_z_ _Printf_format_string_params_(0) const char * _Format, _In_opt_ _locale_t _Locale, ...);
48 _Check_return_opt_ _CRTIMP int __cdecl _vcprintf_l(_In_z_ _Printf_format_string_params_(2) const char * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList);
49 _Check_return_opt_ _CRTIMP int __cdecl _vcprintf_s_l(_In_z_ _Printf_format_string_params_(2) const char * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList);
50 _Check_return_opt_ _CRTIMP int __cdecl _cprintf_p_l(_In_z_ _Printf_format_string_params_(0) const char * _Format, _In_opt_ _locale_t _Locale, ...);
51 _Check_return_opt_ _CRTIMP int __cdecl _vcprintf_p_l(_In_z_ _Printf_format_string_params_(2) const char * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList);
52 
53 #if defined (_M_IX86) || defined (_M_X64)
54 int __cdecl _inp(unsigned short);
55 unsigned short __cdecl _inpw(unsigned short);
56 unsigned long __cdecl _inpd(unsigned short);
57 #endif /* defined (_M_IX86) || defined (_M_X64) */
58 _CRTIMP int __cdecl _kbhit(void);
59 #if defined (_M_IX86) || defined (_M_X64)
60 int __cdecl _outp(unsigned short, int);
61 unsigned short __cdecl _outpw(unsigned short, unsigned short);
62 unsigned long __cdecl _outpd(unsigned short, unsigned long);
63 #endif /* defined (_M_IX86) || defined (_M_X64) */
64 _CRTIMP int __cdecl _putch(_In_ int _Ch);
65 _CRTIMP int __cdecl _ungetch(_In_ int _Ch);
66 
67 _Check_return_ _CRTIMP int __cdecl _getch_nolock(void);
68 _Check_return_ _CRTIMP int __cdecl _getche_nolock(void);
69 _CRTIMP int __cdecl _putch_nolock(_In_ int _Ch);
70 _CRTIMP int __cdecl _ungetch_nolock(_In_ int _Ch);
71 
72 #ifndef _WCONIO_DEFINED
73 
74 /* wide function prototypes, also declared in wchar.h */
75 
76 #ifndef WEOF
77 #define WEOF (wint_t)(0xFFFF)
78 #endif /* WEOF */
79 
80 _Check_return_wat_ _CRTIMP errno_t __cdecl _cgetws_s(_Out_writes_to_(_SizeInWords, *_SizeRead) wchar_t * _Buffer, size_t _SizeInWords, _Out_ size_t * _SizeRead);
81 __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(errno_t, _cgetws_s, _Out_writes_z_(*_Buffer) wchar_t, _Buffer, size_t *, _SizeRead)
82 __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_CGETS(wchar_t *, _CRTIMP, _cgetws, _Pre_notnull_ _Post_z_, wchar_t, _Buffer)
83 _Check_return_ _CRTIMP wint_t __cdecl _getwch(void);
85 _Check_return_ _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh);
87 _Check_return_opt_ _CRTIMP int __cdecl _cputws(_In_z_ const wchar_t * _String);
88 _Check_return_opt_ _CRTIMP int __cdecl _cwprintf(_In_z_ _Printf_format_string_ const wchar_t * _Format, ...);
89 _Check_return_opt_ _CRTIMP int __cdecl _cwprintf_s(_In_z_ _Printf_format_string_ const wchar_t * _Format, ...);
90 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_cwscanf_s) _CRTIMP int __cdecl _cwscanf(_In_z_ _Scanf_format_string_ const wchar_t * _Format, ...);
91 _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_cwscanf_s_l) _CRTIMP int __cdecl _cwscanf_l(_In_z_ _Scanf_format_string_params_(0) const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...);
92 _Check_return_opt_ _CRTIMP int __cdecl _cwscanf_s(_In_z_ _Scanf_format_string_ const wchar_t * _Format, ...);
93 _Check_return_opt_ _CRTIMP int __cdecl _cwscanf_s_l(_In_z_ _Scanf_format_string_params_(0) const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...);
94 _Check_return_opt_ _CRTIMP int __cdecl _vcwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList);
95 _Check_return_opt_ _CRTIMP int __cdecl _vcwprintf_s(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList);
96 
97 _Check_return_opt_ _CRTIMP int __cdecl _cwprintf_p(_In_z_ _Printf_format_string_ const wchar_t * _Format, ...);
98 _Check_return_opt_ _CRTIMP int __cdecl _vcwprintf_p(_In_z_ _Printf_format_string_ const wchar_t* _Format, va_list _ArgList);
99 
100 _CRTIMP int __cdecl _cwprintf_l(_In_z_ _Printf_format_string_params_(0) const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...);
101 _CRTIMP int __cdecl _cwprintf_s_l(_In_z_ _Printf_format_string_params_(0) const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...);
102 _CRTIMP int __cdecl _vcwprintf_l(_In_z_ _Printf_format_string_params_(2) const wchar_t *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList);
103 _CRTIMP int __cdecl _vcwprintf_s_l(_In_z_ _Printf_format_string_params_(2) const wchar_t * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList);
104 _CRTIMP int __cdecl _cwprintf_p_l(_In_z_ _Printf_format_string_params_(0) const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...);
105 _CRTIMP int __cdecl _vcwprintf_p_l(_In_z_ _Printf_format_string_params_(2) const wchar_t * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList);
106 
107 _Check_return_opt_ _CRTIMP wint_t __cdecl _putwch_nolock(wchar_t _WCh);
111 
112 #define _WCONIO_DEFINED
113 #endif /* _WCONIO_DEFINED */
114 
115 #if !__STDC__
116 
117 /* Non-ANSI names for compatibility */
118 
119 #pragma warning(push)
120 #pragma warning(disable: 4141) /* Using deprecated twice */
121 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cgets) _CRT_INSECURE_DEPRECATE(_cgets_s) _CRTIMP char * __cdecl cgets(_Out_writes_z_(_Inexpressible_(*_Buffer+2)) char * _Buffer);
122 #pragma warning(pop)
123 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cprintf) _CRTIMP int __cdecl cprintf(_In_z_ _Printf_format_string_ const char * _Format, ...);
124 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cputs) _CRTIMP int __cdecl cputs(_In_z_ const char * _Str);
125 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cscanf) _CRTIMP int __cdecl cscanf(_In_z_ _Scanf_format_string_ const char * _Format, ...);
126 #if defined (_M_IX86) || defined (_M_X64)
127 _CRT_NONSTDC_DEPRECATE(_inp) int __cdecl inp(unsigned short);
128 _CRT_NONSTDC_DEPRECATE(_inpd) unsigned long __cdecl inpd(unsigned short);
129 _CRT_NONSTDC_DEPRECATE(_inpw) unsigned short __cdecl inpw(unsigned short);
130 #endif /* defined (_M_IX86) || defined (_M_X64) */
131 _Check_return_ _CRT_NONSTDC_DEPRECATE(_getch) _CRTIMP int __cdecl getch(void);
132 _Check_return_ _CRT_NONSTDC_DEPRECATE(_getche) _CRTIMP int __cdecl getche(void);
133 _Check_return_ _CRT_NONSTDC_DEPRECATE(_kbhit) _CRTIMP int __cdecl kbhit(void);
134 #if defined (_M_IX86) || defined (_M_X64)
135 _CRT_NONSTDC_DEPRECATE(_outp) int __cdecl outp(unsigned short, int);
136 _CRT_NONSTDC_DEPRECATE(_outpd) unsigned long __cdecl outpd(unsigned short, unsigned long);
137 _CRT_NONSTDC_DEPRECATE(_outpw) unsigned short __cdecl outpw(unsigned short, unsigned short);
138 #endif /* defined (_M_IX86) || defined (_M_X64) */
139 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_putch) _CRTIMP int __cdecl putch(int _Ch);
140 _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_ungetch) _CRTIMP int __cdecl ungetch(int _Ch);
141 
142 #endif /* !__STDC__ */
143 
144 #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
145 
146 #ifdef __cplusplus
147 }
148 #endif /* __cplusplus */
149 
150 #endif /* _INC_CONIO */
#define _Out_
Definition: sal.h:351
_Check_return_opt_ _CRTIMP int __cdecl _vcwprintf_s(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
#define _Out_writes_to_(size, count)
Definition: sal.h:361
_Check_return_opt_ _CRTIMP int __cdecl _cwprintf_s(_In_z_ _Printf_format_string_ const wchar_t *_Format,...)
_Check_return_opt_ wint_t __cdecl _putwch_nolock(wchar_t _WCh)
#define _CRTIMP
Definition: crtdefs.h:23
#define _Out_writes_z_(size)
Definition: sal.h:358
unsigned short wint_t
Definition: crtdefs.h:541
_Check_return_opt_ _CRTIMP int __cdecl _vcwprintf_p(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
_CRTIMP int __cdecl _vcwprintf_l(_In_z_ _Printf_format_string_params_(2) const wchar_t *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList)
_Check_return_ wint_t __cdecl _getwch_nolock(void)
_In_z_ const char * _ArgList
Definition: process.h:203
_Check_return_ _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh)
_Check_return_opt_ _CRTIMP int __cdecl _cwprintf_p(_In_z_ _Printf_format_string_ const wchar_t *_Format,...)
#define _Check_return_
Definition: sal.h:563
_Check_return_opt_ _Check_return_opt_ _In_opt_ _locale_t _Check_return_opt_ _CRTIMP int __cdecl _cwscanf_s(_In_z_ _Scanf_s_format_string_ const wchar_t *_Format,...)
#define _In_z_
Definition: sal.h:319
#define _In_
Definition: sal.h:314
_Check_return_ _In_z_ const char * _Locale
Definition: locale.h:117
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_CGETS(_ReturnType, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst)
Definition: crtdefs.h:1935
#define _In_opt_
Definition: sal.h:315
_CRTIMP int __cdecl _vcwprintf_s_l(_In_z_ _Printf_format_string_params_(2) const wchar_t *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList)
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(_ReturnType, _FuncName, _DstType, _Dst, _TType1, _TArg1)
Definition: crtdefs.h:846
#define _Printf_format_string_params_(x)
Definition: sal.h:572
#define _Printf_format_string_
Definition: sal.h:567
_Check_return_ _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh)
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
int errno_t
Definition: crtdefs.h:563
_Check_return_ _CRTIMP wint_t __cdecl _getwche(void)
_Check_return_opt_ _CRTIMP int __cdecl _cwscanf_s_l(_In_z_ _Scanf_s_format_string_params_(0) const wchar_t *_Format, _In_opt_ _locale_t _Locale,...)
#define _CRT_NONSTDC_DEPRECATE(_NewName)
Definition: crtdefs.h:488
#define _Scanf_format_string_
Definition: sal.h:568
_Check_return_ wint_t __cdecl _getwche_nolock(void)
#define _Check_return_wat_
Definition: crtdefs.h:2128
#define _Check_return_opt_
Definition: crtdefs.h:2122
_CRTIMP _In_ wchar_t _WCh
Definition: stdlib.h:567
_Check_return_ _In_z_ _Scanf_format_string_ const char * _Format
Definition: stdio.h:230
_Check_return_ _CRTIMP wint_t __cdecl _getwch(void)
#define _CRT_INSECURE_DEPRECATE(_Replacement)
Definition: crtdefs.h:287
_CRTIMP int __cdecl _vcwprintf_p_l(_In_z_ _Printf_format_string_params_(2) const wchar_t *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList)
_Check_return_opt_ _CRTIMP int __cdecl _cputws(_In_z_ const wchar_t *_String)
_Check_return_opt_ _CRTIMP int __cdecl _vcwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
#define _Scanf_format_string_params_(x)
Definition: sal.h:573
_CRTIMP int __cdecl _cwprintf_p_l(_In_z_ _Printf_format_string_params_(0) const wchar_t *_Format, _In_opt_ _locale_t _Locale,...)
#define _Post_z_
Definition: sal.h:697
_CRTIMP int __cdecl _cwprintf_l(_In_z_ _Printf_format_string_params_(0) const wchar_t *_Format, _In_opt_ _locale_t _Locale,...)
_Check_return_wat_ _CRTIMP errno_t __cdecl _cgetws_s(_Out_writes_to_(_SizeInWords,*_SizeRead) wchar_t *_Buffer, size_t _SizeInWords, _Out_ size_t *_SizeRead)
_Check_return_ _In_ long _Size
Definition: io.h:325
#define _Pre_notnull_
Definition: sal.h:686
_Check_return_opt_ _CRTIMP int __cdecl _cwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format,...)
char * va_list
Definition: crtdefs.h:550
_Check_return_opt_ wint_t __cdecl _ungetwch_nolock(wint_t _WCh)
Definition: crtdefs.h:2078
_CRTIMP int __cdecl _cwprintf_s_l(_In_z_ _Printf_format_string_params_(0) const wchar_t *_Format, _In_opt_ _locale_t _Locale,...)