conio.h 1.97 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*
 * Console I/O definitions
 *
 * Derived from the mingw header written by Colin Peters.
 * Modified for Wine use by Jon Griffiths and Francois Gouget.
 * This file is in the public domain.
 */
#ifndef __WINE_CONIO_H
#define __WINE_CONIO_H
10 11

#include <crtdefs.h>
12 13 14 15 16

#ifdef __cplusplus
extern "C" {
#endif

17
char* __cdecl _cgets(char*);
18
int   WINAPIV _cprintf(const char*,...);
19
int   __cdecl _cputs(const char*);
20
int   WINAPIV _cscanf(const char*,...);
21 22 23 24 25
int   __cdecl _getch(void);
int   __cdecl _getche(void);
int   __cdecl _kbhit(void);
int   __cdecl _putch(int);
int   __cdecl _ungetch(int);
26 27

#ifdef _M_IX86
28
int            __cdecl _inp(unsigned short);
29
__msvcrt_ulong __cdecl _inpd(unsigned short);
30 31
unsigned short __cdecl _inpw(unsigned short);
int            __cdecl _outp(unsigned short, int);
32
__msvcrt_ulong __cdecl _outpd(unsigned short, __msvcrt_ulong);
33
unsigned short __cdecl _outpw(unsigned short, unsigned short);
34 35 36 37 38 39 40
#endif

#ifdef __cplusplus
}
#endif


41 42 43 44 45 46 47
static inline char* cgets(char* str) { return _cgets(str); }
static inline int cputs(const char* str) { return _cputs(str); }
static inline int getch(void) { return _getch(); }
static inline int getche(void) { return _getche(); }
static inline int kbhit(void) { return _kbhit(); }
static inline int putch(int c) { return _putch(c); }
static inline int ungetch(int c) { return _ungetch(c); }
48
#ifdef _M_IX86
49 50 51 52
static inline int inp(unsigned short i) { return _inp(i); }
static inline unsigned short inpw(unsigned short i) { return _inpw(i); }
static inline int outp(unsigned short i, int j) { return _outp(i, j); }
static inline unsigned short outpw(unsigned short i, unsigned short j) { return _outpw(i, j); }
53
#endif
54

Marcus Meissner's avatar
Marcus Meissner committed
55
#if defined(__GNUC__) && (__GNUC__ < 4)
56 57
extern int WINAPIV cprintf(const char*,...) __attribute__((alias("_cprintf"),format(printf,1,2)));
extern int WINAPIV cscanf(const char*,...) __attribute__((alias("_cscanf"),format(scanf,1,2)));
58 59 60 61 62
#else
#define cprintf _cprintf
#define cscanf _cscanf
#endif /* __GNUC__ */

63
#endif /* __WINE_CONIO_H */