1 | /*
|
---|
2 | * System I/O definitions.
|
---|
3 | *
|
---|
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 | /*
|
---|
9 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
10 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
11 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
12 | * a choice of LGPL license versions is made available with the language indicating
|
---|
13 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
14 | * of the LGPL is applied is otherwise unspecified.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #ifndef __WINE_IO_H
|
---|
18 | #define __WINE_IO_H
|
---|
19 |
|
---|
20 | #include <crtdefs.h>
|
---|
21 |
|
---|
22 | #include <pshpack8.h>
|
---|
23 |
|
---|
24 | /* The following are also defined in dos.h */
|
---|
25 | #define _A_NORMAL 0x00000000
|
---|
26 | #define _A_RDONLY 0x00000001
|
---|
27 | #define _A_HIDDEN 0x00000002
|
---|
28 | #define _A_SYSTEM 0x00000004
|
---|
29 | #define _A_VOLID 0x00000008
|
---|
30 | #define _A_SUBDIR 0x00000010
|
---|
31 | #define _A_ARCH 0x00000020
|
---|
32 |
|
---|
33 | #ifndef _FSIZE_T_DEFINED
|
---|
34 | typedef __msvcrt_ulong _fsize_t;
|
---|
35 | #define _FSIZE_T_DEFINED
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | #ifndef _FINDDATA_T_DEFINED
|
---|
39 | #define _FINDDATA_T_DEFINED
|
---|
40 | struct _finddata_t
|
---|
41 | {
|
---|
42 | unsigned attrib;
|
---|
43 | time_t time_create;
|
---|
44 | time_t time_access;
|
---|
45 | time_t time_write;
|
---|
46 | _fsize_t size;
|
---|
47 | char name[260];
|
---|
48 | };
|
---|
49 |
|
---|
50 | struct _finddatai64_t
|
---|
51 | {
|
---|
52 | unsigned attrib;
|
---|
53 | time_t time_create;
|
---|
54 | time_t time_access;
|
---|
55 | time_t time_write;
|
---|
56 | __int64 size;
|
---|
57 | char name[260];
|
---|
58 | };
|
---|
59 | #endif /* _FINDDATA_T_DEFINED */
|
---|
60 |
|
---|
61 | #ifndef _WFINDDATA_T_DEFINED
|
---|
62 | #define _WFINDDATA_T_DEFINED
|
---|
63 | struct _wfinddata_t {
|
---|
64 | unsigned attrib;
|
---|
65 | time_t time_create;
|
---|
66 | time_t time_access;
|
---|
67 | time_t time_write;
|
---|
68 | _fsize_t size;
|
---|
69 | wchar_t name[260];
|
---|
70 | };
|
---|
71 |
|
---|
72 | struct _wfinddatai64_t {
|
---|
73 | unsigned attrib;
|
---|
74 | time_t time_create;
|
---|
75 | time_t time_access;
|
---|
76 | time_t time_write;
|
---|
77 | __int64 size;
|
---|
78 | wchar_t name[260];
|
---|
79 | };
|
---|
80 | #endif /* _WFINDDATA_T_DEFINED */
|
---|
81 |
|
---|
82 | #ifdef __cplusplus
|
---|
83 | extern "C" {
|
---|
84 | #endif
|
---|
85 |
|
---|
86 | int __cdecl _access(const char*,int);
|
---|
87 | int __cdecl _chmod(const char*,int);
|
---|
88 | int __cdecl _chsize(int,__msvcrt_ulong);
|
---|
89 | int __cdecl _close(int);
|
---|
90 | int __cdecl _commit(int);
|
---|
91 | int __cdecl _creat(const char*,int);
|
---|
92 | int __cdecl _dup(int);
|
---|
93 | int __cdecl _dup2(int,int);
|
---|
94 | int __cdecl _eof(int);
|
---|
95 | __int64 __cdecl _filelengthi64(int);
|
---|
96 | __msvcrt_long __cdecl _filelength(int);
|
---|
97 | int __cdecl _findclose(intptr_t);
|
---|
98 | intptr_t __cdecl _findfirst(const char*,struct _finddata_t*);
|
---|
99 | intptr_t __cdecl _findfirsti64(const char*, struct _finddatai64_t*);
|
---|
100 | int __cdecl _findnext(intptr_t,struct _finddata_t*);
|
---|
101 | int __cdecl _findnexti64(intptr_t, struct _finddatai64_t*);
|
---|
102 | intptr_t __cdecl _get_osfhandle(int);
|
---|
103 | int __cdecl _isatty(int);
|
---|
104 | int __cdecl _locking(int,int,__msvcrt_long);
|
---|
105 | __msvcrt_long __cdecl _lseek(int,__msvcrt_long,int);
|
---|
106 | __int64 __cdecl _lseeki64(int,__int64,int);
|
---|
107 | char* __cdecl _mktemp(char*);
|
---|
108 | int __cdecl _open(const char*,int,...);
|
---|
109 | int __cdecl _open_osfhandle(intptr_t,int);
|
---|
110 | int __cdecl _pipe(int*,unsigned int,int);
|
---|
111 | int __cdecl _read(int,void*,unsigned int);
|
---|
112 | int __cdecl _setmode(int,int);
|
---|
113 | int __cdecl _sopen(const char*,int,int,...);
|
---|
114 | __msvcrt_long __cdecl _tell(int);
|
---|
115 | __int64 __cdecl _telli64(int);
|
---|
116 | int __cdecl _umask(int);
|
---|
117 | int __cdecl _unlink(const char*);
|
---|
118 | int __cdecl _write(int,const void*,unsigned int);
|
---|
119 |
|
---|
120 | int __cdecl remove(const char*);
|
---|
121 | int __cdecl rename(const char*,const char*);
|
---|
122 |
|
---|
123 | #ifndef _WIO_DEFINED
|
---|
124 | #define _WIO_DEFINED
|
---|
125 | int __cdecl _waccess(const wchar_t*,int);
|
---|
126 | int __cdecl _wchmod(const wchar_t*,int);
|
---|
127 | int __cdecl _wcreat(const wchar_t*,int);
|
---|
128 | intptr_t __cdecl _wfindfirst(const wchar_t*,struct _wfinddata_t*);
|
---|
129 | intptr_t __cdecl _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
|
---|
130 | int __cdecl _wfindnext(intptr_t,struct _wfinddata_t*);
|
---|
131 | int __cdecl _wfindnexti64(intptr_t, struct _wfinddatai64_t*);
|
---|
132 | wchar_t * __cdecl _wmktemp(wchar_t*);
|
---|
133 | int __cdecl _wopen(const wchar_t*,int,...);
|
---|
134 | int __cdecl _wrename(const wchar_t*,const wchar_t*);
|
---|
135 | int __cdecl _wsopen(const wchar_t*,int,int,...);
|
---|
136 | int __cdecl _wunlink(const wchar_t*);
|
---|
137 | #endif /* _WIO_DEFINED */
|
---|
138 |
|
---|
139 | #ifdef __cplusplus
|
---|
140 | }
|
---|
141 | #endif
|
---|
142 |
|
---|
143 |
|
---|
144 | static inline int access(const char* path, int mode) { return _access(path, mode); }
|
---|
145 | static inline int chmod(const char* path, int mode) { return _chmod(path, mode); }
|
---|
146 | static inline int chsize(int fd, __msvcrt_long size) { return _chsize(fd, size); }
|
---|
147 | static inline int close(int fd) { return _close(fd); }
|
---|
148 | static inline int creat(const char* path, int mode) { return _creat(path, mode); }
|
---|
149 | static inline int dup(int od) { return _dup(od); }
|
---|
150 | static inline int dup2(int od, int nd) { return _dup2(od, nd); }
|
---|
151 | static inline int eof(int fd) { return _eof(fd); }
|
---|
152 | static inline __msvcrt_long filelength(int fd) { return _filelength(fd); }
|
---|
153 | static inline int isatty(int fd) { return _isatty(fd); }
|
---|
154 | static inline int locking(int fd, int mode, __msvcrt_long size) { return _locking(fd, mode, size); }
|
---|
155 | static inline __msvcrt_long lseek(int fd, __msvcrt_long off, int where) { return _lseek(fd, off, where); }
|
---|
156 | static inline char* mktemp(char* pat) { return _mktemp(pat); }
|
---|
157 | static inline int read(int fd, void* buf, unsigned int size) { return _read(fd, buf, size); }
|
---|
158 | static inline int setmode(int fd, int mode) { return _setmode(fd, mode); }
|
---|
159 | static inline __msvcrt_long tell(int fd) { return _tell(fd); }
|
---|
160 | #ifndef _UMASK_DEFINED
|
---|
161 | static inline int umask(int fd) { return _umask(fd); }
|
---|
162 | #define _UMASK_DEFINED
|
---|
163 | #endif
|
---|
164 | #ifndef _UNLINK_DEFINED
|
---|
165 | static inline int unlink(const char* path) { return _unlink(path); }
|
---|
166 | #define _UNLINK_DEFINED
|
---|
167 | #endif
|
---|
168 | static inline int write(int fd, const void* buf, unsigned int size) { return _write(fd, buf, size); }
|
---|
169 |
|
---|
170 | #if defined(__GNUC__) && (__GNUC__ < 4)
|
---|
171 | extern int __cdecl open(const char*,int,...) __attribute__((alias("_open")));
|
---|
172 | extern int __cdecl sopen(const char*,int,int,...) __attribute__((alias("_sopen")));
|
---|
173 | #else
|
---|
174 | #define open _open
|
---|
175 | #define sopen _sopen
|
---|
176 | #endif /* __GNUC__ */
|
---|
177 |
|
---|
178 | #include <poppack.h>
|
---|
179 |
|
---|
180 | #endif /* __WINE_IO_H */
|
---|