3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is part of the w64 mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within this package.
13 #pragma pack(push,_CRT_PACKING)
21 _CRTIMP
char* __cdecl
_getcwd (char*, int);
22 #ifndef _FSIZE_T_DEFINED
23 typedef unsigned long _fsize_t
;
24 #define _FSIZE_T_DEFINED
27 #ifndef _FINDDATA_T_DEFINED
29 struct _finddata32_t
{
31 __time32_t time_create
;
32 __time32_t time_access
;
33 __time32_t time_write
;
38 /*#if _INTEGRAL_MAX_BITS >= 64*/
40 struct _finddata32i64_t
{
42 __time32_t time_create
;
43 __time32_t time_access
;
44 __time32_t time_write
;
49 struct _finddata64i32_t
{
51 __time64_t time_create
;
52 __time64_t time_access
;
53 __time64_t time_write
;
58 struct __finddata64_t
{
60 __time64_t time_create
;
61 __time64_t time_access
;
62 __time64_t time_write
;
68 #ifdef _USE_32BIT_TIME_T
69 #define _finddata_t _finddata32_t
70 #define _finddatai64_t _finddata32i64_t
73 #define _findfirst _findfirst32
74 #define _findnext _findnext32
76 #define _findfirst32 _findfirst
77 #define _findnext32 _findnext
79 #define _findfirsti64 _findfirst32i64
80 #define _findnexti64 _findnext32i64
82 #define _finddata_t _finddata64i32_t
83 #define _finddatai64_t __finddata64_t
85 #define _findfirst _findfirst64i32
86 #define _findnext _findnext64i32
87 #define _findfirsti64 _findfirst64
88 #define _findnexti64 _findnext64
91 #define _FINDDATA_T_DEFINED
94 #ifndef _WFINDDATA_T_DEFINED
96 struct _wfinddata32_t
{
98 __time32_t time_create
;
99 __time32_t time_access
;
100 __time32_t time_write
;
105 /* #if _INTEGRAL_MAX_BITS >= 64 */
107 struct _wfinddata32i64_t
{
109 __time32_t time_create
;
110 __time32_t time_access
;
111 __time32_t time_write
;
116 struct _wfinddata64i32_t
{
118 __time64_t time_create
;
119 __time64_t time_access
;
120 __time64_t time_write
;
125 struct _wfinddata64_t
{
127 __time64_t time_create
;
128 __time64_t time_access
;
129 __time64_t time_write
;
135 #ifdef _USE_32BIT_TIME_T
136 #define _wfinddata_t _wfinddata32_t
137 #define _wfinddatai64_t _wfinddata32i64_t
139 #define _wfindfirst _wfindfirst32
140 #define _wfindnext _wfindnext32
141 #define _wfindfirsti64 _wfindfirst32i64
142 #define _wfindnexti64 _wfindnext32i64
144 #define _wfinddata_t _wfinddata64i32_t
145 #define _wfinddatai64_t _wfinddata64_t
147 #define _wfindfirst _wfindfirst64i32
148 #define _wfindnext _wfindnext64i32
149 #define _wfindfirsti64 _wfindfirst64
150 #define _wfindnexti64 _wfindnext64
153 #define _WFINDDATA_T_DEFINED
156 #define _A_NORMAL 0x00
157 #define _A_RDONLY 0x01
158 #define _A_HIDDEN 0x02
159 #define _A_SYSTEM 0x04
160 #define _A_SUBDIR 0x10
163 #ifndef _SIZE_T_DEFINED
164 #define _SIZE_T_DEFINED
167 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
168 typedef unsigned int size_t __attribute__ ((mode (DI
)));
170 typedef unsigned __int64
size_t;
173 typedef unsigned int size_t;
177 #ifndef _SSIZE_T_DEFINED
178 #define _SSIZE_T_DEFINED
181 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
182 typedef int ssize_t
__attribute__ ((mode (DI
)));
184 typedef __int64 ssize_t
;
191 #ifndef _OFF_T_DEFINED
192 #define _OFF_T_DEFINED
196 #if !defined(NO_OLDNAMES) || defined(_POSIX)
202 #ifndef _OFF64_T_DEFINED
203 #define _OFF64_T_DEFINED
204 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
205 typedef int _off64_t
__attribute__ ((mode (DI
)));
206 #if !defined(NO_OLDNAMES) || defined(_POSIX)
207 typedef int off64_t
__attribute__ ((mode (DI
)));
210 typedef long long _off64_t
;
211 #if !defined(NO_OLDNAMES) || defined(_POSIX)
212 typedef long long off64_t
;
217 /* Some defines for _access nAccessMode (MS doesn't define them, but
218 * it doesn't seem to hurt to add them). */
219 #define F_OK 0 /* Check for file existence */
220 #define X_OK 1 /* Check for execute permission. */
221 #define W_OK 2 /* Check for write permission */
222 #define R_OK 4 /* Check for read permission */
224 _CRTIMP
int __cdecl
_access(const char *_Filename
,int _AccessMode
);
225 _CRTIMP
int __cdecl
_chmod(const char *_Filename
,int _Mode
);
226 _CRTIMP
int __cdecl
_chsize(int _FileHandle
,long _Size
);
227 _CRTIMP
int __cdecl
_close(int _FileHandle
);
228 _CRTIMP
int __cdecl
_commit(int _FileHandle
);
229 _CRTIMP
int __cdecl
_creat(const char *_Filename
,int _PermissionMode
);
230 _CRTIMP
int __cdecl
_dup(int _FileHandle
);
231 _CRTIMP
int __cdecl
_dup2(int _FileHandleSrc
,int _FileHandleDst
);
232 _CRTIMP
int __cdecl
_eof(int _FileHandle
);
233 _CRTIMP
long __cdecl
_filelength(int _FileHandle
);
234 _CRTIMP
intptr_t __cdecl
_findfirst32(const char *_Filename
,struct _finddata32_t
*_FindData
);
235 _CRTIMP
int __cdecl
_findnext32(intptr_t _FindHandle
,struct _finddata32_t
*_FindData
);
236 _CRTIMP
int __cdecl
_findclose(intptr_t _FindHandle
);
237 _CRTIMP
int __cdecl
_isatty(int _FileHandle
);
238 _CRTIMP
int __cdecl
_locking(int _FileHandle
,int _LockMode
,long _NumOfBytes
);
239 _CRTIMP
long __cdecl
_lseek(int _FileHandle
,long _Offset
,int _Origin
);
240 _off64_t
lseek64(int fd
,_off64_t offset
, int whence
);
241 _CRTIMP
char *__cdecl
_mktemp(char *_TemplateName
);
242 _CRTIMP
int __cdecl
_pipe(int *_PtHandles
,unsigned int _PipeSize
,int _TextMode
);
243 _CRTIMP
int __cdecl
_read(int _FileHandle
,void *_DstBuf
,unsigned int _MaxCharCount
);
245 #ifndef _CRT_DIRECTORY_DEFINED
246 #define _CRT_DIRECTORY_DEFINED
247 int __cdecl
remove(const char *_Filename
);
248 int __cdecl
rename(const char *_OldFilename
,const char *_NewFilename
);
249 _CRTIMP
int __cdecl
_unlink(const char *_Filename
);
251 int __cdecl
unlink(const char *_Filename
);
255 _CRTIMP
int __cdecl
_setmode(int _FileHandle
,int _Mode
);
256 _CRTIMP
long __cdecl
_tell(int _FileHandle
);
257 _CRTIMP
int __cdecl
_umask(int _Mode
);
258 _CRTIMP
int __cdecl
_write(int _FileHandle
,const void *_Buf
,unsigned int _MaxCharCount
);
260 #if _INTEGRAL_MAX_BITS >= 64
261 _CRTIMP __int64 __cdecl
_filelengthi64(int _FileHandle
);
262 _CRTIMP
intptr_t __cdecl
_findfirst32i64(const char *_Filename
,struct _finddata32i64_t
*_FindData
);
263 _CRTIMP
intptr_t __cdecl
_findfirst64(const char *_Filename
,struct __finddata64_t
*_FindData
);
267 intptr_t __cdecl
_findfirst64i32(const char *_Filename
,struct _finddata64i32_t
*_FindData
);
268 __CRT_INLINE
intptr_t __cdecl
_findfirst64i32(const char *_Filename
,struct _finddata64i32_t
*_FindData
)
270 struct __finddata64_t fd
;
271 intptr_t ret
= _findfirst64(_Filename
,&fd
);
272 _FindData
->attrib
=fd
.attrib
;
273 _FindData
->time_create
=fd
.time_create
;
274 _FindData
->time_access
=fd
.time_access
;
275 _FindData
->time_write
=fd
.time_write
;
276 _FindData
->size
=(_fsize_t
) fd
.size
;
277 strncpy(_FindData
->name
,fd
.name
,260);
280 _CRTIMP
int __cdecl
_findnext32i64(intptr_t _FindHandle
,struct _finddata32i64_t
*_FindData
);
281 _CRTIMP
int __cdecl
_findnext64(intptr_t _FindHandle
,struct __finddata64_t
*_FindData
);
282 int __cdecl
_findnext64i32(intptr_t _FindHandle
,struct _finddata64i32_t
*_FindData
);
283 __CRT_INLINE
int __cdecl
_findnext64i32(intptr_t _FindHandle
,struct _finddata64i32_t
*_FindData
)
285 struct __finddata64_t fd
;
286 int ret
= _findnext64(_FindHandle
,&fd
);
287 _FindData
->attrib
=fd
.attrib
;
288 _FindData
->time_create
=fd
.time_create
;
289 _FindData
->time_access
=fd
.time_access
;
290 _FindData
->time_write
=fd
.time_write
;
291 _FindData
->size
=(_fsize_t
) fd
.size
;
292 strncpy(_FindData
->name
,fd
.name
,260);
295 __int64 __cdecl
_lseeki64(int _FileHandle
,__int64 _Offset
,int _Origin
);
296 __int64 __cdecl
_telli64(int _FileHandle
);
301 int __cdecl
chdir (const char *);
302 char *__cdecl
getcwd (char *, int);
303 int __cdecl
mkdir (const char *);
304 char *__cdecl
mktemp(char *);
305 int __cdecl
rmdir (const char*);
306 int __cdecl
chmod (const char *, int);
309 #endif /* Not NO_OLDNAMES */
311 _CRTIMP errno_t __cdecl
_sopen_s(int *_FileHandle
,const char *_Filename
,int _OpenFlag
,int _ShareFlag
,int _PermissionMode
);
314 _CRTIMP
int __cdecl
_open(const char *_Filename
,int _OpenFlag
,...);
315 _CRTIMP
int __cdecl
_sopen(const char *_Filename
,int _OpenFlag
,int _ShareFlag
,...);
317 extern "C++" _CRTIMP
int __cdecl
_open(const char *_Filename
,int _Openflag
,int _PermissionMode
= 0);
318 extern "C++" _CRTIMP
int __cdecl
_sopen(const char *_Filename
,int _Openflag
,int _ShareFlag
,int _PermissionMode
= 0);
323 _CRTIMP
int __cdecl
_waccess(const wchar_t *_Filename
,int _AccessMode
);
324 _CRTIMP
int __cdecl
_wchmod(const wchar_t *_Filename
,int _Mode
);
325 _CRTIMP
int __cdecl
_wcreat(const wchar_t *_Filename
,int _PermissionMode
);
326 _CRTIMP
intptr_t __cdecl
_wfindfirst32(const wchar_t *_Filename
,struct _wfinddata32_t
*_FindData
);
327 _CRTIMP
int __cdecl
_wfindnext32(intptr_t _FindHandle
,struct _wfinddata32_t
*_FindData
);
328 _CRTIMP
int __cdecl
_wunlink(const wchar_t *_Filename
);
329 _CRTIMP
int __cdecl
_wrename(const wchar_t *_NewFilename
,const wchar_t *_OldFilename
);
330 _CRTIMP
wchar_t *__cdecl
_wmktemp(wchar_t *_TemplateName
);
332 #if _INTEGRAL_MAX_BITS >= 64
333 _CRTIMP
intptr_t __cdecl
_wfindfirst32i64(const wchar_t *_Filename
,struct _wfinddata32i64_t
*_FindData
);
334 intptr_t __cdecl
_wfindfirst64i32(const wchar_t *_Filename
,struct _wfinddata64i32_t
*_FindData
);
335 _CRTIMP
intptr_t __cdecl
_wfindfirst64(const wchar_t *_Filename
,struct _wfinddata64_t
*_FindData
);
336 _CRTIMP
int __cdecl
_wfindnext32i64(intptr_t _FindHandle
,struct _wfinddata32i64_t
*_FindData
);
337 int __cdecl
_wfindnext64i32(intptr_t _FindHandle
,struct _wfinddata64i32_t
*_FindData
);
338 _CRTIMP
int __cdecl
_wfindnext64(intptr_t _FindHandle
,struct _wfinddata64_t
*_FindData
);
341 _CRTIMP errno_t __cdecl
_wsopen_s(int *_FileHandle
,const wchar_t *_Filename
,int _OpenFlag
,int _ShareFlag
,int _PermissionFlag
);
343 #if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64))
344 _CRTIMP
int __cdecl
_wopen(const wchar_t *_Filename
,int _OpenFlag
,...);
345 _CRTIMP
int __cdecl
_wsopen(const wchar_t *_Filename
,int _OpenFlag
,int _ShareFlag
,...);
347 extern "C++" _CRTIMP
int __cdecl
_wopen(const wchar_t *_Filename
,int _OpenFlag
,int _PermissionMode
= 0);
348 extern "C++" _CRTIMP
int __cdecl
_wsopen(const wchar_t *_Filename
,int _OpenFlag
,int _ShareFlag
,int _PermissionMode
= 0);
353 int __cdecl
__lock_fhandle(int _Filehandle
);
354 void __cdecl
_unlock_fhandle(int _Filehandle
);
355 _CRTIMP
intptr_t __cdecl
_get_osfhandle(int _FileHandle
);
356 _CRTIMP
int __cdecl
_open_osfhandle(intptr_t _OSFileHandle
,int _Flags
);
359 int __cdecl
access(const char *_Filename
,int _AccessMode
);
360 int __cdecl
chmod(const char *_Filename
,int _AccessMode
);
361 int __cdecl
chsize(int _FileHandle
,long _Size
);
362 int __cdecl
close(int _FileHandle
);
363 int __cdecl
creat(const char *_Filename
,int _PermissionMode
);
364 int __cdecl
dup(int _FileHandle
);
365 int __cdecl
dup2(int _FileHandleSrc
,int _FileHandleDst
);
366 int __cdecl
eof(int _FileHandle
);
367 long __cdecl
filelength(int _FileHandle
);
368 int __cdecl
isatty(int _FileHandle
);
369 int __cdecl
locking(int _FileHandle
,int _LockMode
,long _NumOfBytes
);
370 long __cdecl
lseek(int _FileHandle
,long _Offset
,int _Origin
);
371 char *__cdecl
mktemp(char *_TemplateName
);
372 int __cdecl
open(const char *_Filename
,int _OpenFlag
,...);
373 int __cdecl
read(int _FileHandle
,void *_DstBuf
,unsigned int _MaxCharCount
);
374 int __cdecl
setmode(int _FileHandle
,int _Mode
);
375 int __cdecl
sopen(const char *_Filename
,int _OpenFlag
,int _ShareFlag
,...);
376 long __cdecl
tell(int _FileHandle
);
377 int __cdecl
umask(int _Mode
);
378 int __cdecl
write(int _Filehandle
,const void *_Buf
,unsigned int _MaxCharCount
);
391 char *getlogin(void);
392 #ifdef __USE_MINGW_ALARM
393 unsigned int alarm(unsigned int seconds
);
396 #ifdef __USE_MINGW_ACCESS
397 /* Old versions of MSVCRT access() just ignored X_OK, while the version
398 shipped with Vista, returns an error code. This will restore the
400 static inline int __mingw_access (const char *__fname
, int __mode
) {
401 return _access (__fname
, __mode
& ~X_OK
);
404 #define access(__f,__m) __mingw_access (__f, __m)
415 #include <sec_api/io_s.h>
417 #endif /* End _IO_H_ */