home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / conio.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  3KB  |  115 lines

  1. /***
  2. *conio.h - console and port I/O declarations
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This include file contains the function declarations for
  8. *       the MS C V2.03 compatible console I/O routines.
  9. *
  10. *       [Public]
  11. *
  12. ****/
  13.  
  14. #if     _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17.  
  18. #ifndef _INC_CONIO
  19. #define _INC_CONIO
  20.  
  21. #if     !defined(_WIN32) && !defined(_MAC)
  22. #error ERROR: Only Mac or Win32 targets supported!
  23. #endif
  24.  
  25.  
  26. #ifndef _MAC
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32.  
  33.  
  34. /* Define _CRTIMP */
  35.  
  36. #ifndef _CRTIMP
  37. #ifdef  _DLL
  38. #define _CRTIMP __declspec(dllimport)
  39. #else   /* ndef _DLL */
  40. #define _CRTIMP
  41. #endif  /* _DLL */
  42. #endif  /* _CRTIMP */
  43.  
  44.  
  45. /* Define __cdecl for non-Microsoft compilers */
  46.  
  47. #if     ( !defined(_MSC_VER) && !defined(__cdecl) )
  48. #define __cdecl
  49. #endif
  50.  
  51. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  52.  
  53. #ifndef _CRTAPI1
  54. #if    _MSC_VER >= 800 && _M_IX86 >= 300
  55. #define _CRTAPI1 __cdecl
  56. #else
  57. #define _CRTAPI1
  58. #endif
  59. #endif
  60.  
  61. /* Function prototypes */
  62.  
  63. _CRTIMP char * __cdecl _cgets(char *);
  64. _CRTIMP int __cdecl _cprintf(const char *, ...);
  65. _CRTIMP int __cdecl _cputs(const char *);
  66. _CRTIMP int __cdecl _cscanf(const char *, ...);
  67. _CRTIMP int __cdecl _getch(void);
  68. _CRTIMP int __cdecl _getche(void);
  69. #ifdef  _M_IX86
  70. int __cdecl _inp(unsigned short);
  71. unsigned short __cdecl _inpw(unsigned short);
  72. unsigned long __cdecl _inpd(unsigned short);
  73. #endif  /* _M_IX86 */
  74. _CRTIMP int __cdecl _kbhit(void);
  75. #ifdef  _M_IX86
  76. int __cdecl _outp(unsigned short, int);
  77. unsigned short __cdecl _outpw(unsigned short, unsigned short);
  78. unsigned long __cdecl _outpd(unsigned short, unsigned long);
  79. #endif  /* _M_IX86 */
  80. _CRTIMP int __cdecl _putch(int);
  81. _CRTIMP int __cdecl _ungetch(int);
  82.  
  83.  
  84. #if     !__STDC__
  85.  
  86. /* Non-ANSI names for compatibility */
  87.  
  88. _CRTIMP char * __cdecl cgets(char *);
  89. _CRTIMP int __cdecl cprintf(const char *, ...);
  90. _CRTIMP int __cdecl cputs(const char *);
  91. _CRTIMP int __cdecl cscanf(const char *, ...);
  92. #ifdef  _M_IX86
  93. int __cdecl inp(unsigned short);
  94. unsigned short __cdecl inpw(unsigned short);
  95. #endif  /* _M_IX86 */
  96. _CRTIMP int __cdecl getch(void);
  97. _CRTIMP int __cdecl getche(void);
  98. _CRTIMP int __cdecl kbhit(void);
  99. #ifdef  _M_IX86
  100. int __cdecl outp(unsigned short, int);
  101. unsigned short __cdecl outpw(unsigned short, unsigned short);
  102. #endif  /* _M_IX86 */
  103. _CRTIMP int __cdecl putch(int);
  104. _CRTIMP int __cdecl ungetch(int);
  105.  
  106. #endif  /* __STDC__ */
  107.  
  108. #ifdef  __cplusplus
  109. }
  110. #endif
  111.  
  112. #endif  /* _MAC */
  113.  
  114. #endif  /* _INC_CONIO */
  115.