Source code of Windows XP (NT5)
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.

173 lines
3.3 KiB

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