Fixed some issues found by winapi_check.
[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
11 #include "msvcrt/stdio.h"          /* For FILENAME_MAX */
12 #include "msvcrt/sys/types.h"      /* For time_t */
13
14 /* The following are also defined in dos.h */
15 #define _A_NORMAL 0x00000000
16 #define _A_RDONLY 0x00000001
17 #define _A_HIDDEN 0x00000002
18 #define _A_SYSTEM 0x00000004
19 #define _A_VOLID  0x00000008
20 #define _A_SUBDIR 0x00000010
21 #define _A_ARCH   0x00000020
22
23 typedef unsigned long _fsize_t;
24
25 struct _finddata_t
26 {
27   unsigned attrib;
28   MSVCRT(time_t) time_create;
29   MSVCRT(time_t) time_access;
30   MSVCRT(time_t) time_write;
31   _fsize_t       size;
32   char           name[MSVCRT(FILENAME_MAX)];
33 };
34
35 struct _finddatai64_t
36 {
37   unsigned attrib;
38   MSVCRT(time_t) time_create;
39   MSVCRT(time_t) time_access;
40   MSVCRT(time_t) time_write;
41   __int64        size;
42   char           name[MSVCRT(FILENAME_MAX)];
43 };
44
45 struct _wfinddata_t {
46   unsigned attrib;
47   MSVCRT(time_t) time_create;
48   MSVCRT(time_t) time_access;
49   MSVCRT(time_t) time_write;
50   _fsize_t       size;
51   WCHAR          name[MSVCRT(FILENAME_MAX)];
52 };
53
54 struct _wfinddatai64_t {
55   unsigned attrib;
56   MSVCRT(time_t) time_create;
57   MSVCRT(time_t) time_access;
58   MSVCRT(time_t) time_write;
59   __int64        size;
60   WCHAR          name[MSVCRT(FILENAME_MAX)];
61 };
62
63
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67
68 int         _access(const char*,int);
69 int         _chmod(const char*,int);
70 int         _chsize(int,long);
71 int         _close(int);
72 int         _commit(int);
73 int         _creat(const char*,int);
74 int         _dup(int);
75 int         _dup2(int,int);
76 int         _eof(int);
77 __int64     _filelengthi64(int);
78 long        _filelength(int);
79 int         _findclose(long);
80 long        _findfirst(const char*,struct _finddata_t*);
81 long        _findfirsti64(const char*, struct _finddatai64_t*);
82 int         _findnext(long,struct _finddata_t*);
83 int         _findnexti64(long, struct _finddatai64_t*);
84 long        _get_osfhandle(int);
85 int         _isatty(int);
86 int         _locking(int,int,long);
87 long        _lseek(int,long,int);
88 __int64     _lseeki64(int,__int64,int);
89 char*       _mktemp(char*);
90 int         _open(const char*,int,...);
91 int         _open_osfhandle(long,int);
92 int         _pipe(int*,unsigned int,int);
93 int         _read(int,void*,unsigned int);
94 int         _setmode(int,int);
95 int         _sopen(const char*,int,int,...);
96 long        _tell(int);
97 __int64     _telli64(int);
98 int         _umask(int);
99 int         _unlink(const char*);
100 int         _write(int,const void*,unsigned int);
101
102 int         MSVCRT(remove)(const char*);
103 int         MSVCRT(rename)(const char*,const char*);
104
105 int         _waccess(const WCHAR*,int);
106 int         _wchmod(const WCHAR*,int);
107 int         _wcreat(const WCHAR*,int);
108 long        _wfindfirst(const WCHAR*,struct _wfinddata_t*);
109 long        _wfindfirsti64(const WCHAR*, struct _wfinddatai64_t*);
110 int         _wfindnext(long,struct _wfinddata_t*);
111 int         _wfindnexti64(long, struct _wfinddatai64_t*);
112 WCHAR*      _wmktemp(WCHAR*);
113 int         _wopen(const WCHAR*,int,...);
114 int         _wrename(const WCHAR*,const WCHAR*);
115 int         _wsopen(const WCHAR*,int,int,...);
116 int         _wunlink(const WCHAR*);
117
118
119 #ifdef __cplusplus
120 }
121 #endif
122
123
124 #ifndef USE_MSVCRT_PREFIX
125 #define access _access
126 #define chmod _chmod
127 #define chsize _chsize
128 #define close _close
129 #define creat _creat
130 #define dup _dup
131 #define dup2 _dup2
132 #define eof _eof
133 #define filelength _filelength
134 #define isatty _isatty
135 #define locking _locking
136 #define lseek _lseek
137 #define mktemp _mktemp
138 #define open _open
139 #define read _read
140 #define setmode _setmode
141 #define sopen _sopen
142 #define tell _tell
143 #define umask _umask
144 #define unlink _unlink
145 #define write _write
146 #endif /* USE_MSVCRT_PREFIX */
147
148 #endif /* __WINE_IO_H */