zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

conio.h (13078B) - Raw


      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 #ifndef _INC_CONIO
      7 #define _INC_CONIO
      8 
      9 #include <crtdefs.h>
     10 #include <corecrt_stdio_config.h>
     11 #include <stddef.h>
     12 
     13 #ifdef __cplusplus
     14 extern "C" {
     15 #endif
     16 
     17   _CRTIMP char *_cgets(char *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
     18   _CRTIMP int __cdecl _cputs(const char *_Str);
     19   _CRTIMP int __cdecl _getch(void);
     20   _CRTIMP int __cdecl _getche(void);
     21   _CRTIMP int __cdecl _kbhit(void);
     22 
     23 #ifdef _UCRT
     24   int __cdecl __conio_common_vcprintf(unsigned __int64 _Options, const char *_Format, _locale_t _Locale, va_list _ArgList);
     25   int __cdecl __conio_common_vcprintf_p(unsigned __int64 _Options, const char *_Format, _locale_t _Locale, va_list _ArgList);
     26   int __cdecl __conio_common_vcprintf_s(unsigned __int64 _Options, const char *_Format, _locale_t _Locale, va_list _ArgList);
     27   int __cdecl __conio_common_vcscanf(unsigned __int64 _Options, const char *_Format, _locale_t _Locale, va_list _ArgList);
     28 
     29   __mingw_ovr int __cdecl _vcprintf(const char * __restrict__ _Format,va_list _ArgList)
     30   {
     31     return __conio_common_vcprintf(0, _Format, NULL, _ArgList);
     32   }
     33   __mingw_ovr int __cdecl _cprintf(const char * __restrict__ _Format,...)
     34   {
     35     __builtin_va_list _ArgList;
     36     int _Ret;
     37     __builtin_va_start(_ArgList, _Format);
     38     _Ret = _vcprintf(_Format, _ArgList);
     39     __builtin_va_end(_ArgList);
     40     return _Ret;
     41   }
     42   __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN
     43   int __cdecl _cscanf(const char * __restrict__ _Format,...)
     44   {
     45     __builtin_va_list _ArgList;
     46     int _Ret;
     47     __builtin_va_start(_ArgList, _Format);
     48     _Ret = __conio_common_vcscanf(0, _Format, NULL, _ArgList);
     49     __builtin_va_end(_ArgList);
     50     return _Ret;
     51   }
     52   __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN
     53   int __cdecl _cscanf_l(const char * __restrict__ _Format,_locale_t _Locale,...)
     54   {
     55     __builtin_va_list _ArgList;
     56     int _Ret;
     57     __builtin_va_start(_ArgList, _Locale);
     58     _Ret = __conio_common_vcscanf(0, _Format, _Locale, _ArgList);
     59     __builtin_va_end(_ArgList);
     60     return _Ret;
     61   }
     62 
     63   __mingw_ovr int __cdecl _vcprintf_p(const char * __restrict__ _Format,va_list _ArgList)
     64   {
     65     return __conio_common_vcprintf_p(0, _Format, NULL, _ArgList);
     66   }
     67   __mingw_ovr int __cdecl _cprintf_p(const char * __restrict__ _Format,...)
     68   {
     69     __builtin_va_list _ArgList;
     70     int _Ret;
     71     __builtin_va_start(_ArgList, _Format);
     72     _Ret = _vcprintf_p(_Format, _ArgList);
     73     __builtin_va_end(_ArgList);
     74     return _Ret;
     75   }
     76   __mingw_ovr int __cdecl _vcprintf_l(const char * __restrict__ _Format,_locale_t _Locale,va_list _ArgList)
     77   {
     78     return __conio_common_vcprintf(0, _Format, _Locale, _ArgList);
     79   }
     80   __mingw_ovr int __cdecl _cprintf_l(const char * __restrict__ _Format,_locale_t _Locale,...)
     81   {
     82     __builtin_va_list _ArgList;
     83     int _Ret;
     84     __builtin_va_start(_ArgList, _Locale);
     85     _Ret = _vcprintf_l(_Format, _Locale, _ArgList);
     86     __builtin_va_end(_ArgList);
     87     return _Ret;
     88   }
     89   __mingw_ovr int __cdecl _vcprintf_p_l(const char * __restrict__ _Format,_locale_t _Locale,va_list _ArgList)
     90   {
     91     return __conio_common_vcprintf_p(0, _Format, _Locale, _ArgList);
     92   }
     93   __mingw_ovr int __cdecl _cprintf_p_l(const char * __restrict__ _Format,_locale_t _Locale,...)
     94   {
     95     __builtin_va_list _ArgList;
     96     int _Ret;
     97     __builtin_va_start(_ArgList, _Locale);
     98     _Ret = _vcprintf_p_l(_Format, _Locale, _ArgList);
     99     __builtin_va_end(_ArgList);
    100     return _Ret;
    101   }
    102 #else
    103   _CRTIMP int __cdecl _cprintf(const char * __restrict__ _Format,...);
    104   _CRTIMP int __cdecl _cscanf(const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    105   _CRTIMP int __cdecl _cscanf_l(const char * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    106 
    107   _CRTIMP int __cdecl _vcprintf(const char * __restrict__ _Format,va_list _ArgList);
    108   _CRTIMP int __cdecl _cprintf_p(const char * __restrict__ _Format,...);
    109   _CRTIMP int __cdecl _vcprintf_p(const char * __restrict__ _Format,va_list _ArgList);
    110   _CRTIMP int __cdecl _cprintf_l(const char * __restrict__ _Format,_locale_t _Locale,...);
    111   _CRTIMP int __cdecl _vcprintf_l(const char * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
    112   _CRTIMP int __cdecl _cprintf_p_l(const char * __restrict__ _Format,_locale_t _Locale,...);
    113   _CRTIMP int __cdecl _vcprintf_p_l(const char * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
    114 #endif
    115 
    116 #if defined(_X86_) && !defined(__x86_64)
    117   int __cdecl _inp(unsigned short);
    118   unsigned short __cdecl _inpw(unsigned short);
    119   unsigned long __cdecl _inpd(unsigned short);
    120   int __cdecl _outp(unsigned short,int);
    121   unsigned short __cdecl _outpw(unsigned short,unsigned short);
    122   unsigned long __cdecl _outpd(unsigned short,unsigned long);
    123 #endif
    124 
    125   _CRTIMP int __cdecl _putch(int _Ch);
    126   _CRTIMP int __cdecl _ungetch(int _Ch);
    127 #if __MSVCRT_VERSION__ >= 0x800
    128   _CRTIMP int __cdecl _getch_nolock(void);
    129   _CRTIMP int __cdecl _getche_nolock(void);
    130   _CRTIMP int __cdecl _putch_nolock(int _Ch);
    131   _CRTIMP int __cdecl _ungetch_nolock(int _Ch);
    132 #endif
    133 
    134 #ifndef _WCONIO_DEFINED
    135 #define _WCONIO_DEFINED
    136 
    137 #ifndef WEOF
    138 #define WEOF (wint_t)(0xFFFF)
    139 #endif
    140 
    141   _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    142   _CRTIMP wint_t __cdecl _getwch(void);
    143   _CRTIMP wint_t __cdecl _getwche(void);
    144   _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh);
    145   _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh);
    146   _CRTIMP int __cdecl _cputws(const wchar_t *_String);
    147 #ifdef _UCRT
    148   int __cdecl __conio_common_vcwprintf(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
    149   int __cdecl __conio_common_vcwprintf_p(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
    150   int __cdecl __conio_common_vcwprintf_s(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
    151   int __cdecl __conio_common_vcwscanf(unsigned __int64 _Options, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
    152 
    153   __mingw_ovr int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList)
    154   {
    155     return __conio_common_vcwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, NULL, _ArgList);
    156   }
    157   __mingw_ovr int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...)
    158   {
    159     __builtin_va_list _ArgList;
    160     int _Ret;
    161     __builtin_va_start(_ArgList, _Format);
    162     _Ret = _vcwprintf(_Format, _ArgList);
    163     __builtin_va_end(_ArgList);
    164     return _Ret;
    165   }
    166   __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN
    167   int __cdecl _cwscanf(const wchar_t * __restrict__ _Format,...)
    168   {
    169     __builtin_va_list _ArgList;
    170     int _Ret;
    171     __builtin_va_start(_ArgList, _Format);
    172     _Ret = __conio_common_vcwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Format, NULL, _ArgList);
    173     __builtin_va_end(_ArgList);
    174     return _Ret;
    175   }
    176   __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN
    177   int __cdecl _cwscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...)
    178   {
    179     __builtin_va_list _ArgList;
    180     int _Ret;
    181     __builtin_va_start(_ArgList, _Locale);
    182     _Ret = __conio_common_vcwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Format, _Locale, _ArgList);
    183     __builtin_va_end(_ArgList);
    184     return _Ret;
    185   }
    186   __mingw_ovr int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList)
    187   {
    188     return __conio_common_vcwprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, NULL, _ArgList);
    189   }
    190   __mingw_ovr int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...)
    191   {
    192     __builtin_va_list _ArgList;
    193     int _Ret;
    194     __builtin_va_start(_ArgList, _Format);
    195     _Ret = _vcwprintf_p(_Format, _ArgList);
    196     __builtin_va_end(_ArgList);
    197     return _Ret;
    198   }
    199   __mingw_ovr int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList)
    200   {
    201     return __conio_common_vcwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, _Locale, _ArgList);
    202   }
    203   __mingw_ovr int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...)
    204   {
    205     __builtin_va_list _ArgList;
    206     int _Ret;
    207     __builtin_va_start(_ArgList, _Locale);
    208     _Ret = _vcwprintf_l(_Format, _Locale, _ArgList);
    209     __builtin_va_end(_ArgList);
    210     return _Ret;
    211   }
    212   __mingw_ovr int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList)
    213   {
    214     return __conio_common_vcwprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, _Locale, _ArgList);
    215   }
    216   __mingw_ovr int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...)
    217   {
    218     __builtin_va_list _ArgList;
    219     int _Ret;
    220     __builtin_va_start(_ArgList, _Locale);
    221     _Ret = _vcwprintf_p_l(_Format, _Locale, _ArgList);
    222     __builtin_va_end(_ArgList);
    223     return _Ret;
    224   }
    225 #else
    226   _CRTIMP int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...);
    227   _CRTIMP int __cdecl _cwscanf(const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    228   _CRTIMP int __cdecl _cwscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    229   _CRTIMP int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
    230   _CRTIMP int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...);
    231   _CRTIMP int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList);
    232   _CRTIMP int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
    233   _CRTIMP int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
    234   _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
    235   _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
    236 #endif
    237 #if __MSVCRT_VERSION__ >= 0x800
    238   _CRTIMP wint_t __cdecl _putwch_nolock(wchar_t _WCh);
    239   _CRTIMP wint_t __cdecl _getwch_nolock(void);
    240   _CRTIMP wint_t __cdecl _getwche_nolock(void);
    241   _CRTIMP wint_t __cdecl _ungetwch_nolock(wint_t _WCh);
    242 #endif
    243 #endif
    244 
    245 #ifndef	NO_OLDNAMES
    246   char *__cdecl cgets(char *_Buffer) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    247 
    248 #ifdef _UCRT
    249   __mingw_ovr int __cdecl cprintf(const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005
    250   {
    251     __builtin_va_list _ArgList;
    252     int _Ret;
    253     __builtin_va_start(_ArgList, _Format);
    254     _Ret = _vcprintf(_Format, _ArgList);
    255     __builtin_va_end(_ArgList);
    256     return _Ret;
    257   }
    258   __mingw_ovr int __cdecl cscanf(const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005
    259   {
    260     __builtin_va_list _ArgList;
    261     int _Ret;
    262     __builtin_va_start(_ArgList, _Format);
    263     _Ret = __conio_common_vcscanf(0, _Format, NULL, _ArgList);
    264     __builtin_va_end(_ArgList);
    265     return _Ret;
    266   }
    267 #else
    268   int __cdecl cprintf(const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    269   int __cdecl cscanf(const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    270 #endif
    271   int __cdecl cputs(const char *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    272   int __cdecl getch(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    273   int __cdecl getche(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    274   int __cdecl kbhit(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    275   int __cdecl putch(int _Ch) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    276   int __cdecl ungetch(int _Ch) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    277 
    278 #if (defined(_X86_) && !defined(__x86_64))
    279   int __cdecl inp(unsigned short) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    280   unsigned short __cdecl inpw(unsigned short) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    281   int __cdecl outp(unsigned short,int) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    282   unsigned short __cdecl outpw(unsigned short,unsigned short) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    283 #endif
    284 
    285     /* __cpuid moved to intrin.h per msdn */
    286     /* __inbyte moved to intrin.h per msdn */
    287     /* __inbytestring moved to intrin.h per msdn */
    288     /* __indword moved to intrin.h per msdn */
    289     /* __indwordstring moved to intrin.h per msdn */
    290     /* __inword moved to intrin.h per msdn */
    291     /* __inwordstring moved to intrin.h per msdn */
    292     /* __outbyte moved to intrin.h per msdn */
    293     /* __outbytestring moved to intrin.h per msdn */
    294     /* __outdword moved to intrin.h per msdn */
    295     /* __outdwordstring moved to intrin.h per msdn */
    296     /* __outword moved to intrin.h per msdn */
    297     /* __outwordstring moved to intrin.h per msdn */
    298     /* __readcr0 moved to intrin.h per msdn */
    299     /* __readcr2 moved to intrin.h per msdn */
    300     /* __readcr3 moved to intrin.h per msdn */
    301     /* __readcr4 moved to intrin.h per msdn */
    302     /* __readcr8 moved to intrin.h per msdn */
    303     /* __readmsr moved to intrin.h per msdn */
    304     /* __writecr0 moved to intrin.h per msdn */
    305     /* __writecr2 moved to intrin.h per msdn */
    306     /* __writecr3 moved to intrin.h per msdn */
    307     /* __writecr4 moved to intrin.h per msdn */
    308     /* __writecr8 moved to intrin.h per msdn */
    309     /* __writemsr moved to intrin.h per msdn */
    310 #endif
    311 
    312 #ifdef __cplusplus
    313 }
    314 #endif
    315 
    316 #include <sec_api/conio_s.h>
    317 
    318 #endif