1 | /*
|
---|
2 | * Console I/O definitions
|
---|
3 | *
|
---|
4 | * Derived from the mingw header written by Colin Peters.
|
---|
5 | * Modified for Wine use by Jon Griffiths and Francois Gouget.
|
---|
6 | * This file is in the public domain.
|
---|
7 | */
|
---|
8 |
|
---|
9 | /*
|
---|
10 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
11 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
12 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
13 | * a choice of LGPL license versions is made available with the language indicating
|
---|
14 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
15 | * of the LGPL is applied is otherwise unspecified.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef __WINE_CONIO_H
|
---|
19 | #define __WINE_CONIO_H
|
---|
20 |
|
---|
21 | #include <crtdefs.h>
|
---|
22 |
|
---|
23 | #ifdef __cplusplus
|
---|
24 | extern "C" {
|
---|
25 | #endif
|
---|
26 |
|
---|
27 | char* __cdecl _cgets(char*);
|
---|
28 | int __cdecl _cprintf(const char*,...);
|
---|
29 | int __cdecl _cputs(const char*);
|
---|
30 | int __cdecl _cscanf(const char*,...);
|
---|
31 | int __cdecl _getch(void);
|
---|
32 | int __cdecl _getche(void);
|
---|
33 | int __cdecl _kbhit(void);
|
---|
34 | int __cdecl _putch(int);
|
---|
35 | int __cdecl _ungetch(int);
|
---|
36 |
|
---|
37 | #ifdef _M_IX86
|
---|
38 | int __cdecl _inp(unsigned short);
|
---|
39 | __msvcrt_ulong __cdecl _inpd(unsigned short);
|
---|
40 | unsigned short __cdecl _inpw(unsigned short);
|
---|
41 | int __cdecl _outp(unsigned short, int);
|
---|
42 | __msvcrt_ulong __cdecl _outpd(unsigned short, __msvcrt_ulong);
|
---|
43 | unsigned short __cdecl _outpw(unsigned short, unsigned short);
|
---|
44 | #endif
|
---|
45 |
|
---|
46 | #ifdef __cplusplus
|
---|
47 | }
|
---|
48 | #endif
|
---|
49 |
|
---|
50 |
|
---|
51 | static inline char* cgets(char* str) { return _cgets(str); }
|
---|
52 | static inline int cputs(const char* str) { return _cputs(str); }
|
---|
53 | static inline int getch(void) { return _getch(); }
|
---|
54 | static inline int getche(void) { return _getche(); }
|
---|
55 | static inline int kbhit(void) { return _kbhit(); }
|
---|
56 | static inline int putch(int c) { return _putch(c); }
|
---|
57 | static inline int ungetch(int c) { return _ungetch(c); }
|
---|
58 | #ifdef _M_IX86
|
---|
59 | static inline int inp(unsigned short i) { return _inp(i); }
|
---|
60 | static inline unsigned short inpw(unsigned short i) { return _inpw(i); }
|
---|
61 | static inline int outp(unsigned short i, int j) { return _outp(i, j); }
|
---|
62 | static inline unsigned short outpw(unsigned short i, unsigned short j) { return _outpw(i, j); }
|
---|
63 | #endif
|
---|
64 |
|
---|
65 | #if defined(__GNUC__) && (__GNUC__ < 4)
|
---|
66 | extern int __cdecl cprintf(const char*,...) __attribute__((alias("_cprintf"),format(printf,1,2)));
|
---|
67 | extern int __cdecl cscanf(const char*,...) __attribute__((alias("_cscanf"),format(scanf,1,2)));
|
---|
68 | #else
|
---|
69 | #define cprintf _cprintf
|
---|
70 | #define cscanf _cscanf
|
---|
71 | #endif /* __GNUC__ */
|
---|
72 |
|
---|
73 | #endif /* __WINE_CONIO_H */
|
---|