Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
2.9 KiB

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