2 * System I/O 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.
15 /* The following are also defined in dos.h */
16 #define _A_NORMAL 0x00000000
17 #define _A_RDONLY 0x00000001
18 #define _A_HIDDEN 0x00000002
19 #define _A_SYSTEM 0x00000004
20 #define _A_VOLID 0x00000008
21 #define _A_SUBDIR 0x00000010
22 #define _A_ARCH 0x00000020
24 #ifndef _FSIZE_T_DEFINED
25 typedef __msvcrt_ulong _fsize_t
;
26 #define _FSIZE_T_DEFINED
29 #ifndef _FINDDATA_T_DEFINED
30 #define _FINDDATA_T_DEFINED
47 __int64
DECLSPEC_ALIGN(8) size
;
54 __time64_t time_create
;
55 __time64_t time_access
;
56 __time64_t time_write
;
57 __int64
DECLSPEC_ALIGN(8) size
;
60 #endif /* _FINDDATA_T_DEFINED */
62 #ifndef _WFINDDATA_T_DEFINED
63 #define _WFINDDATA_T_DEFINED
73 struct _wfinddatai64_t
{
78 __int64
DECLSPEC_ALIGN(8) size
;
81 #endif /* _WFINDDATA_T_DEFINED */
87 int __cdecl
_access(const char*,int);
88 int __cdecl
_chmod(const char*,int);
89 int __cdecl
_chsize(int,__msvcrt_ulong
);
90 int __cdecl
_chsize_s(int,__int64
);
91 int __cdecl
_close(int);
92 int __cdecl
_commit(int);
93 int __cdecl
_creat(const char*,int);
94 int __cdecl
_dup(int);
95 int __cdecl
_dup2(int,int);
96 int __cdecl
_eof(int);
97 __int64 __cdecl
_filelengthi64(int);
98 __msvcrt_long __cdecl
_filelength(int);
99 int __cdecl
_findclose(intptr_t);
100 intptr_t __cdecl
_findfirst(const char*,struct _finddata_t
*);
101 intptr_t __cdecl
_findfirsti64(const char*, struct _finddatai64_t
*);
102 intptr_t __cdecl
_findfirst64(const char*, struct _finddata64_t
*);
103 int __cdecl
_findnext(intptr_t,struct _finddata_t
*);
104 int __cdecl
_findnexti64(intptr_t, struct _finddatai64_t
*);
105 int __cdecl
_findnext64(intptr_t, struct _finddata64_t
*);
106 intptr_t __cdecl
_get_osfhandle(int);
107 int __cdecl
_isatty(int);
108 int __cdecl
_locking(int,int,__msvcrt_long
);
109 __msvcrt_long __cdecl
_lseek(int,__msvcrt_long
,int);
110 __int64 __cdecl
_lseeki64(int,__int64
,int);
111 char* __cdecl
_mktemp(char*);
112 int __cdecl
_mktemp_s(char*,size_t);
113 int __cdecl
_open(const char*,int,...);
114 int __cdecl
_open_osfhandle(intptr_t,int);
115 int __cdecl
_pipe(int*,unsigned int,int);
116 int __cdecl
_read(int,void*,unsigned int);
117 int __cdecl
_setmode(int,int);
118 int __cdecl
_sopen(const char*,int,int,...);
119 __msvcrt_long __cdecl
_tell(int);
120 __int64 __cdecl
_telli64(int);
121 int __cdecl
_umask(int);
122 int __cdecl
_unlink(const char*);
123 int __cdecl
_write(int,const void*,unsigned int);
125 int __cdecl
remove(const char*);
126 int __cdecl
rename(const char*,const char*);
130 int __cdecl
_waccess(const wchar_t*,int);
131 int __cdecl
_wchmod(const wchar_t*,int);
132 int __cdecl
_wcreat(const wchar_t*,int);
133 intptr_t __cdecl
_wfindfirst(const wchar_t*,struct _wfinddata_t
*);
134 intptr_t __cdecl
_wfindfirsti64(const wchar_t*, struct _wfinddatai64_t
*);
135 int __cdecl
_wfindnext(intptr_t,struct _wfinddata_t
*);
136 int __cdecl
_wfindnexti64(intptr_t, struct _wfinddatai64_t
*);
137 wchar_t * __cdecl
_wmktemp(wchar_t*);
138 int __cdecl
_wopen(const wchar_t*,int,...);
139 int __cdecl
_wrename(const wchar_t*,const wchar_t*);
140 int __cdecl
_wsopen(const wchar_t*,int,int,...);
141 int __cdecl
_wunlink(const wchar_t*);
142 #endif /* _WIO_DEFINED */
149 static inline int access(const char* path
, int mode
) { return _access(path
, mode
); }
150 static inline int chmod(const char* path
, int mode
) { return _chmod(path
, mode
); }
151 static inline int chsize(int fd
, __msvcrt_long size
) { return _chsize(fd
, size
); }
152 static inline int close(int fd
) { return _close(fd
); }
153 static inline int creat(const char* path
, int mode
) { return _creat(path
, mode
); }
154 static inline int dup(int od
) { return _dup(od
); }
155 static inline int dup2(int od
, int nd
) { return _dup2(od
, nd
); }
156 static inline int eof(int fd
) { return _eof(fd
); }
157 static inline __msvcrt_long
filelength(int fd
) { return _filelength(fd
); }
158 static inline int isatty(int fd
) { return _isatty(fd
); }
159 static inline int locking(int fd
, int mode
, __msvcrt_long size
) { return _locking(fd
, mode
, size
); }
160 static inline __msvcrt_long
lseek(int fd
, __msvcrt_long off
, int where
) { return _lseek(fd
, off
, where
); }
161 static inline char* mktemp(char* pat
) { return _mktemp(pat
); }
162 static inline int read(int fd
, void* buf
, unsigned int size
) { return _read(fd
, buf
, size
); }
163 static inline int setmode(int fd
, int mode
) { return _setmode(fd
, mode
); }
164 static inline __msvcrt_long
tell(int fd
) { return _tell(fd
); }
165 #ifndef _UMASK_DEFINED
166 static inline int umask(int fd
) { return _umask(fd
); }
167 #define _UMASK_DEFINED
169 #ifndef _UNLINK_DEFINED
170 static inline int unlink(const char* path
) { return _unlink(path
); }
171 #define _UNLINK_DEFINED
173 static inline int write(int fd
, const void* buf
, unsigned int size
) { return _write(fd
, buf
, size
); }
175 #if defined(__GNUC__) && (__GNUC__ < 4)
176 extern int __cdecl
open(const char*,int,...) __attribute__((alias("_open")));
177 extern int __cdecl
sopen(const char*,int,int,...) __attribute__((alias("_sopen")));
181 #endif /* __GNUC__ */
185 #endif /* __WINE_IO_H */