home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / direct.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  4KB  |  175 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  /* _MSC_VER > 1000 */
  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  /* !defined (_WIN32) && !defined (_MAC) */
  24.  
  25. #ifndef _CRTBLD
  26. /* This version of the header files is NOT for user programs.
  27.  * It is intended for use when building the C runtimes ONLY.
  28.  * The version intended for public use will not have this message.
  29.  */
  30. #error ERROR: Use of C runtime library internal header file.
  31. #endif  /* _CRTBLD */
  32.  
  33. #ifdef _MSC_VER
  34. /*
  35.  * Currently, all MS C compilers for Win32 platforms default to 8 byte
  36.  * alignment.
  37.  */
  38. #pragma pack(push,8)
  39. #endif  /* _MSC_VER */
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif  /* __cplusplus */
  44.  
  45. #ifndef _INTERNAL_IFSTRIP_
  46. #include <cruntime.h>
  47. #endif  /* _INTERNAL_IFSTRIP_ */
  48.  
  49.  
  50. /* Define _CRTIMP */
  51.  
  52. #ifndef _CRTIMP
  53. #ifdef CRTDLL
  54. #define _CRTIMP __declspec(dllexport)
  55. #else  /* CRTDLL */
  56. #ifdef _DLL
  57. #define _CRTIMP __declspec(dllimport)
  58. #else  /* _DLL */
  59. #define _CRTIMP
  60. #endif  /* _DLL */
  61. #endif  /* CRTDLL */
  62. #endif  /* _CRTIMP */
  63.  
  64.  
  65. /* Define __cdecl for non-Microsoft compilers */
  66.  
  67. #if (!defined (_MSC_VER) && !defined (__cdecl))
  68. #define __cdecl
  69. #endif  /* (!defined (_MSC_VER) && !defined (__cdecl)) */
  70.  
  71. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  72.  
  73. #ifndef _CRTAPI1
  74. #if _MSC_VER >= 800 && _M_IX86 >= 300
  75. #define _CRTAPI1 __cdecl
  76. #else  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  77. #define _CRTAPI1
  78. #endif  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  79. #endif  /* _CRTAPI1 */
  80.  
  81. #ifndef _MAC
  82. #ifndef _WCHAR_T_DEFINED
  83. typedef unsigned short wchar_t;
  84. #define _WCHAR_T_DEFINED
  85. #endif  /* _WCHAR_T_DEFINED */
  86. #endif  /* _MAC */
  87.  
  88. #ifndef _SIZE_T_DEFINED
  89. typedef unsigned int size_t;
  90. #define _SIZE_T_DEFINED
  91. #endif  /* _SIZE_T_DEFINED */
  92.  
  93. #ifndef _MAC
  94. /* _getdiskfree structure for _getdiskfree() */
  95. #ifndef _DISKFREE_T_DEFINED
  96.  
  97. struct _diskfree_t {
  98.         unsigned total_clusters;
  99.         unsigned avail_clusters;
  100.         unsigned sectors_per_cluster;
  101.         unsigned bytes_per_sector;
  102.         };
  103.  
  104. #define _DISKFREE_T_DEFINED
  105. #endif  /* _DISKFREE_T_DEFINED */
  106. #endif  /* _MAC */
  107.  
  108. /* function prototypes */
  109.  
  110. _CRTIMP int __cdecl _chdir(const char *);
  111. _CRTIMP char * __cdecl _getcwd(char *, int);
  112. _CRTIMP int __cdecl _mkdir(const char *);
  113. _CRTIMP int __cdecl _rmdir(const char *);
  114.  
  115. #ifndef _MAC
  116. _CRTIMP int __cdecl _chdrive(int);
  117. _CRTIMP char * __cdecl _getdcwd(int, char *, int);
  118. _CRTIMP int __cdecl _getdrive(void);
  119. _CRTIMP unsigned long __cdecl _getdrives(void);
  120. _CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *);
  121. #endif  /* _MAC */
  122.  
  123.  
  124. #ifndef _MAC
  125. #ifndef _WDIRECT_DEFINED
  126.  
  127. /* wide function prototypes, also declared in wchar.h  */
  128.  
  129. _CRTIMP int __cdecl _wchdir(const wchar_t *);
  130. _CRTIMP wchar_t * __cdecl _wgetcwd(wchar_t *, int);
  131. _CRTIMP wchar_t * __cdecl _wgetdcwd(int, wchar_t *, int);
  132. _CRTIMP int __cdecl _wmkdir(const wchar_t *);
  133. _CRTIMP int __cdecl _wrmdir(const wchar_t *);
  134.  
  135. #define _WDIRECT_DEFINED
  136. #endif  /* _WDIRECT_DEFINED */
  137. #endif  /* _MAC */
  138.  
  139. #ifdef _MT
  140. char * __cdecl _getdcwd_lk(int, char *, int);                   /* _MTHREAD_ONLY */
  141. #ifndef _MAC
  142. wchar_t * __cdecl _wgetdcwd_lk(int, wchar_t *, int);            /* _MTHREAD_ONLY */
  143. #endif  /* _MAC */
  144. #else  /* _MT */
  145. #define _getdcwd_lk(drv, buf, len)  _getdcwd(drv, buf, len)     /* _MTHREAD_ONLY */
  146. #ifndef _MAC
  147. #define _wgetdcwd_lk(drv, buf, len)  _wgetdcwd(drv, buf, len)   /* _MTHREAD_ONLY */
  148. #endif  /* _MAC */
  149. #endif  /* _MT */
  150.  
  151. #if !__STDC__
  152.  
  153. /* Non-ANSI names for compatibility */
  154.  
  155. _CRTIMP int __cdecl chdir(const char *);
  156. _CRTIMP char * __cdecl getcwd(char *, int);
  157. _CRTIMP int __cdecl mkdir(const char *);
  158. _CRTIMP int __cdecl rmdir(const char *);
  159.  
  160. #ifndef _MAC
  161. #define diskfree_t  _diskfree_t
  162. #endif  /* _MAC */
  163.  
  164. #endif  /* !__STDC__ */
  165.  
  166. #ifdef __cplusplus
  167. }
  168. #endif  /* __cplusplus */
  169.  
  170. #ifdef _MSC_VER
  171. #pragma pack(pop)
  172. #endif  /* _MSC_VER */
  173.  
  174. #endif  /* _INC_DIRECT */
  175.