|
|
|
| 1 |
|
/*** |
| 2 |
|
*direct.h - function declarations for directory handling/creation |
| 3 |
|
* |
| 4 |
|
* Copyright (c) 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 |
|
#include <crtdefs.h> |
| 22 |
|
|
| 23 |
|
#ifdef _MSC_VER |
| 24 |
|
/* |
| 25 |
|
* Currently, all MS C compilers for Win32 platforms default to 8 byte |
| 26 |
|
* alignment. |
| 27 |
|
*/ |
| 28 |
|
#pragma pack(push,_CRT_PACKING) |
| 29 |
|
#endif /* _MSC_VER */ |
| 30 |
|
|
| 31 |
|
#ifdef __cplusplus |
| 32 |
|
extern "C" { |
| 33 |
|
#endif |
| 34 |
|
|
| 35 |
|
/* _getdiskfree structure for _getdiskfree() */ |
| 36 |
|
#ifndef _DISKFREE_T_DEFINED |
| 37 |
|
|
| 38 |
|
struct _diskfree_t { |
| 39 |
|
unsigned total_clusters; |
| 40 |
|
unsigned avail_clusters; |
| 41 |
|
unsigned sectors_per_cluster; |
| 42 |
|
unsigned bytes_per_sector; |
| 43 |
|
}; |
| 44 |
|
|
| 45 |
|
#define _DISKFREE_T_DEFINED |
| 46 |
|
#endif |
| 47 |
|
|
| 48 |
|
/* function prototypes */ |
| 49 |
|
|
| 50 |
|
#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 51 |
|
#pragma push_macro("_getcwd") |
| 52 |
|
#pragma push_macro("_getdcwd") |
| 53 |
|
#pragma push_macro("_getdcwd_nolock") |
| 54 |
|
#undef _getcwd |
| 55 |
|
#undef _getdcwd |
| 56 |
|
#undef _getdcwd_nolock |
| 57 |
|
#endif |
| 58 |
|
|
| 59 |
|
_Check_return_ _Ret_opt_z_ _CRTIMP char * __cdecl _getcwd(_Out_opt_cap_(_SizeInBytes) char * _DstBuf, _In_ int _SizeInBytes); |
| 60 |
|
_Check_return_ _Ret_opt_z_ _CRTIMP char * __cdecl _getdcwd(_In_ int _Drive, _Out_opt_cap_(_SizeInBytes) char * _DstBuf, _In_ int _SizeInBytes); |
| 61 |
|
_Check_return_ _Ret_opt_z_ char * __cdecl _getdcwd_nolock(_In_ int _Drive, _Out_opt_cap_(_SizeInBytes) char * _DstBuf, _In_ int _SizeInBytes); |
| 62 |
|
|
| 63 |
|
#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 64 |
|
#pragma pop_macro("_getcwd") |
| 65 |
|
#pragma pop_macro("_getdcwd") |
| 66 |
|
#pragma pop_macro("_getdcwd_nolock") |
| 74 |
|
_Check_return_ _CRTIMP int __cdecl _getdrive(void); |
| 75 |
|
_Check_return_ _CRTIMP unsigned long __cdecl _getdrives(void); |
| 76 |
|
|
| 77 |
|
#ifndef _GETDISKFREE_DEFINED |
| 78 |
|
_Check_return_ _CRTIMP unsigned __cdecl _getdiskfree(_In_ unsigned _Drive, _Out_ struct _diskfree_t * _DiskFree); |
| 79 |
|
#define _GETDISKFREE_DEFINED |
| 80 |
|
#endif |
| 81 |
|
|
| 82 |
|
|
| 83 |
|
#ifndef _WDIRECT_DEFINED |
| 84 |
|
|
| 85 |
|
/* wide function prototypes, also declared in wchar.h */ |
| 86 |
|
|
| 87 |
|
#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 88 |
|
#pragma push_macro("_wgetcwd") |
| 89 |
|
#pragma push_macro("_wgetdcwd") |
| 90 |
|
#pragma push_macro("_wgetdcwd_nolock") |
| 91 |
|
#undef _wgetcwd |
| 92 |
|
#undef _wgetdcwd |
| 93 |
|
#undef _wgetdcwd_nolock |
| 94 |
|
#endif |
| 95 |
|
|
| 96 |
|
_Check_return_ _Ret_opt_z_ _CRTIMP wchar_t * __cdecl _wgetcwd(_Out_opt_cap_(_SizeInWords) wchar_t * _DstBuf, _In_ int _SizeInWords); |
| 97 |
|
_Check_return_ _Ret_opt_z_ _CRTIMP wchar_t * __cdecl _wgetdcwd(_In_ int _Drive, _Out_opt_cap_(_SizeInWords) wchar_t * _DstBuf, _In_ int _SizeInWords); |
| 98 |
|
_Check_return_ _Ret_opt_z_ wchar_t * __cdecl _wgetdcwd_nolock(_In_ int _Drive, _Out_opt_cap_(_SizeInWords) wchar_t * _DstBuf, _In_ int _SizeInWords); |
| 99 |
|
|
| 100 |
|
#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 101 |
|
#pragma pop_macro("_wgetcwd") |
| 102 |
|
#pragma pop_macro("_wgetdcwd") |
| 103 |
|
#pragma pop_macro("_wgetdcwd_nolock") |
| 104 |
|
#endif |
| 105 |
|
|
| 106 |
|
_Check_return_ _CRTIMP int __cdecl _wchdir(_In_z_ const wchar_t * _Path); |
| 107 |
|
_Check_return_ _CRTIMP int __cdecl _wmkdir(_In_z_ const wchar_t * _Path); |
| 108 |
|
_Check_return_ _CRTIMP int __cdecl _wrmdir(_In_z_ const wchar_t * _Path); |
| 109 |
|
|
| 110 |
|
#define _WDIRECT_DEFINED |
| 111 |
|
#endif |
| 112 |
|
|
| 113 |
|
#if !__STDC__ |
| 114 |
|
|
| 115 |
|
/* Non-ANSI names for compatibility */ |
| 116 |
|
#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 117 |
|
#pragma push_macro("getcwd") |
| 118 |
|
#undef getcwd |
| 119 |
|
#endif |
| 120 |
|
|
| 121 |
|
_Check_return_ _Ret_opt_z_ _CRT_NONSTDC_DEPRECATE(_getcwd) _CRTIMP char * __cdecl getcwd(_Out_opt_cap_(_SizeInBytes) char * _DstBuf, _In_ int _SizeInBytes); |
| 122 |
|
|
| 123 |
|
#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 124 |
|
#pragma pop_macro("getcwd") |
| 125 |
|
#endif |
| 126 |
|
|
| 127 |
|
_Check_return_ _CRT_NONSTDC_DEPRECATE(_chdir) _CRTIMP int __cdecl chdir(_In_z_ const char * _Path); |
| 128 |
|
_Check_return_ _CRT_NONSTDC_DEPRECATE(_mkdir) _CRTIMP int __cdecl mkdir(_In_z_ const char * _Path); |
| 129 |
|
_Check_return_ _CRT_NONSTDC_DEPRECATE(_rmdir) _CRTIMP int __cdecl rmdir(_In_z_ const char * _Path); |
| 130 |
|
|
| 131 |
|
#define diskfree_t _diskfree_t |
| 132 |
|
|
| 133 |
|
#endif /* __STDC__ */ |
| 134 |
|
|
| 135 |
|
#ifdef __cplusplus |
| 136 |
|
} |
| 137 |
|
#endif |
| 138 |
|
|
| 139 |
|
#ifdef _MSC_VER |
| 140 |
|
#pragma pack(pop) |
| 141 |
|
#endif /* _MSC_VER */ |
| 142 |
|
|
| 143 |
|
#endif /* _INC_DIRECT */ |
| 144 |
|
|
|
|
|