home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / conio.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  4KB  |  140 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  /* _MSC_VER > 1000 */
  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  /* !defined (_WIN32) && !defined (_MAC) */
  24.  
  25. #ifndef _CRTBLD
  26. /* This version of the header files is NOT for user programs.
  27.  * It is intended for use when building the C runtimes ONLY.
  28.  * The version intended for public use will not have this message.
  29.  */
  30. #error ERROR: Use of C runtime library internal header file.
  31. #endif  /* _CRTBLD */
  32.  
  33. #ifndef _MAC
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif  /* __cplusplus */
  38.  
  39. #ifndef _INTERNAL_IFSTRIP_
  40. #include <cruntime.h>
  41. #endif  /* _INTERNAL_IFSTRIP_ */
  42.  
  43.  
  44. /* Define _CRTIMP */
  45.  
  46. #ifndef _CRTIMP
  47. #ifdef CRTDLL
  48. #define _CRTIMP __declspec(dllexport)
  49. #else  /* CRTDLL */
  50. #ifdef _DLL
  51. #define _CRTIMP __declspec(dllimport)
  52. #else  /* _DLL */
  53. #define _CRTIMP
  54. #endif  /* _DLL */
  55. #endif  /* CRTDLL */
  56. #endif  /* _CRTIMP */
  57.  
  58.  
  59. /* Define __cdecl for non-Microsoft compilers */
  60.  
  61. #if (!defined (_MSC_VER) && !defined (__cdecl))
  62. #define __cdecl
  63. #endif  /* (!defined (_MSC_VER) && !defined (__cdecl)) */
  64.  
  65. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  66.  
  67. #ifndef _CRTAPI1
  68. #if _MSC_VER >= 800 && _M_IX86 >= 300
  69. #define _CRTAPI1 __cdecl
  70. #else  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  71. #define _CRTAPI1
  72. #endif  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  73. #endif  /* _CRTAPI1 */
  74.  
  75. /* Function prototypes */
  76.  
  77. _CRTIMP char * __cdecl _cgets(char *);
  78. _CRTIMP int __cdecl _cprintf(const char *, ...);
  79. _CRTIMP int __cdecl _cputs(const char *);
  80. _CRTIMP int __cdecl _cscanf(const char *, ...);
  81. _CRTIMP int __cdecl _getch(void);
  82. _CRTIMP int __cdecl _getche(void);
  83. #ifdef _M_IX86
  84. int __cdecl _inp(unsigned short);
  85. unsigned short __cdecl _inpw(unsigned short);
  86. unsigned long __cdecl _inpd(unsigned short);
  87. #endif  /* _M_IX86 */
  88. _CRTIMP int __cdecl _kbhit(void);
  89. #ifdef _M_IX86
  90. int __cdecl _outp(unsigned short, int);
  91. unsigned short __cdecl _outpw(unsigned short, unsigned short);
  92. unsigned long __cdecl _outpd(unsigned short, unsigned long);
  93. #endif  /* _M_IX86 */
  94. _CRTIMP int __cdecl _putch(int);
  95. _CRTIMP int __cdecl _ungetch(int);
  96.  
  97. #ifdef _MT
  98. int __cdecl _getch_lk(void);                                /* _MTHREAD_ONLY */
  99. int __cdecl _getche_lk(void);                               /* _MTHREAD_ONLY */
  100. int __cdecl _putch_lk(int);                                 /* _MTHREAD_ONLY */
  101. int __cdecl _ungetch_lk(int);                               /* _MTHREAD_ONLY */
  102. #else  /* _MT */
  103. #define _getch_lk()             _getch()                    /* _MTHREAD_ONLY */
  104. #define _getche_lk()            _getche()                   /* _MTHREAD_ONLY */
  105. #define _putch_lk(c)            _putch(c)                   /* _MTHREAD_ONLY */
  106. #define _ungetch_lk(c)          _ungetch(c)                 /* _MTHREAD_ONLY */
  107. #endif  /* _MT */
  108.  
  109. #if !__STDC__
  110.  
  111. /* Non-ANSI names for compatibility */
  112.  
  113. _CRTIMP char * __cdecl cgets(char *);
  114. _CRTIMP int __cdecl cprintf(const char *, ...);
  115. _CRTIMP int __cdecl cputs(const char *);
  116. _CRTIMP int __cdecl cscanf(const char *, ...);
  117. #ifdef _M_IX86
  118. int __cdecl inp(unsigned short);
  119. unsigned short __cdecl inpw(unsigned short);
  120. #endif  /* _M_IX86 */
  121. _CRTIMP int __cdecl getch(void);
  122. _CRTIMP int __cdecl getche(void);
  123. _CRTIMP int __cdecl kbhit(void);
  124. #ifdef _M_IX86
  125. int __cdecl outp(unsigned short, int);
  126. unsigned short __cdecl outpw(unsigned short, unsigned short);
  127. #endif  /* _M_IX86 */
  128. _CRTIMP int __cdecl putch(int);
  129. _CRTIMP int __cdecl ungetch(int);
  130.  
  131. #endif  /* !__STDC__ */
  132.  
  133. #ifdef __cplusplus
  134. }
  135. #endif  /* __cplusplus */
  136.  
  137. #endif  /* _MAC */
  138.  
  139. #endif  /* _INC_CONIO */
  140.