dsound: Add full duplex tests.
[wine] / include / msvcrt / io.h
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 #ifndef __WINE_IO_H
9 #define __WINE_IO_H
10 #ifndef __WINE_USE_MSVCRT
11 #define __WINE_USE_MSVCRT
12 #endif
13
14 #ifndef _WCHAR_T_DEFINED
15 #define _WCHAR_T_DEFINED
16 #ifndef __cplusplus
17 typedef unsigned short wchar_t;
18 #endif
19 #endif
20
21 #ifndef _MSC_VER
22 # ifndef __int64
23 #  define __int64 long long
24 # endif
25 #endif
26
27 /* The following are also defined in dos.h */
28 #define _A_NORMAL 0x00000000
29 #define _A_RDONLY 0x00000001
30 #define _A_HIDDEN 0x00000002
31 #define _A_SYSTEM 0x00000004
32 #define _A_VOLID  0x00000008
33 #define _A_SUBDIR 0x00000010
34 #define _A_ARCH   0x00000020
35
36 #ifndef _TIME_T_DEFINED
37 typedef long time_t;
38 #define _TIME_T_DEFINED
39 #endif
40
41 #ifndef _FSIZE_T_DEFINED
42 typedef unsigned long _fsize_t;
43 #define _FSIZE_T_DEFINED
44 #endif
45
46 #ifndef _FINDDATA_T_DEFINED
47 #define _FINDDATA_T_DEFINED
48 struct _finddata_t
49 {
50   unsigned attrib;
51   time_t   time_create;
52   time_t   time_access;
53   time_t   time_write;
54   _fsize_t size;
55   char             name[260];
56 };
57
58 struct _finddatai64_t
59 {
60   unsigned attrib;
61   time_t time_create;
62   time_t time_access;
63   time_t time_write;
64   __int64        size;
65   char           name[260];
66 };
67 #endif /* _FINDDATA_T_DEFINED */
68
69 #ifndef _WFINDDATA_T_DEFINED
70 #define _WFINDDATA_T_DEFINED
71 struct _wfinddata_t {
72   unsigned attrib;
73   time_t   time_create;
74   time_t   time_access;
75   time_t   time_write;
76   _fsize_t size;
77   wchar_t  name[260];
78 };
79
80 struct _wfinddatai64_t {
81   unsigned attrib;
82   time_t  time_create;
83   time_t  time_access;
84   time_t  time_write;
85   __int64         size;
86   wchar_t name[260];
87 };
88 #endif /* _WFINDDATA_T_DEFINED */
89
90 #ifdef __cplusplus
91 extern "C" {
92 #endif
93
94 int         _access(const char*,int);
95 int         _chmod(const char*,int);
96 int         _chsize(int,long);
97 int         _close(int);
98 int         _commit(int);
99 int         _creat(const char*,int);
100 int         _dup(int);
101 int         _dup2(int,int);
102 int         _eof(int);
103 __int64     _filelengthi64(int);
104 long        _filelength(int);
105 int         _findclose(long);
106 long        _findfirst(const char*,struct _finddata_t*);
107 long        _findfirsti64(const char*, struct _finddatai64_t*);
108 int         _findnext(long,struct _finddata_t*);
109 int         _findnexti64(long, struct _finddatai64_t*);
110 long        _get_osfhandle(int);
111 int         _isatty(int);
112 int         _locking(int,int,long);
113 long        _lseek(int,long,int);
114 __int64     _lseeki64(int,__int64,int);
115 char*       _mktemp(char*);
116 int         _open(const char*,int,...);
117 int         _open_osfhandle(long,int);
118 int         _pipe(int*,unsigned int,int);
119 int         _read(int,void*,unsigned int);
120 int         _setmode(int,int);
121 int         _sopen(const char*,int,int,...);
122 long        _tell(int);
123 __int64     _telli64(int);
124 int         _umask(int);
125 int         _unlink(const char*);
126 int         _write(int,const void*,unsigned int);
127
128 int         remove(const char*);
129 int         rename(const char*,const char*);
130
131 #ifndef _WIO_DEFINED
132 #define _WIO_DEFINED
133 int         _waccess(const wchar_t*,int);
134 int         _wchmod(const wchar_t*,int);
135 int         _wcreat(const wchar_t*,int);
136 long        _wfindfirst(const wchar_t*,struct _wfinddata_t*);
137 long        _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
138 int         _wfindnext(long,struct _wfinddata_t*);
139 int         _wfindnexti64(long, struct _wfinddatai64_t*);
140 wchar_t*_wmktemp(wchar_t*);
141 int         _wopen(const wchar_t*,int,...);
142 int         _wrename(const wchar_t*,const wchar_t*);
143 int         _wsopen(const wchar_t*,int,int,...);
144 int         _wunlink(const wchar_t*);
145 #endif /* _WIO_DEFINED */
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151
152 static inline int access(const char* path, int mode) { return _access(path, mode); }
153 static inline int chmod(const char* path, int mode) { return _chmod(path, mode); }
154 static inline int chsize(int fd, long size) { return _chsize(fd, size); }
155 static inline int close(int fd) { return _close(fd); }
156 static inline int creat(const char* path, int mode) { return _creat(path, mode); }
157 static inline int dup(int od) { return _dup(od); }
158 static inline int dup2(int od, int nd) { return _dup2(od, nd); }
159 static inline int eof(int fd) { return _eof(fd); }
160 static inline long filelength(int fd) { return _filelength(fd); }
161 static inline int isatty(int fd) { return _isatty(fd); }
162 static inline int locking(int fd, int mode, long size) { return _locking(fd, mode, size); }
163 static inline long lseek(int fd, long off, int where) { return _lseek(fd, off, where); }
164 static inline char* mktemp(char* pat) { return _mktemp(pat); }
165 static inline int read(int fd, void* buf, unsigned int size) { return _read(fd, buf, size); }
166 static inline int setmode(int fd, int mode) { return _setmode(fd, mode); }
167 static inline long tell(int fd) { return _tell(fd); }
168 #ifndef _UMASK_DEFINED
169 static inline int umask(int fd) { return _umask(fd); }
170 #define _UMASK_DEFINED
171 #endif
172 #ifndef _UNLINK_DEFINED
173 static inline int unlink(const char* path) { return _unlink(path); }
174 #define _UNLINK_DEFINED
175 #endif
176 static inline int write(int fd, const void* buf, unsigned int size) { return _write(fd, buf, size); }
177
178 #if defined(__GNUC__) && (__GNUC__ < 4)
179 extern int open(const char*,int,...) __attribute__((alias("_open")));
180 extern int sopen(const char*,int,int,...) __attribute__((alias("_sopen")));
181 #else
182 #define open _open
183 #define sopen _sopen
184 #endif /* __GNUC__ */
185
186 #endif /* __WINE_IO_H */