home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / dos.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  4KB  |  139 lines

  1. /***
  2. *dos.h - definitions for MS-DOS interface routines
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Defines the structs and unions used for the direct DOS interface
  8. *       routines; includes macros to access the segment and offset
  9. *       values of far pointers, so that they may be used by the routines; and
  10. *       provides function prototypes for direct DOS interface functions.
  11. *
  12. *       [Public]
  13. *
  14. ****/
  15.  
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif  /* _MSC_VER > 1000 */
  19.  
  20. #ifndef _INC_DOS
  21. #define _INC_DOS
  22.  
  23. #if !defined (_WIN32) && !defined (_MAC)
  24. #error ERROR: Only Mac or Win32 targets supported!
  25. #endif  /* !defined (_WIN32) && !defined (_MAC) */
  26.  
  27. #ifndef _CRTBLD
  28. /* This version of the header files is NOT for user programs.
  29.  * It is intended for use when building the C runtimes ONLY.
  30.  * The version intended for public use will not have this message.
  31.  */
  32. #error ERROR: Use of C runtime library internal header file.
  33. #endif  /* _CRTBLD */
  34.  
  35. #ifdef _MSC_VER
  36. /*
  37.  * Currently, all MS C compilers for Win32 platforms default to 8 byte
  38.  * alignment.
  39.  */
  40. #pragma pack(push,8)
  41. #endif  /* _MSC_VER */
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif  /* __cplusplus */
  46.  
  47. #ifndef _INTERNAL_IFSTRIP_
  48. #include <cruntime.h>
  49. #endif  /* _INTERNAL_IFSTRIP_ */
  50.  
  51.  
  52. /* Define _CRTIMP */
  53.  
  54. #ifndef _CRTIMP
  55. #ifdef CRTDLL
  56. #define _CRTIMP __declspec(dllexport)
  57. #else  /* CRTDLL */
  58. #ifdef _DLL
  59. #define _CRTIMP __declspec(dllimport)
  60. #else  /* _DLL */
  61. #define _CRTIMP
  62. #endif  /* _DLL */
  63. #endif  /* CRTDLL */
  64. #endif  /* _CRTIMP */
  65.  
  66.  
  67. /* Define __cdecl for non-Microsoft compilers */
  68.  
  69. #if (!defined (_MSC_VER) && !defined (__cdecl))
  70. #define __cdecl
  71. #endif  /* (!defined (_MSC_VER) && !defined (__cdecl)) */
  72.  
  73. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  74.  
  75. #ifndef _CRTAPI1
  76. #if _MSC_VER >= 800 && _M_IX86 >= 300
  77. #define _CRTAPI1 __cdecl
  78. #else  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  79. #define _CRTAPI1
  80. #endif  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  81. #endif  /* _CRTAPI1 */
  82.  
  83. #ifndef _MAC
  84. #ifndef _WCHAR_T_DEFINED
  85. typedef unsigned short wchar_t;
  86. #define _WCHAR_T_DEFINED
  87. #endif  /* _WCHAR_T_DEFINED */
  88. #endif  /* _MAC */
  89.  
  90. #ifndef _MAC
  91. #ifndef _DISKFREE_T_DEFINED
  92. /* _getdiskfree structure (duplicated in DIRECT.H) */
  93. struct _diskfree_t {
  94.         unsigned total_clusters;
  95.         unsigned avail_clusters;
  96.         unsigned sectors_per_cluster;
  97.         unsigned bytes_per_sector;
  98.         };
  99.  
  100. #define _DISKFREE_T_DEFINED
  101. #endif  /* _DISKFREE_T_DEFINED */
  102. #endif  /* _MAC */
  103.  
  104. /* File attribute constants */
  105.  
  106. #define _A_NORMAL       0x00    /* Normal file - No read/write restrictions */
  107. #define _A_RDONLY       0x01    /* Read only file */
  108. #define _A_HIDDEN       0x02    /* Hidden file */
  109. #define _A_SYSTEM       0x04    /* System file */
  110. #define _A_SUBDIR       0x10    /* Subdirectory */
  111. #define _A_ARCH         0x20    /* Archive file */
  112.  
  113. #ifndef _MAC
  114. /* Function prototypes */
  115. _CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *);
  116. #endif  /* _MAC */
  117.  
  118. #ifdef _M_IX86
  119. void __cdecl _disable(void);
  120. void __cdecl _enable(void);
  121. #endif  /* _M_IX86 */
  122.  
  123. #ifndef _MAC
  124. #if !__STDC__
  125. /* Non-ANSI name for compatibility */
  126. #define diskfree_t  _diskfree_t
  127. #endif  /* !__STDC__ */
  128. #endif  /* _MAC */
  129.  
  130. #ifdef __cplusplus
  131. }
  132. #endif  /* __cplusplus */
  133.  
  134. #ifdef _MSC_VER
  135. #pragma pack(pop)
  136. #endif  /* _MSC_VER */
  137.  
  138. #endif  /* _INC_DOS */
  139.