winemac: Don't use snprintfW in macdrv_GetKeyNameText.
[wine.git] / include / msvcrt / io.h
blob2d4a9e61e0b5935e2df21ac3fc75fcd5ce626e54
1 /*
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.
7 */
8 #ifndef __WINE_IO_H
9 #define __WINE_IO_H
11 #include <corecrt.h>
12 #include <corecrt_wio.h>
14 #include <pshpack8.h>
16 /* The following are also defined in dos.h */
17 #define _A_NORMAL 0x00000000
18 #define _A_RDONLY 0x00000001
19 #define _A_HIDDEN 0x00000002
20 #define _A_SYSTEM 0x00000004
21 #define _A_VOLID 0x00000008
22 #define _A_SUBDIR 0x00000010
23 #define _A_ARCH 0x00000020
25 #ifndef _FINDDATA_T_DEFINED
26 #define _FINDDATA_T_DEFINED
27 struct _finddata_t
29 unsigned attrib;
30 time_t time_create;
31 time_t time_access;
32 time_t time_write;
33 _fsize_t size;
34 char name[260];
37 struct _finddatai64_t
39 unsigned attrib;
40 time_t time_create;
41 time_t time_access;
42 time_t time_write;
43 __int64 DECLSPEC_ALIGN(8) size;
44 char name[260];
47 struct _finddata64_t
49 unsigned attrib;
50 __time64_t time_create;
51 __time64_t time_access;
52 __time64_t time_write;
53 __int64 DECLSPEC_ALIGN(8) size;
54 char name[260];
56 #endif /* _FINDDATA_T_DEFINED */
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
62 _ACRTIMP int __cdecl _access(const char*,int);
63 _ACRTIMP int __cdecl _chmod(const char*,int);
64 _ACRTIMP int __cdecl _chsize(int,__msvcrt_long);
65 _ACRTIMP int __cdecl _chsize_s(int,__int64);
66 _ACRTIMP int __cdecl _close(int);
67 _ACRTIMP int __cdecl _commit(int);
68 _ACRTIMP int __cdecl _creat(const char*,int);
69 _ACRTIMP int __cdecl _dup(int);
70 _ACRTIMP int __cdecl _dup2(int,int);
71 _ACRTIMP int __cdecl _eof(int);
72 _ACRTIMP __int64 __cdecl _filelengthi64(int);
73 _ACRTIMP __msvcrt_long __cdecl _filelength(int);
74 _ACRTIMP int __cdecl _findclose(intptr_t);
75 _ACRTIMP intptr_t __cdecl _findfirst(const char*,struct _finddata_t*);
76 _ACRTIMP intptr_t __cdecl _findfirsti64(const char*, struct _finddatai64_t*);
77 _ACRTIMP intptr_t __cdecl _findfirst64(const char*, struct _finddata64_t*);
78 _ACRTIMP int __cdecl _findnext(intptr_t,struct _finddata_t*);
79 _ACRTIMP int __cdecl _findnexti64(intptr_t, struct _finddatai64_t*);
80 _ACRTIMP int __cdecl _findnext64(intptr_t, struct _finddata64_t*);
81 _ACRTIMP intptr_t __cdecl _get_osfhandle(int);
82 _ACRTIMP int __cdecl _isatty(int);
83 _ACRTIMP int __cdecl _locking(int,int,__msvcrt_long);
84 _ACRTIMP __msvcrt_long __cdecl _lseek(int,__msvcrt_long,int);
85 _ACRTIMP __int64 __cdecl _lseeki64(int,__int64,int);
86 _ACRTIMP char* __cdecl _mktemp(char*);
87 _ACRTIMP int __cdecl _mktemp_s(char*,size_t);
88 _ACRTIMP int WINAPIV _open(const char*,int,...);
89 _ACRTIMP int __cdecl _open_osfhandle(intptr_t,int);
90 _ACRTIMP int __cdecl _pipe(int*,unsigned int,int);
91 _ACRTIMP int __cdecl _read(int,void*,unsigned int);
92 _ACRTIMP int __cdecl _setmode(int,int);
93 _ACRTIMP int WINAPIV _sopen(const char*,int,int,...);
94 _ACRTIMP errno_t __cdecl _sopen_dispatch(const char*,int,int,int,int*,int);
95 _ACRTIMP errno_t __cdecl _sopen_s(int*,const char*,int,int,int);
96 _ACRTIMP __msvcrt_long __cdecl _tell(int);
97 _ACRTIMP __int64 __cdecl _telli64(int);
98 _ACRTIMP int __cdecl _umask(int);
99 _ACRTIMP int __cdecl _unlink(const char*);
100 _ACRTIMP int __cdecl _write(int,const void*,unsigned int);
102 _ACRTIMP int __cdecl remove(const char*);
103 _ACRTIMP int __cdecl rename(const char*,const char*);
105 #ifdef __cplusplus
107 #endif
110 static inline int access(const char* path, int mode) { return _access(path, mode); }
111 static inline int chmod(const char* path, int mode) { return _chmod(path, mode); }
112 static inline int chsize(int fd, __msvcrt_long size) { return _chsize(fd, size); }
113 static inline int close(int fd) { return _close(fd); }
114 static inline int creat(const char* path, int mode) { return _creat(path, mode); }
115 static inline int dup(int od) { return _dup(od); }
116 static inline int dup2(int od, int nd) { return _dup2(od, nd); }
117 static inline int eof(int fd) { return _eof(fd); }
118 static inline __msvcrt_long filelength(int fd) { return _filelength(fd); }
119 static inline int isatty(int fd) { return _isatty(fd); }
120 static inline int locking(int fd, int mode, __msvcrt_long size) { return _locking(fd, mode, size); }
121 static inline __msvcrt_long lseek(int fd, __msvcrt_long off, int where) { return _lseek(fd, off, where); }
122 static inline char* mktemp(char* pat) { return _mktemp(pat); }
123 static inline int read(int fd, void* buf, unsigned int size) { return _read(fd, buf, size); }
124 static inline int setmode(int fd, int mode) { return _setmode(fd, mode); }
125 static inline __msvcrt_long tell(int fd) { return _tell(fd); }
126 #ifndef _UMASK_DEFINED
127 static inline int umask(int fd) { return _umask(fd); }
128 #define _UMASK_DEFINED
129 #endif
130 #ifndef _UNLINK_DEFINED
131 static inline int unlink(const char* path) { return _unlink(path); }
132 #define _UNLINK_DEFINED
133 #endif
134 static inline int write(int fd, const void* buf, unsigned int size) { return _write(fd, buf, size); }
136 #if defined(__GNUC__) && (__GNUC__ < 4)
137 _ACRTIMP int WINAPIV open(const char*,int,...) __attribute__((alias("_open")));
138 _ACRTIMP int WINAPIV sopen(const char*,int,int,...) __attribute__((alias("_sopen")));
139 #else
140 #define open _open
141 #define sopen _sopen
142 #endif /* __GNUC__ */
144 #include <poppack.h>
146 #endif /* __WINE_IO_H */