setupapi: Return CR_SUCCESS for CM_Get_DevNode_Status{_Ex}.
[wine.git] / include / msvcrt / sys / stat.h
blobb09494fb158f3fca781a9a1f311865ce6d841fc3
1 /*
2 * _stat() definitions
4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
7 */
8 #ifndef __WINE_SYS_STAT_H
9 #define __WINE_SYS_STAT_H
11 #include <corecrt.h>
12 #include <sys/types.h>
14 #include <pshpack8.h>
16 #ifndef _DEV_T_DEFINED
17 # ifdef _CRTDLL
18 typedef unsigned short _dev_t;
19 # else
20 typedef unsigned int _dev_t;
21 # endif
22 #define _DEV_T_DEFINED
23 #endif
25 #ifndef _INO_T_DEFINED
26 typedef unsigned short _ino_t;
27 #define _INO_T_DEFINED
28 #endif
30 #ifndef _OFF_T_DEFINED
31 typedef int _off_t;
32 #define _OFF_T_DEFINED
33 #endif
35 #ifndef DECLSPEC_ALIGN
36 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
37 # define DECLSPEC_ALIGN(x) __declspec(align(x))
38 # elif defined(__GNUC__)
39 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
40 # else
41 # define DECLSPEC_ALIGN(x)
42 # endif
43 #endif
45 #define _S_IEXEC 0x0040
46 #define _S_IWRITE 0x0080
47 #define _S_IREAD 0x0100
48 #define _S_IFIFO 0x1000
49 #define _S_IFCHR 0x2000
50 #define _S_IFDIR 0x4000
51 #define _S_IFREG 0x8000
52 #define _S_IFMT 0xF000
54 /* for FreeBSD */
55 #undef st_atime
56 #undef st_ctime
57 #undef st_mtime
59 #ifndef _STAT_DEFINED
60 #define _STAT_DEFINED
62 struct _stat {
63 _dev_t st_dev;
64 _ino_t st_ino;
65 unsigned short st_mode;
66 short st_nlink;
67 short st_uid;
68 short st_gid;
69 _dev_t st_rdev;
70 _off_t st_size;
71 time_t st_atime;
72 time_t st_mtime;
73 time_t st_ctime;
76 struct stat {
77 _dev_t st_dev;
78 _ino_t st_ino;
79 unsigned short st_mode;
80 short st_nlink;
81 short st_uid;
82 short st_gid;
83 _dev_t st_rdev;
84 _off_t st_size;
85 time_t st_atime;
86 time_t st_mtime;
87 time_t st_ctime;
90 struct _stat32 {
91 _dev_t st_dev;
92 _ino_t st_ino;
93 unsigned short st_mode;
94 short st_nlink;
95 short st_uid;
96 short st_gid;
97 _dev_t st_rdev;
98 _off_t st_size;
99 __time32_t st_atime;
100 __time32_t st_mtime;
101 __time32_t st_ctime;
104 struct _stat32i64 {
105 _dev_t st_dev;
106 _ino_t st_ino;
107 unsigned short st_mode;
108 short st_nlink;
109 short st_uid;
110 short st_gid;
111 _dev_t st_rdev;
112 __int64 DECLSPEC_ALIGN(8) st_size;
113 __time32_t st_atime;
114 __time32_t st_mtime;
115 __time32_t st_ctime;
118 struct _stat64i32 {
119 _dev_t st_dev;
120 _ino_t st_ino;
121 unsigned short st_mode;
122 short st_nlink;
123 short st_uid;
124 short st_gid;
125 _dev_t st_rdev;
126 _off_t st_size;
127 __time64_t st_atime;
128 __time64_t st_mtime;
129 __time64_t st_ctime;
132 struct _stati64 {
133 _dev_t st_dev;
134 _ino_t st_ino;
135 unsigned short st_mode;
136 short st_nlink;
137 short st_uid;
138 short st_gid;
139 _dev_t st_rdev;
140 __int64 DECLSPEC_ALIGN(8) st_size;
141 time_t st_atime;
142 time_t st_mtime;
143 time_t st_ctime;
146 struct _stat64 {
147 _dev_t st_dev;
148 _ino_t st_ino;
149 unsigned short st_mode;
150 short st_nlink;
151 short st_uid;
152 short st_gid;
153 _dev_t st_rdev;
154 __int64 DECLSPEC_ALIGN(8) st_size;
155 __time64_t st_atime;
156 __time64_t st_mtime;
157 __time64_t st_ctime;
159 #endif /* _STAT_DEFINED */
161 #ifdef __cplusplus
162 extern "C" {
163 #endif
165 #ifdef _UCRT
166 # ifdef _USE_32BIT_TIME_T
167 # define _fstat _fstat32
168 # define _fstati64 _fstat32i64
169 # define _stat _stat32
170 # define _stati64 _stat32i64
171 # define _wstat _wstat32
172 # define _wstati64 _wstat32i64
173 # else
174 # define _fstat _fstat64i32
175 # define _fstati64 _fstat64
176 # define _stat _stat64i32
177 # define _stati64 _stat64
178 # define _wstat _wstat64i32
179 # define _wstati64 _wstat64
180 # endif
181 #else /* _UCRT */
182 # ifdef _USE_32BIT_TIME_T
183 # define _fstat32 _fstat
184 # define _fstat32i64 _fstati64
185 # define _stat32i64 _stati64
186 # define _stat32 _stat
187 # define _wstat32 _wstat
188 # define _wstat32i64 _wstati64
189 # else
190 # define _fstat64i32 _fstat
191 # define _fstat64 _fstati64
192 # define _stat64 _stati64
193 # define _stat64i32 _stat
194 # define _wstat64i32 _wstat
195 # define _wstat64 _wstati64
196 # endif
197 #endif
199 _ACRTIMP int __cdecl _fstat32(int, struct _stat32*);
200 _ACRTIMP int __cdecl _fstat32i64(int, struct _stat32i64*);
201 _ACRTIMP int __cdecl _fstat64(int,struct _stat64*);
202 _ACRTIMP int __cdecl _fstat64i32(int,struct _stat64i32*);
203 _ACRTIMP int __cdecl _stat32(const char*, struct _stat32*);
204 _ACRTIMP int __cdecl _stat32i64(const char*, struct _stat32i64*);
205 _ACRTIMP int __cdecl _stat64(const char*,struct _stat64*);
206 _ACRTIMP int __cdecl _stat64i32(const char*,struct _stat64i32*);
207 _ACRTIMP int __cdecl _umask(int);
208 _ACRTIMP int __cdecl _wstat32(const wchar_t*,struct _stat32*);
209 _ACRTIMP int __cdecl _wstat32i64(const wchar_t*, struct _stat32i64*);
210 _ACRTIMP int __cdecl _wstat64(const wchar_t*,struct _stat64*);
211 _ACRTIMP int __cdecl _wstat64i32(const wchar_t*,struct _stat64i32*);
213 #ifdef __cplusplus
215 #endif
218 #define S_IFMT _S_IFMT
219 #define S_IFDIR _S_IFDIR
220 #define S_IFCHR _S_IFCHR
221 #define S_IFREG _S_IFREG
222 #define S_IREAD _S_IREAD
223 #define S_IWRITE _S_IWRITE
224 #define S_IEXEC _S_IEXEC
226 static inline int fstat(int fd, struct stat* ptr) { return _fstat(fd, (struct _stat*)ptr); }
227 static inline int stat(const char* path, struct stat* ptr) { return _stat(path, (struct _stat*)ptr); }
228 #ifndef _UMASK_DEFINED
229 static inline int umask(int fd) { return _umask(fd); }
230 #define _UMASK_DEFINED
231 #endif
233 #include <poppack.h>
235 #endif /* __WINE_SYS_STAT_H */