|
|
|
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 |
|
#if _MSC_VER > 1000 |
15 |
|
#pragma once |
16 |
|
#endif |
17 |
|
|
18 |
|
#ifndef _INC_CONIO |
19 |
|
#define _INC_CONIO |
20 |
|
|
21 |
|
#include <crtdefs.h> |
22 |
|
#ifdef __cplusplus |
23 |
|
extern "C" { |
24 |
|
#endif |
25 |
|
|
26 |
|
/* Function prototypes */ |
27 |
|
|
28 |
|
_Check_return_wat_ _CRTIMP errno_t __cdecl _cgets_s(_Out_z_cap_(_Size) char * _Buffer, size_t _Size, _Out_ size_t * _SizeRead); |
29 |
|
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(errno_t, _cgets_s, _Deref_post_count_(*_Buffer) char, _Buffer, _Out_ size_t *, _Size) |
30 |
|
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_CGETS(char *, _CRTIMP, _cgets, _Pre_notnull_ _Post_z_, char, _Buffer) |
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_ 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_ 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_ const char * _Format, _In_opt_ _locale_t _Locale, ...); |
47 |
|
_Check_return_opt_ _CRTIMP int __cdecl _cprintf_s_l(_In_z_ _Printf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, ...); |
48 |
|
_Check_return_opt_ _CRTIMP int __cdecl _vcprintf_l(_In_z_ _Printf_format_string_ 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_ 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_ const char * _Format, _In_opt_ _locale_t _Locale, ...); |
51 |
|
_Check_return_opt_ _CRTIMP int __cdecl _vcprintf_p_l(_In_z_ _Printf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList); |
52 |
|
|
53 |
|
#ifdef _M_IX86 |
54 |
|
int __cdecl _inp(unsigned short); |
55 |
|
unsigned short __cdecl _inpw(unsigned short); |
56 |
|
unsigned long __cdecl _inpd(unsigned short); |
57 |
|
#endif /* _M_IX86 */ |
58 |
|
_CRTIMP int __cdecl _kbhit(void); |
59 |
|
#ifdef _M_IX86 |
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 /* _M_IX86 */ |
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 |
|
#if !defined(_MT) |
73 |
|
#define _getch() _getch_nolock() |
74 |
|
#define _getche() _getche_nolock() |
75 |
|
#define _putch(c) _putch_nolock(c) |
76 |
|
#define _ungetch(c) _ungetch_nolock(c) |
77 |
|
#endif |
78 |
|
|
79 |
|
|
80 |
|
#ifndef _WCONIO_DEFINED |
81 |
|
|
82 |
|
/* wide function prototypes, also declared in wchar.h */ |
83 |
|
|
84 |
|
#ifndef WEOF |
85 |
|
#define WEOF (wint_t)(0xFFFF) |
86 |
|
#endif |
87 |
|
|
88 |
|
_Check_return_wat_ _CRTIMP errno_t __cdecl _cgetws_s(_Out_cap_post_count_(_SizeInWords, *_SizeRead) wchar_t * _Buffer, size_t _SizeInWords, _Out_ size_t * _SizeRead); |
89 |
|
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(errno_t, _cgetws_s, _Deref_post_count_(*_Buffer) wchar_t, _Buffer, size_t *, _Size) |
90 |
|
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_CGETS(wchar_t *, _CRTIMP, _cgetws, _Pre_notnull_ _Post_z_, wchar_t, _Buffer) |
91 |
|
_Check_return_ _CRTIMP wint_t __cdecl _getwch(void); |
92 |
|
_Check_return_ _CRTIMP wint_t __cdecl _getwche(void); |
93 |
|
_Check_return_ _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh); |
94 |
|
_Check_return_ _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh); |
95 |
|
_Check_return_opt_ _CRTIMP int __cdecl _cputws(_In_z_ const wchar_t * _String); |
96 |
|
_Check_return_opt_ _CRTIMP int __cdecl _cwprintf(_In_z_ _Printf_format_string_ const wchar_t * _Format, ...); |
97 |
|
_Check_return_opt_ _CRTIMP int __cdecl _cwprintf_s(_In_z_ _Printf_format_string_ const wchar_t * _Format, ...); |
108 |
|
_CRTIMP int __cdecl _cwprintf_l(_In_z_ _Printf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...); |
109 |
|
_CRTIMP int __cdecl _cwprintf_s_l(_In_z_ _Printf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...); |
110 |
|
_CRTIMP int __cdecl _vcwprintf_l(_In_z_ _Printf_format_string_ const wchar_t *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList); |
111 |
|
_CRTIMP int __cdecl _vcwprintf_s_l(_In_z_ _Printf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList); |
112 |
|
_CRTIMP int __cdecl _cwprintf_p_l(_In_z_ _Printf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...); |
113 |
|
_CRTIMP int __cdecl _vcwprintf_p_l(_In_z_ _Printf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList); |
114 |
|
|
115 |
|
_Check_return_opt_ _CRTIMP wint_t __cdecl _putwch_nolock(wchar_t _WCh); |
116 |
|
_Check_return_ _CRTIMP wint_t __cdecl _getwch_nolock(void); |
117 |
|
_Check_return_ _CRTIMP wint_t __cdecl _getwche_nolock(void); |
118 |
|
_Check_return_opt_ _CRTIMP wint_t __cdecl _ungetwch_nolock(wint_t _WCh); |
119 |
|
|
120 |
|
#if !defined(_MT) |
121 |
|
#define _putwch() _putwch_nolock() |
122 |
|
#define _getwch() _getwch_nolock() |
123 |
|
#define _getwche() _getwche_nolock() |
124 |
|
#define _ungetwch() _ungetwch_nolock() |
125 |
|
#endif |
126 |
|
|
127 |
|
#define _WCONIO_DEFINED |
128 |
|
#endif /* _WCONIO_DEFINED */ |
129 |
|
|
130 |
|
#if !__STDC__ |
131 |
|
|
132 |
|
/* Non-ANSI names for compatibility */ |
133 |
|
|
134 |
|
#pragma warning(push) |
135 |
|
#pragma warning(disable: 4141) /* Using deprecated twice */ |
136 |
|
_Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cgets) _CRT_INSECURE_DEPRECATE(_cgets_s) _CRTIMP char * __cdecl cgets(_Out_z_cap_x_(*_Buffer+2) char * _Buffer); |
137 |
|
#pragma warning(pop) |
138 |
|
_Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cprintf) _CRTIMP int __cdecl cprintf(_In_z_ _Printf_format_string_ const char * _Format, ...); |
139 |
|
_Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cputs) _CRTIMP int __cdecl cputs(_In_z_ const char * _Str); |
140 |
|
_Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cscanf) _CRTIMP int __cdecl cscanf(_In_z_ _Scanf_format_string_ const char * _Format, ...); |
141 |
|
#ifdef _M_IX86 |
142 |
|
_CRT_NONSTDC_DEPRECATE(_inp) int __cdecl inp(unsigned short); |
143 |
|
_CRT_NONSTDC_DEPRECATE(_inpw) unsigned short __cdecl inpw(unsigned short); |
144 |
|
#endif /* _M_IX86 */ |
145 |
|
_Check_return_ _CRT_NONSTDC_DEPRECATE(_getch) _CRTIMP int __cdecl getch(void); |
146 |
|
_Check_return_ _CRT_NONSTDC_DEPRECATE(_getche) _CRTIMP int __cdecl getche(void); |
147 |
|
_Check_return_ _CRT_NONSTDC_DEPRECATE(_kbhit) _CRTIMP int __cdecl kbhit(void); |
148 |
|
#ifdef _M_IX86 |
149 |
|
_CRT_NONSTDC_DEPRECATE(_outp) int __cdecl outp(unsigned short, int); |
150 |
|
_CRT_NONSTDC_DEPRECATE(_outpw) unsigned short __cdecl outpw(unsigned short, unsigned short); |
151 |
|
#endif /* _M_IX86 */ |
152 |
|
_Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_putch) _CRTIMP int __cdecl putch(int _Ch); |
153 |
|
_Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_ungetch) _CRTIMP int __cdecl ungetch(int _Ch); |
154 |
|
|
155 |
|
#endif /* __STDC__ */ |
156 |
|
|
157 |
|
#ifdef __cplusplus |
158 |
|
} |
159 |
|
#endif |
160 |
|
|
161 |
|
#endif /* _INC_CONIO */ |
162 |
|
|
|
|
|