home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / dos.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  3KB  |  125 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
  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
  26.  
  27.  
  28. #ifdef  _MSC_VER
  29. /*
  30.  * Currently, all MS C compilers for Win32 platforms default to 8 byte
  31.  * alignment.
  32.  */
  33. #pragma pack(push,8)
  34. #endif  /* _MSC_VER */
  35.  
  36. #ifdef  __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40.  
  41.  
  42. /* Define _CRTIMP */
  43.  
  44. #ifndef _CRTIMP
  45. #ifdef  _DLL
  46. #define _CRTIMP __declspec(dllimport)
  47. #else   /* ndef _DLL */
  48. #define _CRTIMP
  49. #endif  /* _DLL */
  50. #endif  /* _CRTIMP */
  51.  
  52.  
  53. /* Define __cdecl for non-Microsoft compilers */
  54.  
  55. #if     ( !defined(_MSC_VER) && !defined(__cdecl) )
  56. #define __cdecl
  57. #endif
  58.  
  59. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  60.  
  61. #ifndef _CRTAPI1
  62. #if    _MSC_VER >= 800 && _M_IX86 >= 300
  63. #define _CRTAPI1 __cdecl
  64. #else
  65. #define _CRTAPI1
  66. #endif
  67. #endif
  68.  
  69. #ifndef _MAC
  70. #ifndef _WCHAR_T_DEFINED
  71. typedef unsigned short wchar_t;
  72. #define _WCHAR_T_DEFINED
  73. #endif
  74. #endif /* ndef _MAC */
  75.  
  76. #ifndef _MAC
  77. #ifndef _DISKFREE_T_DEFINED
  78. /* _getdiskfree structure (duplicated in DIRECT.H) */
  79. struct _diskfree_t {
  80.         unsigned total_clusters;
  81.         unsigned avail_clusters;
  82.         unsigned sectors_per_cluster;
  83.         unsigned bytes_per_sector;
  84.         };
  85.  
  86. #define _DISKFREE_T_DEFINED
  87. #endif
  88. #endif /* ndef _MAC */
  89.  
  90. /* File attribute constants */
  91.  
  92. #define _A_NORMAL       0x00    /* Normal file - No read/write restrictions */
  93. #define _A_RDONLY       0x01    /* Read only file */
  94. #define _A_HIDDEN       0x02    /* Hidden file */
  95. #define _A_SYSTEM       0x04    /* System file */
  96. #define _A_SUBDIR       0x10    /* Subdirectory */
  97. #define _A_ARCH         0x20    /* Archive file */
  98.  
  99. #ifndef _MAC
  100. /* Function prototypes */
  101. _CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *);
  102. #endif  /* ndef _MAC */
  103.  
  104. #ifdef  _M_IX86
  105. void __cdecl _disable(void);
  106. void __cdecl _enable(void);
  107. #endif  /* _M_IX86 */
  108.  
  109. #ifndef _MAC
  110. #if     !__STDC__
  111. /* Non-ANSI name for compatibility */
  112. #define diskfree_t  _diskfree_t
  113. #endif  /* __STDC__ */
  114. #endif  /* ndef _MAC */
  115.  
  116. #ifdef  __cplusplus
  117. }
  118. #endif
  119.  
  120. #ifdef  _MSC_VER
  121. #pragma pack(pop)
  122. #endif  /* _MSC_VER */
  123.  
  124. #endif  /* _INC_DOS */
  125.