STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
direct.h
Go to the documentation of this file.
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 #pragma once
15 
16 #ifndef _INC_DIRECT
17 #define _INC_DIRECT
18 
19 #include <crtdefs.h>
20 
21 /*
22  * Currently, all MS C compilers for Win32 platforms default to 8 byte
23  * alignment.
24  */
25 #pragma pack(push,_CRT_PACKING)
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 
31 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
32 
33 /* _getdiskfree structure for _getdiskfree() */
34 #ifndef _DISKFREE_T_DEFINED
35 
36 struct _diskfree_t {
37  unsigned total_clusters;
38  unsigned avail_clusters;
40  unsigned bytes_per_sector;
41  };
42 
43 #define _DISKFREE_T_DEFINED
44 #endif /* _DISKFREE_T_DEFINED */
45 
46 #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
47 
48 /* function prototypes */
49 
50 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
51 
52 #if defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC)
53 #pragma push_macro("_getcwd")
54 #pragma push_macro("_getdcwd")
55 #undef _getcwd
56 #undef _getdcwd
57 #endif /* defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC) */
58 
61 #define _getdcwd_nolock _getdcwd
62 
63 #if defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC)
64 #pragma pop_macro("_getcwd")
65 #pragma pop_macro("_getdcwd")
66 #endif /* defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC) */
67 
68 _Check_return_ _CRTIMP int __cdecl _chdir(_In_z_ const char * _Path);
69 
70 #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
71 
72 _Check_return_ _CRTIMP int __cdecl _mkdir(_In_z_ const char * _Path);
73 _Check_return_ _CRTIMP int __cdecl _rmdir(_In_z_ const char * _Path);
74 
75 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
76 
77 _Check_return_ _CRTIMP int __cdecl _chdrive(_In_ int _Drive);
78 _Check_return_ _CRTIMP int __cdecl _getdrive(void);
79 _Check_return_ _CRTIMP unsigned long __cdecl _getdrives(void);
80 
81 #ifndef _GETDISKFREE_DEFINED
82 _Check_return_ _CRTIMP unsigned __cdecl _getdiskfree(_In_ unsigned _Drive, _Out_ struct _diskfree_t * _DiskFree);
83 #define _GETDISKFREE_DEFINED
84 #endif /* _GETDISKFREE_DEFINED */
85 
86 #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
87 
88 #ifndef _WDIRECT_DEFINED
89 
90 /* wide function prototypes, also declared in wchar.h */
91 
92 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
93 
94 #if defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC)
95 #pragma push_macro("_wgetcwd")
96 #pragma push_macro("_wgetdcwd")
97 #undef _wgetcwd
98 #undef _wgetdcwd
99 #endif /* defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC) */
100 
101 _Check_return_ _Ret_maybenull_z_ _CRTIMP wchar_t * __cdecl _wgetcwd(_Out_writes_opt_(_SizeInWords) wchar_t * _DstBuf, _In_ int _SizeInWords);
102 _Check_return_ _Ret_maybenull_z_ _CRTIMP wchar_t * __cdecl _wgetdcwd(_In_ int _Drive, _Out_writes_opt_(_SizeInWords) wchar_t * _DstBuf, _In_ int _SizeInWords);
103 #define _wgetdcwd_nolock _wgetdcwd
104 
105 #if defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC)
106 #pragma pop_macro("_wgetcwd")
107 #pragma pop_macro("_wgetdcwd")
108 #endif /* defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC) */
109 
110 _Check_return_ _CRTIMP int __cdecl _wchdir(_In_z_ const wchar_t * _Path);
111 
112 #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
113 
114 _Check_return_ _CRTIMP int __cdecl _wmkdir(_In_z_ const wchar_t * _Path);
115 _Check_return_ _CRTIMP int __cdecl _wrmdir(_In_z_ const wchar_t * _Path);
116 
117 #define _WDIRECT_DEFINED
118 #endif /* _WDIRECT_DEFINED */
119 
120 #if !__STDC__
121 
122 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
123 
124 /* Non-ANSI names for compatibility */
125 #if defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC)
126 #pragma push_macro("getcwd")
127 #undef getcwd
128 #endif /* defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC) */
129 
131 
132 #if defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC)
133 #pragma pop_macro("getcwd")
134 #endif /* defined (_DEBUG) && defined (_CRTDBG_MAP_ALLOC) */
135 
136 _Check_return_ _CRT_NONSTDC_DEPRECATE(_chdir) _CRTIMP int __cdecl chdir(_In_z_ const char * _Path);
137 
138 #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
139 
140 _Check_return_ _CRT_NONSTDC_DEPRECATE(_mkdir) _CRTIMP int __cdecl mkdir(_In_z_ const char * _Path);
141 _Check_return_ _CRT_NONSTDC_DEPRECATE(_rmdir) _CRTIMP int __cdecl rmdir(_In_z_ const char * _Path);
142 
143 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
144 #define diskfree_t _diskfree_t
145 #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
146 
147 #endif /* !__STDC__ */
148 
149 #ifdef __cplusplus
150 }
151 #endif /* __cplusplus */
152 
153 #pragma pack(pop)
154 
155 #endif /* _INC_DIRECT */
#define _Out_
Definition: sal.h:351
_Check_return_ _CRTIMP int __cdecl _wrmdir(_In_z_ const wchar_t *_Path)
_Check_return_ _CRTIMP unsigned long __cdecl _getdrives(void)
#define _CRTIMP
Definition: crtdefs.h:23
_Check_return_ _CRTIMP int __cdecl _getdrive(void)
_Check_return_ _CRTIMP int __cdecl _chdir(_In_z_ const char *_Path)
#define _Out_writes_opt_(size)
Definition: sal.h:355
_Check_return_ _CRTIMP unsigned __cdecl _getdiskfree(_In_ unsigned _Drive, _Out_ struct _diskfree_t *_DiskFree)
_Check_return_ _CRTIMP int __cdecl _rmdir(_In_z_ const char *_Path)
_CRTIMP _Pre_notnull_ _Post_z_ char * _DstBuf
Definition: stdlib.h:483
#define _Check_return_
Definition: sal.h:563
#define _In_z_
Definition: sal.h:319
#define _In_
Definition: sal.h:314
_Check_return_ _CRTIMP int __cdecl _chdrive(_In_ int _Drive)
#define _Ret_maybenull_z_
Definition: sal.h:531
_Pre_maybenull_ _Post_z_ char * _Drive
Definition: stdlib.h:854
_Check_return_ _Ret_maybenull_z_ _CRTIMP char *__cdecl _getcwd(_Out_writes_opt_(_SizeInBytes) char *_DstBuf, _In_ int _SizeInBytes)
unsigned bytes_per_sector
Definition: direct.h:40
Definition: direct.h:36
_Check_return_ _Ret_maybenull_z_ _CRTIMP char *__cdecl _getdcwd(_In_ int _Drive, _Out_writes_opt_(_SizeInBytes) char *_DstBuf, _In_ int _SizeInBytes)
unsigned avail_clusters
Definition: direct.h:38
_Check_return_ _Ret_maybenull_z_ _CRTIMP wchar_t *__cdecl _wgetcwd(_Out_writes_opt_(_SizeInWords) wchar_t *_DstBuf, _In_ int _SizeInWords)
unsigned total_clusters
Definition: direct.h:37
_Check_return_ _CRTIMP int __cdecl _mkdir(_In_z_ const char *_Path)
unsigned sectors_per_cluster
Definition: direct.h:39
_Check_return_ _Ret_maybenull_z_ _CRTIMP wchar_t *__cdecl _wgetdcwd(_In_ int _Drive, _Out_writes_opt_(_SizeInWords) wchar_t *_DstBuf, _In_ int _SizeInWords)
_Check_return_ _Ret_maybenull_z_ _CRT_NONSTDC_DEPRECATE(_getcwd) _CRTIMP char *__cdecl getcwd(_Out_writes_opt_(_SizeInBytes) char *_DstBuf
_Check_return_ _Ret_maybenull_z_ _In_ int _SizeInBytes
Definition: direct.h:130
_Check_return_ _CRTIMP int __cdecl _wchdir(_In_z_ const wchar_t *_Path)
_Check_return_ _CRTIMP int __cdecl _wmkdir(_In_z_ const wchar_t *_Path)