2001-04-10 23:21:43 +00:00
|
|
|
/*
|
|
|
|
* 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
|
2008-12-11 21:37:34 +00:00
|
|
|
|
|
|
|
#include <crtdefs.h>
|
2001-04-10 23:21:43 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-12-17 13:45:18 +00:00
|
|
|
char* __cdecl _cgets(char*);
|
|
|
|
int __cdecl _cprintf(const char*,...);
|
|
|
|
int __cdecl _cputs(const char*);
|
|
|
|
int __cdecl _cscanf(const char*,...);
|
|
|
|
int __cdecl _getch(void);
|
|
|
|
int __cdecl _getche(void);
|
|
|
|
int __cdecl _kbhit(void);
|
|
|
|
int __cdecl _putch(int);
|
|
|
|
int __cdecl _ungetch(int);
|
2001-04-10 23:21:43 +00:00
|
|
|
|
|
|
|
#ifdef _M_IX86
|
2008-12-17 13:45:18 +00:00
|
|
|
int __cdecl _inp(unsigned short);
|
2009-05-23 09:38:59 +00:00
|
|
|
__msvcrt_ulong __cdecl _inpd(unsigned short);
|
2008-12-17 13:45:18 +00:00
|
|
|
unsigned short __cdecl _inpw(unsigned short);
|
|
|
|
int __cdecl _outp(unsigned short, int);
|
2009-05-23 09:38:59 +00:00
|
|
|
__msvcrt_ulong __cdecl _outpd(unsigned short, __msvcrt_ulong);
|
2008-12-17 13:45:18 +00:00
|
|
|
unsigned short __cdecl _outpw(unsigned short, unsigned short);
|
2001-04-10 23:21:43 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2003-03-22 21:15:41 +00:00
|
|
|
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); }
|
2001-04-10 23:21:43 +00:00
|
|
|
#ifdef _M_IX86
|
2003-03-22 21:15:41 +00:00
|
|
|
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); }
|
2001-04-10 23:21:43 +00:00
|
|
|
#endif
|
2003-03-26 01:29:56 +00:00
|
|
|
|
2005-04-25 10:48:59 +00:00
|
|
|
#if defined(__GNUC__) && (__GNUC__ < 4)
|
2008-12-17 13:45:18 +00:00
|
|
|
extern int __cdecl cprintf(const char*,...) __attribute__((alias("_cprintf"),format(printf,1,2)));
|
|
|
|
extern int __cdecl cscanf(const char*,...) __attribute__((alias("_cscanf"),format(scanf,1,2)));
|
2003-03-26 01:29:56 +00:00
|
|
|
#else
|
|
|
|
#define cprintf _cprintf
|
|
|
|
#define cscanf _cscanf
|
|
|
|
#endif /* __GNUC__ */
|
|
|
|
|
2001-04-10 23:21:43 +00:00
|
|
|
#endif /* __WINE_CONIO_H */
|