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.

133 lines
2.8 KiB

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