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
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // This file declares the direct console I/O functions.
7 //
8 #pragma once
9 #define _INC_CONIO
10 
11 #include <corecrt.h>
12 #include <corecrt_wconio.h>
13 
15 
16 
17 
18 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
19 
22  _DCRTIMP errno_t __cdecl _cgets_s(
24  _In_ size_t _BufferCount,
25  _Out_ size_t* _SizeRead
26  );
27 
29  _Success_(return == 0)
30  errno_t, _cgets_s,
31  _Out_writes_z_(*_Buffer) char, _Buffer,
32  _Out_ size_t*, _SizeRead
33  )
34 
36  _DCRTIMP int __cdecl _cputs(
37  _In_z_ char const* _Buffer
38  );
39 
40  //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41  //
42  // Narrow Character Formatted Output Functions (Console)
43  //
44  //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
46  _DCRTIMP int __cdecl __conio_common_vcprintf(
47  _In_ unsigned __int64 _Options,
51  );
52 
54  _DCRTIMP int __cdecl __conio_common_vcprintf_s(
55  _In_ unsigned __int64 _Options,
56  _In_z_ _Printf_format_string_params_(2) char const* _Format,
57  _In_opt_ _locale_t _Locale,
58  va_list _ArgList
59  );
60 
62  _DCRTIMP int __cdecl __conio_common_vcprintf_p(
63  _In_ unsigned __int64 _Options,
64  _In_z_ _Printf_format_string_params_(2) char const* _Format,
65  _In_opt_ _locale_t _Locale,
66  va_list _ArgList
67  );
68 
70  _CRT_STDIO_INLINE int __CRTDECL _vcprintf_l(
71  _In_z_ _Printf_format_string_params_(2) char const* const _Format,
72  _In_opt_ _locale_t const _Locale,
73  va_list _ArgList
74  )
75 #if defined _NO_CRT_STDIO_INLINE
76 ;
77 #else
78  {
79  return __conio_common_vcprintf(
81  _Format, _Locale, _ArgList);
82  }
83 #endif
84 
86  _CRT_STDIO_INLINE int __CRTDECL _vcprintf(
87  _In_z_ _Printf_format_string_ char const* const _Format,
88  va_list _ArgList
89  )
90 #if defined _NO_CRT_STDIO_INLINE
91 ;
92 #else
93  {
94  return _vcprintf_l(_Format, NULL, _ArgList);
95  }
96 #endif
97 
99  _CRT_STDIO_INLINE int __CRTDECL _vcprintf_s_l(
100  _In_z_ _Printf_format_string_params_(2) char const* const _Format,
101  _In_opt_ _locale_t const _Locale,
102  va_list _ArgList
103  )
104 #if defined _NO_CRT_STDIO_INLINE
105 ;
106 #else
107  {
108  return __conio_common_vcprintf_s(
110  _Format, _Locale, _ArgList);
111  }
112 #endif
113 
115  _CRT_STDIO_INLINE int __CRTDECL _vcprintf_s(
116  _In_z_ _Printf_format_string_ char const* const _Format,
117  va_list _ArgList
118  )
119 #if defined _NO_CRT_STDIO_INLINE
120 ;
121 #else
122  {
123  return _vcprintf_s_l(_Format, NULL, _ArgList);
124  }
125 #endif
126 
128  _CRT_STDIO_INLINE int __CRTDECL _vcprintf_p_l(
129  _In_z_ _Printf_format_string_params_(2) char const* const _Format,
130  _In_opt_ _locale_t const _Locale,
131  va_list _ArgList
132  )
133 #if defined _NO_CRT_STDIO_INLINE
134 ;
135 #else
136  {
137  return __conio_common_vcprintf_p(
139  _Format, _Locale, _ArgList);
140  }
141 #endif
142 
144  _CRT_STDIO_INLINE int __CRTDECL _vcprintf_p(
145  _In_z_ char const* const _Format,
146  va_list _ArgList
147  )
148 #if defined _NO_CRT_STDIO_INLINE
149 ;
150 #else
151  {
152  return _vcprintf_p_l(_Format, NULL, _ArgList);
153  }
154 #endif
155 
157  _CRT_STDIO_INLINE int __CRTDECL _cprintf_l(
158  _In_z_ _Printf_format_string_params_(0) char const* const _Format,
159  _In_opt_ _locale_t const _Locale,
160  ...)
161 #if defined _NO_CRT_STDIO_INLINE
162 ;
163 #else
164  {
165  int _Result;
167  __crt_va_start(_ArgList, _Locale);
168  _Result = _vcprintf_l(_Format, _Locale, _ArgList);
169  __crt_va_end(_ArgList);
170  return _Result;
171  }
172 #endif
173 
175  _CRT_STDIO_INLINE int __CRTDECL _cprintf(
176  _In_z_ _Printf_format_string_ char const* const _Format,
177  ...)
178 #if defined _NO_CRT_STDIO_INLINE
179 ;
180 #else
181  {
182  int _Result;
184  __crt_va_start(_ArgList, _Format);
185  _Result = _vcprintf_l(_Format, NULL, _ArgList);
186  __crt_va_end(_ArgList);
187  return _Result;
188  }
189 #endif
190 
192  _CRT_STDIO_INLINE int __CRTDECL _cprintf_s_l(
193  _In_z_ _Printf_format_string_params_(0) char const* const _Format,
194  _In_opt_ _locale_t const _Locale,
195  ...)
196 #if defined _NO_CRT_STDIO_INLINE
197 ;
198 #else
199  {
200  int _Result;
202  __crt_va_start(_ArgList, _Locale);
203  _Result = _vcprintf_s_l(_Format, _Locale, _ArgList);
204  __crt_va_end(_ArgList);
205  return _Result;
206  }
207 #endif
208 
210  _CRT_STDIO_INLINE int __CRTDECL _cprintf_s(
211  _In_z_ _Printf_format_string_ char const* const _Format,
212  ...)
213 #if defined _NO_CRT_STDIO_INLINE
214 ;
215 #else
216  {
217  int _Result;
219  __crt_va_start(_ArgList, _Format);
220  _Result = _vcprintf_s_l(_Format, NULL, _ArgList);
221  __crt_va_end(_ArgList);
222  return _Result;
223  }
224 #endif
225 
227  _CRT_STDIO_INLINE int __CRTDECL _cprintf_p_l(
228  _In_z_ _Printf_format_string_params_(0) char const* const _Format,
229  _In_opt_ _locale_t const _Locale,
230  ...)
231 #if defined _NO_CRT_STDIO_INLINE
232 ;
233 #else
234  {
235  int _Result;
237  __crt_va_start(_ArgList, _Locale);
238  _Result = _vcprintf_p_l(_Format, _Locale, _ArgList);
239  __crt_va_end(_ArgList);
240  return _Result;
241  }
242 #endif
243 
245  _CRT_STDIO_INLINE int __CRTDECL _cprintf_p(
246  _In_z_ _Printf_format_string_ char const* const _Format,
247  ...)
248 #if defined _NO_CRT_STDIO_INLINE
249 ;
250 #else
251  {
252  int _Result;
254  __crt_va_start(_ArgList, _Format);
255  _Result = _vcprintf_p_l(_Format, NULL, _ArgList);
256  __crt_va_end(_ArgList);
257  return _Result;
258  }
259 #endif
260 
261 
262  //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
263  //
264  // Narrow Character Formatted Input Functions (Console)
265  //
266  //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
268  _DCRTIMP int __cdecl __conio_common_vcscanf(
269  _In_ unsigned __int64 _Options,
270  _In_z_ _Scanf_format_string_params_(2) char const* _Format,
271  _In_opt_ _locale_t _Locale,
272  va_list _ArgList
273  );
274 
276  _CRT_STDIO_INLINE int __CRTDECL _vcscanf_l(
277  _In_z_ _Scanf_format_string_params_(2) char const* const _Format,
278  _In_opt_ _locale_t const _Locale,
279  va_list _ArgList
280  )
281 #if defined _NO_CRT_STDIO_INLINE
282 ;
283 #else
284  {
285  return __conio_common_vcscanf(
287  _Format, _Locale, _ArgList);
288  }
289 #endif
290 
292  _CRT_STDIO_INLINE int __CRTDECL _vcscanf(
293  _In_z_ _Scanf_format_string_params_(1) char const* const _Format,
294  va_list _ArgList
295  )
296 #if defined _NO_CRT_STDIO_INLINE
297 ;
298 #else
299  {
300  #pragma warning(push)
301  #pragma warning(disable: 4996) // Deprecation
302  return _vcscanf_l(_Format, NULL, _ArgList);
303  #pragma warning(pop)
304  }
305 #endif
306 
308  _CRT_STDIO_INLINE int __CRTDECL _vcscanf_s_l(
309  _In_z_ _Scanf_format_string_params_(2) char const* const _Format,
310  _In_opt_ _locale_t const _Locale,
311  va_list _ArgList
312  )
313 #if defined _NO_CRT_STDIO_INLINE
314 ;
315 #else
316  {
317  return __conio_common_vcscanf(
319  _Format, _Locale, _ArgList);
320  }
321 #endif
322 
324  _CRT_STDIO_INLINE int __CRTDECL _vcscanf_s(
325  _In_z_ _Scanf_format_string_params_(1) char const* const _Format,
326  va_list _ArgList
327  )
328 #if defined _NO_CRT_STDIO_INLINE
329 ;
330 #else
331  {
332  return _vcscanf_s_l(_Format, NULL, _ArgList);
333  }
334 #endif
335 
337  _CRT_STDIO_INLINE int __CRTDECL _cscanf_l(
338  _In_z_ _Scanf_format_string_params_(0) char const* const _Format,
339  _In_opt_ _locale_t const _Locale,
340  ...)
341 #if defined _NO_CRT_STDIO_INLINE
342 ;
343 #else
344  {
345  int _Result;
347  __crt_va_start(_ArgList, _Locale);
348 
349  #pragma warning(push)
350  #pragma warning(disable: 4996) // Deprecation
351  _Result = _vcscanf_l(_Format, _Locale, _ArgList);
352  #pragma warning(pop)
353 
354  __crt_va_end(_ArgList);
355  return _Result;
356  }
357 #endif
358 
360  _CRT_STDIO_INLINE int __CRTDECL _cscanf(
361  _In_z_ _Scanf_format_string_ char const* const _Format,
362  ...)
363 #if defined _NO_CRT_STDIO_INLINE
364 ;
365 #else
366  {
367  int _Result;
369  __crt_va_start(_ArgList, _Format);
370 
371  #pragma warning(push)
372  #pragma warning(disable: 4996) // Deprecation
373  _Result = _vcscanf_l(_Format, NULL, _ArgList);
374  #pragma warning(pop)
375 
376  __crt_va_end(_ArgList);
377  return _Result;
378  }
379 #endif
380 
382  _CRT_STDIO_INLINE int __CRTDECL _cscanf_s_l(
383  _In_z_ _Scanf_format_string_params_(0) char const* const _Format,
384  _In_opt_ _locale_t const _Locale,
385  ...)
386 #if defined _NO_CRT_STDIO_INLINE
387 ;
388 #else
389  {
390  int _Result;
392  __crt_va_start(_ArgList, _Locale);
393  _Result = _vcscanf_s_l(_Format, _Locale, _ArgList);
394  __crt_va_end(_ArgList);
395  return _Result;
396  }
397 #endif
398 
400  _CRT_STDIO_INLINE int __CRTDECL _cscanf_s(
401  _In_z_ _Scanf_format_string_ char const* const _Format,
402  ...)
403 #if defined _NO_CRT_STDIO_INLINE
404 ;
405 #else
406  {
407  int _Result;
409  __crt_va_start(_ArgList, _Format);
410  _Result = _vcscanf_s_l(_Format, NULL, _ArgList);
411  __crt_va_end(_ArgList);
412  return _Result;
413  }
414 #endif
415 
416 
417  _DCRTIMP int __cdecl _kbhit(void);
418 
419  _Check_return_ _DCRTIMP int __cdecl _getch(void);
420  _Check_return_ _DCRTIMP int __cdecl _getche(void);
421  _Check_return_opt_ _DCRTIMP int __cdecl _putch (_In_ int _Ch);
422  _Check_return_opt_ _DCRTIMP int __cdecl _ungetch(_In_ int _Ch);
423 
424  _Check_return_ _DCRTIMP int __cdecl _getch_nolock (void);
425  _Check_return_ _DCRTIMP int __cdecl _getche_nolock (void);
426  _Check_return_opt_ _DCRTIMP int __cdecl _putch_nolock (_In_ int _Ch);
427  _Check_return_opt_ _DCRTIMP int __cdecl _ungetch_nolock(_In_ int _Ch);
428 
429  #if _CRT_INTERNAL_NONSTDC_NAMES
430 
431  // Suppress double-deprecation warnings:
432  #pragma warning(push)
433  #pragma warning(disable: 4141)
434 
435  _Success_(return != 0)
436  _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_cgets) _CRT_INSECURE_DEPRECATE(_cgets_s)
437  _DCRTIMP char* __cdecl cgets(
438  _At_(&_Buffer[0], _In_reads_(1))
439  _At_(&_Buffer[1], _Out_writes_(1))
440  _At_(&_Buffer[2], _Post_z_ _Out_writes_to_(_Buffer[0], _Buffer[1]))
441  char* _Buffer
442  );
443 
444  #pragma warning(pop)
445 
447  _DCRTIMP int __cdecl cputs(
448  _In_z_ char const* _String
449  );
450 
452  _DCRTIMP int __cdecl getch(void);
453 
455  _DCRTIMP int __cdecl getche(void);
456 
458  _DCRTIMP int __cdecl kbhit(void);
459 
461  _DCRTIMP int __cdecl putch(
462  _In_ int _Ch
463  );
464 
466  _DCRTIMP int __cdecl ungetch(
467  _In_ int _Ch
468  );
469 
471  _CRT_STDIO_INLINE int __CRTDECL cprintf(
472  _In_z_ _Printf_format_string_ char const* const _Format,
473  ...)
474 #if defined _NO_CRT_STDIO_INLINE
475 ;
476 #else
477  {
478  int _Result;
480  __crt_va_start(_ArgList, _Format);
481  _Result = _vcprintf_l(_Format, NULL, _ArgList);
482  __crt_va_end(_ArgList);
483  return _Result;
484  }
485 #endif
486 
488  _CRT_STDIO_INLINE int __CRTDECL cscanf(
489  _In_z_ _Scanf_format_string_ char const* const _Format,
490  ...)
491 #if defined _NO_CRT_STDIO_INLINE
492 ;
493 #else
494  {
495  int _Result;
497  __crt_va_start(_ArgList, _Format);
498 
499  #pragma warning(push)
500  #pragma warning(disable: 4996) // Deprecation
501  _Result = _vcscanf_l(_Format, NULL, _ArgList);
502  #pragma warning(pop)
503 
504  __crt_va_end(_ArgList);
505  return _Result;
506  }
507 #endif
508 
509  #endif // _CRT_INTERNAL_NONSTDC_NAMES
510 
511 #endif // _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
512 
513 
514 
#define _Out_
Definition: sal.h:342
return
Definition: corecrt_memcpy_s.h:60
Definition: corecrt.h:489
#define _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
Definition: corecrt_stdio_config.h:104
#define _Out_writes_to_(size, count)
Definition: sal.h:352
#define _CRT_INSECURE_DEPRECATE(_Replacement)
Definition: vcruntime.h:269
#define _CRT_STDIO_INLINE
Definition: corecrt_stdio_config.h:22
#define _Check_return_opt_
Definition: corecrt.h:96
#define _Out_writes_z_(size)
Definition: sal.h:349
int errno_t
Definition: corecrt.h:476
#define _Check_return_wat_
Definition: corecrt.h:102
_Check_return_wat_ *_SizeRead wchar_t _In_ size_t _BufferCount
Definition: corecrt_wconio.h:27
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
#define _At_(target, annos)
Definition: sal.h:241
_Check_return_ _In_z_ _Scanf_format_string_ wchar_t const *const _Format
Definition: corecrt_wstdio.h:855
#define __CRTDECL
Definition: vcruntime.h:156
#define _Post_z_
Definition: sal.h:688
#define _Check_return_
Definition: sal.h:554
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(_ReturnType, _FuncName, _DstType, _Dst, _TType1, _TArg1)
Definition: corecrt.h:692
_String
Definition: corecrt_wstring.h:355
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
#define _In_z_
Definition: sal.h:310
#define _In_
Definition: sal.h:305
#define _CRT_INTERNAL_LOCAL_SCANF_OPTIONS
Definition: corecrt_stdio_config.h:105
#define _In_opt_
Definition: sal.h:306
#define _DCRTIMP
Definition: corecrt.h:43
_Check_return_wat_ *_SizeRead wchar_t * _Buffer
Definition: corecrt_wconio.h:27
#define _Printf_format_string_params_(x)
Definition: sal.h:563
#define _CRT_NONSTDC_DEPRECATE(_NewName)
Definition: corecrt.h:300
#define _Printf_format_string_
Definition: sal.h:558
__crt_va_end(_ArgList)
_In_reads_(_N) wchar_t const *_S2
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76
#define _Scanf_format_string_
Definition: sal.h:559
#define _Out_writes_(size)
Definition: sal.h:345
#define __crt_va_start(ap, x)
Definition: vadefs.h:153
_Check_return_wat_ *_SizeRead wchar_t _In_ size_t _Out_ size_t * _SizeRead
Definition: corecrt_wconio.h:27
#define _CRT_INTERNAL_SCANF_SECURECRT
Definition: corecrt_stdio_config.h:116
_Check_return_opt_ _In_opt_ _locale_t const _Locale
Definition: corecrt_wconio.h:289
#define _Scanf_format_string_params_(x)
Definition: sal.h:564
#define _Success_(expr)
Definition: sal.h:256
char * va_list
Definition: vadefs.h:39
_Result
Definition: corecrt_wconio.h:362
#define NULL
Definition: corecrt.h:158
_Check_return_opt_ _In_opt_ _locale_t const va_list _ArgList
Definition: corecrt_wconio.h:295