4 * Functions and structures inherited from MS-DOS.
8 * Written by Jan-Jaap van der Heijden
9 * Copyright (C) 1997-1999, 2001-2004, 2007, 2016, MinGW.org Project.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice, this permission notice, and the following
20 * disclaimer shall be included in all copies or substantial portions of
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
29 * DEALINGS IN THE SOFTWARE.
33 #pragma GCC system_header
35 /* This header supports selective inclusion by <direct.h>, for delegated
36 * access to the content of <io.h>, and for declaration of the prototype
37 * and associated data structure for the _getdiskfree() function; since
38 * including <dos.h> in this manner does not make all of its content
39 * visible, we defer definition of its multiple inclusion guard...
41 #ifndef __DIRECT_H_SOURCED__
42 /* ...until we have determined that this inclusion is NOT a selective
43 * request from <direct.h>; in spite of it being obsolete, it appears
44 * that the user may have included <dos.h> directly.
47 #warning "<dos.h> is obsolete; consider using <direct.h> instead."
48 #endif /* !__DIRECT_H_SOURCED__ */
50 /* All MinGW headers are required to include <_mingw.h>; additionally,
51 * for DOS file attributes, we must include <io.h>. By unconditionally
52 * including <io.h> here, we may delegate the inclusion of <_mingw.h> to
53 * it, while also allowing <direct.h> to delegate responsibility for the
54 * inclusion of both <_mingw.h> and <io.h> to us.
62 /* The following declarations are to be visible ONLY when <dos.h>
63 * is included in its own right; they represent entities which are
64 * present in CRTDLL.DLL, but not in MSVCRT.DLL
66 #if defined _DOS_H && ! defined __MSVCRT__
67 #ifndef __DECLSPEC_SUPPORTED
69 # define _basemajor (*_imp___basemajor_dll)
70 # define _baseminor (*_imp___baseminor_dll)
71 # define _baseversion (*_imp___baseversion_dll)
72 # define _osmajor (*_imp___osmajor_dll)
73 # define _osminor (*_imp___osminor_dll)
74 # define _osmode (*_imp___osmode_dll)
76 extern unsigned int *_imp___basemajor_dll;
77 extern unsigned int *_imp___baseminor_dll;
78 extern unsigned int *_imp___baseversion_dll;
79 extern unsigned int *_imp___osmajor_dll;
80 extern unsigned int *_imp___osminor_dll;
81 extern unsigned int *_imp___osmode_dll;
83 #else /* __DECLSPEC_SUPPORTED */
85 # define _basemajor _basemajor_dll
86 # define _baseminor _baseminor_dll
87 # define _baseversion _baseversion_dll
88 # define _osmajor _osmajor_dll
89 # define _osminor _osminor_dll
90 # define _osmode _osmode_dll
92 __MINGW_IMPORT unsigned int _basemajor_dll;
93 __MINGW_IMPORT unsigned int _baseminor_dll;
94 __MINGW_IMPORT unsigned int _baseversion_dll;
95 __MINGW_IMPORT unsigned int _osmajor_dll;
96 __MINGW_IMPORT unsigned int _osminor_dll;
97 __MINGW_IMPORT unsigned int _osmode_dll;
99 #endif /* __DECLSPEC_SUPPORTED */
100 #endif /* _DOS_H && !__MSVCRT__ */
102 /* The following section, which declares the _getdiskfree() function
103 * prototype, and also defines its associated _diskfree_t data structure,
104 * is to be processed both when including <dos.h> in its own right, and
105 * when selectively included by <direct.h>; however...
107 #if ! (defined _DOS_H && defined _DIRECT_H)
108 /* ...when both the _DOS_H guard, and the _DIRECT_H multiple inclusion
109 * guards have been defined, by the time we get to here, then this is
110 * <dos.h> inclusion in its own right, and we have ALREADY processed
111 * these definitions through selective inclusion by <direct.h>; we
112 * MUST NOT process them a second time.
115 # define diskfree_t _diskfree_t
119 { /* A structure in which to store information about disk
120 * free space, as returned by the _getdiskfree() function.
122 unsigned total_clusters;
123 unsigned avail_clusters;
124 unsigned sectors_per_cluster;
125 unsigned bytes_per_sector;
128 _CRTIMP __cdecl __MINGW_NOTHROW
129 unsigned _getdiskfree (unsigned, struct _diskfree_t *);
131 #endif /* ! ( _DOS_H && _DIRECT_H) */
135 #endif /* ! RC_INVOKED */
136 #endif /* !_DOS_H: $RCSfile$: end of file */