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