home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / direct.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  3KB  |  150 lines

  1. /***
  2. *direct.h - function declarations for directory handling/creation
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This include file contains the function declarations for the library
  8. *       functions related to directory handling and creation.
  9. *
  10. *       [Public]
  11. *
  12. ****/
  13.  
  14. #if     _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17.  
  18. #ifndef _INC_DIRECT
  19. #define _INC_DIRECT
  20.  
  21. #if     !defined(_WIN32) && !defined(_MAC)
  22. #error ERROR: Only Mac or Win32 targets supported!
  23. #endif
  24.  
  25.  
  26. #ifdef  _MSC_VER
  27. /*
  28.  * Currently, all MS C compilers for Win32 platforms default to 8 byte
  29.  * alignment.
  30.  */
  31. #pragma pack(push,8)
  32. #endif  /* _MSC_VER */
  33.  
  34. #ifdef  __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38.  
  39.  
  40. /* Define _CRTIMP */
  41.  
  42. #ifndef _CRTIMP
  43. #ifdef  _DLL
  44. #define _CRTIMP __declspec(dllimport)
  45. #else   /* ndef _DLL */
  46. #define _CRTIMP
  47. #endif  /* _DLL */
  48. #endif  /* _CRTIMP */
  49.  
  50.  
  51. /* Define __cdecl for non-Microsoft compilers */
  52.  
  53. #if     ( !defined(_MSC_VER) && !defined(__cdecl) )
  54. #define __cdecl
  55. #endif
  56.  
  57. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  58.  
  59. #ifndef _CRTAPI1
  60. #if    _MSC_VER >= 800 && _M_IX86 >= 300
  61. #define _CRTAPI1 __cdecl
  62. #else
  63. #define _CRTAPI1
  64. #endif
  65. #endif
  66.  
  67. #ifndef _MAC
  68. #ifndef _WCHAR_T_DEFINED
  69. typedef unsigned short wchar_t;
  70. #define _WCHAR_T_DEFINED
  71. #endif
  72. #endif  /* ndef _MAC */
  73.  
  74. #ifndef _SIZE_T_DEFINED
  75. typedef unsigned int size_t;
  76. #define _SIZE_T_DEFINED
  77. #endif
  78.  
  79. #ifndef _MAC
  80. /* _getdiskfree structure for _getdiskfree() */
  81. #ifndef _DISKFREE_T_DEFINED
  82.  
  83. struct _diskfree_t {
  84.         unsigned total_clusters;
  85.         unsigned avail_clusters;
  86.         unsigned sectors_per_cluster;
  87.         unsigned bytes_per_sector;
  88.         };
  89.  
  90. #define _DISKFREE_T_DEFINED
  91. #endif
  92. #endif  /* ndef _MAC */
  93.  
  94. /* function prototypes */
  95.  
  96. _CRTIMP int __cdecl _chdir(const char *);
  97. _CRTIMP char * __cdecl _getcwd(char *, int);
  98. _CRTIMP int __cdecl _mkdir(const char *);
  99. _CRTIMP int __cdecl _rmdir(const char *);
  100.  
  101. #ifndef _MAC
  102. _CRTIMP int __cdecl _chdrive(int);
  103. _CRTIMP char * __cdecl _getdcwd(int, char *, int);
  104. _CRTIMP int __cdecl _getdrive(void);
  105. _CRTIMP unsigned long __cdecl _getdrives(void);
  106. _CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *);
  107. #endif  /* ndef _MAC */
  108.  
  109.  
  110. #ifndef _MAC
  111. #ifndef _WDIRECT_DEFINED
  112.  
  113. /* wide function prototypes, also declared in wchar.h  */
  114.  
  115. _CRTIMP int __cdecl _wchdir(const wchar_t *);
  116. _CRTIMP wchar_t * __cdecl _wgetcwd(wchar_t *, int);
  117. _CRTIMP wchar_t * __cdecl _wgetdcwd(int, wchar_t *, int);
  118. _CRTIMP int __cdecl _wmkdir(const wchar_t *);
  119. _CRTIMP int __cdecl _wrmdir(const wchar_t *);
  120.  
  121. #define _WDIRECT_DEFINED
  122. #endif
  123. #endif  /* ndef _MAC */
  124.  
  125.  
  126. #if     !__STDC__
  127.  
  128. /* Non-ANSI names for compatibility */
  129.  
  130. _CRTIMP int __cdecl chdir(const char *);
  131. _CRTIMP char * __cdecl getcwd(char *, int);
  132. _CRTIMP int __cdecl mkdir(const char *);
  133. _CRTIMP int __cdecl rmdir(const char *);
  134.  
  135. #ifndef _MAC
  136. #define diskfree_t  _diskfree_t
  137. #endif  /* ndef _MAC */
  138.  
  139. #endif  /* __STDC__ */
  140.  
  141. #ifdef  __cplusplus
  142. }
  143. #endif
  144.  
  145. #ifdef  _MSC_VER
  146. #pragma pack(pop)
  147. #endif  /* _MSC_VER */
  148.  
  149. #endif  /* _INC_DIRECT */
  150.