Leaked source code of windows server 2003
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.

207 lines
6.7 KiB

  1. /***
  2. *direct.h - function declarations for directory handling/creation
  3. *
  4. * Copyright (c) 1985-2001, 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. *Revision History:
  13. * 12/11/87 JCR Added "_loadds" functionality
  14. * 12-18-87 JCR Added _FAR_ to declarations
  15. * 02-10-88 JCR Cleaned up white space
  16. * 08-22-88 GJF Modified to also work with the 386 (small model only)
  17. * 01-31-89 JCR Added _chdrive, _fullpath, _getdrive, _getdcwd
  18. * 05-03-89 JCR Added _INTERNAL_IFSTRIP for relinc usage
  19. * 07-28-89 GJF Cleanup, now specific to OS/2 2.0 (i.e., 386 flat model)
  20. * 10-30-89 GJF Fixed copyright
  21. * 11-02-89 JCR Changed "DLL" to "_DLL"
  22. * 11-17-89 GJF Moved _fullpath prototype to stdlib.h. Added const
  23. * attrib. to arg types for chdir, mkdir, rmdir
  24. * 02-28-90 GJF Added #ifndef _INC_DIRECT and #include <cruntime.h>
  25. * stuff. Also, removed some (now) useless preprocessor
  26. * directives.
  27. * 03-21-90 GJF Replaced _cdecl with _CALLTYPE1 or _CALLTYPE2 in
  28. * prototypes.
  29. * 03-30-90 GJF Now all are _CALLTYPE1.
  30. * 01-17-91 GJF ANSI naming.
  31. * 08-20-91 JCR C++ and ANSI naming
  32. * 08-26-91 BWM Added _diskfree_t, _getdiskfree, and
  33. * 09-26-91 JCR Non-ANSI alias is for getcwd, not getDcwd (oops)
  34. * 09-28-91 JCR ANSI names: DOSX32=prototypes, WIN32=#defines for now
  35. * 04-29-92 GJF Added _getdcwd_lk for Win32.
  36. * 08-07-92 GJF Function calling type and variable type macros.
  37. * 01-21-93 GJF Removed support for C6-386's _cdecl.
  38. * 04-06-93 SKS Replace _CRTAPI1/2 with __cdecl, _CRTVAR1 with nothing
  39. * 04-07-93 SKS Add _CRTIMP keyword for CRT DLL model
  40. * Use link-time aliases for old names, not #define's
  41. * 04-08-93 SKS Fix oldnames prototype for getcwd()
  42. * 09-01-93 GJF Merged Cuda and NT SDK versions.
  43. * 12-07-93 CFW Add wide char version protos.
  44. * 11-03-94 GJF Ensure 8 byte alignment.
  45. * 12-15-94 XY merged with mac header
  46. * 02-11-95 CFW Add _CRTBLD to avoid users getting wrong headers.
  47. * 02-14-95 CFW Clean up Mac merge.
  48. * 12-14-95 JWM Add "#pragma once".
  49. * 02-20-97 GJF Cleaned out obsolete support for _CRTAPI* and _NTSDK.
  50. * Also, detab-ed.
  51. * 09-30-97 JWM Restored not-so-obsolete _CRTAPI1 support.
  52. * 10-07-97 RDL Added IA64.
  53. * 12-15-98 GJF Changes for 64-bit size_t.
  54. * 05-13-99 PML Remove _CRTAPI1
  55. * 05-17-99 PML Remove all Macintosh support.
  56. * 10-06-99 PML Add _W64 modifier to types which are 32 bits in Win32,
  57. * 64 bits in Win64.
  58. *
  59. ****/
  60. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  61. #pragma once
  62. #endif
  63. #ifndef _INC_DIRECT
  64. #define _INC_DIRECT
  65. #if !defined(_WIN32)
  66. #error ERROR: Only Win32 target supported!
  67. #endif
  68. #ifndef _CRTBLD
  69. /* This version of the header files is NOT for user programs.
  70. * It is intended for use when building the C runtimes ONLY.
  71. * The version intended for public use will not have this message.
  72. */
  73. #error ERROR: Use of C runtime library internal header file.
  74. #endif /* _CRTBLD */
  75. #ifdef _MSC_VER
  76. /*
  77. * Currently, all MS C compilers for Win32 platforms default to 8 byte
  78. * alignment.
  79. */
  80. #pragma pack(push,8)
  81. #endif /* _MSC_VER */
  82. #ifdef __cplusplus
  83. extern "C" {
  84. #endif
  85. #ifndef _INTERNAL_IFSTRIP_
  86. #include <cruntime.h>
  87. #endif /* _INTERNAL_IFSTRIP_ */
  88. #if !defined(_W64)
  89. #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 /*IFSTRIP=IGN*/
  90. #define _W64 __w64
  91. #else
  92. #define _W64
  93. #endif
  94. #endif
  95. /* Define _CRTIMP */
  96. #ifndef _CRTIMP
  97. #ifdef CRTDLL
  98. #define _CRTIMP __declspec(dllexport)
  99. #else /* ndef CRTDLL */
  100. #ifdef _DLL
  101. #define _CRTIMP __declspec(dllimport)
  102. #else /* ndef _DLL */
  103. #define _CRTIMP
  104. #endif /* _DLL */
  105. #endif /* CRTDLL */
  106. #endif /* _CRTIMP */
  107. /* Define __cdecl for non-Microsoft compilers */
  108. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  109. #define __cdecl
  110. #endif
  111. #ifndef _WCHAR_T_DEFINED
  112. typedef unsigned short wchar_t;
  113. #define _WCHAR_T_DEFINED
  114. #endif
  115. #ifndef _SIZE_T_DEFINED
  116. #ifdef _WIN64
  117. typedef unsigned __int64 size_t;
  118. #else
  119. typedef _W64 unsigned int size_t;
  120. #endif
  121. #define _SIZE_T_DEFINED
  122. #endif
  123. /* _getdiskfree structure for _getdiskfree() */
  124. #ifndef _DISKFREE_T_DEFINED
  125. struct _diskfree_t {
  126. unsigned total_clusters;
  127. unsigned avail_clusters;
  128. unsigned sectors_per_cluster;
  129. unsigned bytes_per_sector;
  130. };
  131. #define _DISKFREE_T_DEFINED
  132. #endif
  133. /* function prototypes */
  134. _CRTIMP int __cdecl _chdir(const char *);
  135. _CRTIMP char * __cdecl _getcwd(char *, int);
  136. _CRTIMP int __cdecl _mkdir(const char *);
  137. _CRTIMP int __cdecl _rmdir(const char *);
  138. _CRTIMP int __cdecl _chdrive(int);
  139. _CRTIMP char * __cdecl _getdcwd(int, char *, int);
  140. _CRTIMP int __cdecl _getdrive(void);
  141. _CRTIMP unsigned long __cdecl _getdrives(void);
  142. _CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *);
  143. #ifndef _WDIRECT_DEFINED
  144. /* wide function prototypes, also declared in wchar.h */
  145. _CRTIMP int __cdecl _wchdir(const wchar_t *);
  146. _CRTIMP wchar_t * __cdecl _wgetcwd(wchar_t *, int);
  147. _CRTIMP wchar_t * __cdecl _wgetdcwd(int, wchar_t *, int);
  148. _CRTIMP int __cdecl _wmkdir(const wchar_t *);
  149. _CRTIMP int __cdecl _wrmdir(const wchar_t *);
  150. #define _WDIRECT_DEFINED
  151. #endif
  152. #ifdef _MT /* _MTHREAD_ONLY */
  153. char * __cdecl _getdcwd_lk(int, char *, int); /* _MTHREAD_ONLY */
  154. wchar_t * __cdecl _wgetdcwd_lk(int, wchar_t *, int); /* _MTHREAD_ONLY */
  155. #else /* _MTHREAD_ONLY */
  156. #define _getdcwd_lk(drv, buf, len) _getdcwd(drv, buf, len) /* _MTHREAD_ONLY */
  157. #define _wgetdcwd_lk(drv, buf, len) _wgetdcwd(drv, buf, len) /* _MTHREAD_ONLY */
  158. #endif /* _MTHREAD_ONLY */
  159. #if !__STDC__
  160. /* Non-ANSI names for compatibility */
  161. _CRTIMP int __cdecl chdir(const char *);
  162. _CRTIMP char * __cdecl getcwd(char *, int);
  163. _CRTIMP int __cdecl mkdir(const char *);
  164. _CRTIMP int __cdecl rmdir(const char *);
  165. #define diskfree_t _diskfree_t
  166. #endif /* __STDC__ */
  167. #ifdef __cplusplus
  168. }
  169. #endif
  170. #ifdef _MSC_VER
  171. #pragma pack(pop)
  172. #endif /* _MSC_VER */
  173. #endif /* _INC_DIRECT */