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)
27 _Out_writes_opt_(_SizeInBytes
) char *_DstBuf
,
28 _In_
int _SizeInBytes
);
30 #ifndef _FSIZE_T_DEFINED
31 typedef unsigned long _fsize_t
;
32 #define _FSIZE_T_DEFINED
35 #ifndef _FINDDATA_T_DEFINED
46 struct _finddata32_t
{
48 __time32_t time_create
;
49 __time32_t time_access
;
50 __time32_t time_write
;
55 #if _INTEGRAL_MAX_BITS >= 64
57 struct _finddatai64_t
{
62 __MINGW_EXTENSION __int64 size
;
66 struct _finddata32i64_t
{
68 __time32_t time_create
;
69 __time32_t time_access
;
70 __time32_t time_write
;
71 __MINGW_EXTENSION __int64 size
;
75 struct _finddata64i32_t
{
77 __time64_t time_create
;
78 __time64_t time_access
;
79 __time64_t time_write
;
84 struct __finddata64_t
{
86 __time64_t time_create
;
87 __time64_t time_access
;
88 __time64_t time_write
;
89 __MINGW_EXTENSION __int64 size
;
92 #endif /* _INTEGRAL_MAX_BITS >= 64 */
94 #define _FINDDATA_T_DEFINED
97 #ifndef _WFINDDATA_T_DEFINED
108 struct _wfinddata32_t
{
110 __time32_t time_create
;
111 __time32_t time_access
;
112 __time32_t time_write
;
117 #if _INTEGRAL_MAX_BITS >= 64
119 struct _wfinddatai64_t
{
124 __MINGW_EXTENSION __int64 size
;
128 struct _wfinddata32i64_t
{
130 __time32_t time_create
;
131 __time32_t time_access
;
132 __time32_t time_write
;
133 __MINGW_EXTENSION __int64 size
;
137 struct _wfinddata64i32_t
{
139 __time64_t time_create
;
140 __time64_t time_access
;
141 __time64_t time_write
;
146 struct _wfinddata64_t
{
148 __time64_t time_create
;
149 __time64_t time_access
;
150 __time64_t time_write
;
151 __MINGW_EXTENSION __int64 size
;
156 #define _WFINDDATA_T_DEFINED
159 #define _A_NORMAL 0x00
160 #define _A_RDONLY 0x01
161 #define _A_HIDDEN 0x02
162 #define _A_SYSTEM 0x04
163 #define _A_SUBDIR 0x10
166 /* Some defines for _access nAccessMode (MS doesn't define them, but
167 * it doesn't seem to hurt to add them). */
168 #define F_OK 0 /* Check for file existence */
169 #define X_OK 1 /* Check for execute permission. */
170 #define W_OK 2 /* Check for write permission */
171 #define R_OK 4 /* Check for read permission */
178 _In_z_
const char *_Filename
,
179 _In_
int _AccessMode
);
186 _In_z_
const char *_Filename
,
194 _In_
int _FileHandle
,
202 _In_
int _FileHandle
);
209 _In_
int _FileHandle
);
216 _In_z_
const char *_Filename
,
217 _In_
int _PermissionMode
);
224 _In_
int _FileHandle
);
231 _In_
int _FileHandleSrc
,
232 _In_
int _FileHandleDst
);
239 _In_
int _FileHandle
);
246 _In_
int _FileHandle
);
252 const char *_Filename
,
253 struct _finddata_t
*_FindData
);
260 _In_z_
const char *_Filename
,
261 _Out_
struct _finddata32_t
*_FindData
);
267 intptr_t _FindHandle
,
268 struct _finddata_t
*_FindData
);
275 _In_
intptr_t _FindHandle
,
276 _Out_
struct _finddata32_t
*_FindData
);
283 _In_
intptr_t _FindHandle
);
290 _In_
int _FileHandle
);
296 _In_
int _FileHandle
,
298 _In_
long _NumOfBytes
);
305 _In_
int _FileHandle
,
314 _Inout_z_
char *_TemplateName
);
321 _Inout_updates_(2) int *_PtHandles
,
322 _In_
unsigned int _PipeSize
,
330 _In_
int _FileHandle
,
331 _Out_writes_bytes_(_MaxCharCount
) void *_DstBuf
,
332 _In_
unsigned int _MaxCharCount
);
334 #ifndef _CRT_DIRECTORY_DEFINED
335 #define _CRT_DIRECTORY_DEFINED
341 _In_z_
const char *_Filename
);
347 _In_z_
const char *_OldFilename
,
348 _In_z_
const char *_NewFilename
);
355 _In_z_
const char *_Filename
);
363 _In_z_
const char *_Filename
);
366 #endif /* _CRT_DIRECTORY_DEFINED */
373 _In_
int _FileHandle
,
381 _In_
int _FileHandle
);
393 _In_
int _FileHandle
,
394 _In_reads_bytes_(_MaxCharCount
) const void *_Buf
,
395 _In_
unsigned int _MaxCharCount
);
397 #if _INTEGRAL_MAX_BITS >= 64
405 _In_
int _FileHandle
);
412 _In_z_
const char *_Filename
,
413 _Out_
struct _finddata32i64_t
*_FindData
);
420 _In_z_
const char *_Filename
,
421 _Out_
struct _finddata64i32_t
*_FindData
);
428 _In_z_
const char *_Filename
,
429 _Out_
struct __finddata64_t
*_FindData
);
436 _In_
intptr_t _FindHandle
,
437 _Out_
struct _finddata32i64_t
*_FindData
);
444 _In_
intptr_t _FindHandle
,
445 _Out_
struct _finddata64i32_t
*_FindData
);
452 _In_
intptr_t _FindHandle
,
453 _Out_
struct __finddata64_t
*_FindData
);
461 _In_
int _FileHandle
,
462 _In_ __int64 _Offset
,
471 _In_
int _FileHandle
);
481 const char *_Filename
,
482 struct _finddata64i32_t
*_FindData
)
484 struct __finddata64_t fd
;
485 intptr_t ret
= _findfirst64(_Filename
,&fd
);
486 _FindData
->attrib
=fd
.attrib
;
487 _FindData
->time_create
=fd
.time_create
;
488 _FindData
->time_access
=fd
.time_access
;
489 _FindData
->time_write
=fd
.time_write
;
490 _FindData
->size
=(_fsize_t
) fd
.size
;
491 strncpy(_FindData
->name
,fd
.name
,260);
499 intptr_t _FindHandle
,
500 struct _finddata64i32_t
*_FindData
)
502 struct __finddata64_t fd
;
503 int ret
= _findnext64(_FindHandle
,&fd
);
504 _FindData
->attrib
=fd
.attrib
;
505 _FindData
->time_create
=fd
.time_create
;
506 _FindData
->time_access
=fd
.time_access
;
507 _FindData
->time_write
=fd
.time_write
;
508 _FindData
->size
=(_fsize_t
) fd
.size
;
509 strncpy(_FindData
->name
,fd
.name
,260);
513 #endif /* _INTEGRAL_MAX_BITS >= 64 */
523 _In_z_
const char *_Path
);
531 _Out_writes_opt_(_SizeInBytes
) char *_DstBuf
,
532 _In_
int _SizeInBytes
);
539 _In_z_
const char *_Path
);
545 _Inout_z_
char *_TemplateName
);
552 _In_z_
const char *_Path
);
559 _In_z_
const char *_Filename
,
560 _In_
int _AccessMode
);
563 #endif /* Not NO_OLDNAMES */
570 _Out_
int *_FileHandle
,
571 _In_z_
const char *_Filename
,
574 _In_
int _PermissionMode
);
577 _CRTIMP
int __cdecl
_open(const char *_Filename
,int _OpenFlag
,...);
578 _CRTIMP
int __cdecl
_sopen(const char *_Filename
,int _OpenFlag
,int _ShareFlag
,...);
580 extern "C++" _CRTIMP
int __cdecl
_open(const char *_Filename
,int _Openflag
,int _PermissionMode
= 0);
581 extern "C++" _CRTIMP
int __cdecl
_sopen(const char *_Filename
,int _Openflag
,int _ShareFlag
,int _PermissionMode
= 0);
592 _In_z_
const wchar_t *_Filename
,
593 _In_
int _AccessMode
);
600 _In_z_
const wchar_t *_Filename
,
608 _In_z_
const wchar_t *_Filename
,
609 _In_
int _PermissionMode
);
616 _In_z_
const wchar_t *_Filename
,
617 _Out_
struct _wfinddata32_t
*_FindData
);
624 _In_
intptr_t _FindHandle
,
625 _Out_
struct _wfinddata32_t
*_FindData
);
632 _In_z_
const wchar_t *_Filename
);
639 _In_z_
const wchar_t *_NewFilename
,
640 _In_z_
const wchar_t *_OldFilename
);
646 _Inout_z_
wchar_t *_TemplateName
);
648 #if _INTEGRAL_MAX_BITS >= 64
655 _In_z_
const wchar_t *_Filename
,
656 _Out_
struct _wfinddata32i64_t
*_FindData
);
663 _In_z_
const wchar_t *_Filename
,
664 _Out_
struct _wfinddata64i32_t
*_FindData
);
671 _In_z_
const wchar_t *_Filename
,
672 _Out_
struct _wfinddata64_t
*_FindData
);
679 _In_
intptr_t _FindHandle
,
680 _Out_
struct _wfinddata32i64_t
*_FindData
);
687 _In_
intptr_t _FindHandle
,
688 _Out_
struct _wfinddata64i32_t
*_FindData
);
695 _In_
intptr_t _FindHandle
,
696 _Out_
struct _wfinddata64_t
*_FindData
);
698 #endif /* _INTEGRAL_MAX_BITS >= 64 */
705 _Out_
int *_FileHandle
,
706 _In_z_
const wchar_t *_Filename
,
709 _In_
int _PermissionFlag
);
711 #if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64))
712 _CRTIMP
int __cdecl
_wopen(const wchar_t *_Filename
,int _OpenFlag
,...);
713 _CRTIMP
int __cdecl
_wsopen(const wchar_t *_Filename
,int _OpenFlag
,int _ShareFlag
,...);
715 extern "C++" _CRTIMP
int __cdecl
_wopen(const wchar_t *_Filename
,int _OpenFlag
,int _PermissionMode
= 0);
716 extern "C++" _CRTIMP
int __cdecl
_wsopen(const wchar_t *_Filename
,int _OpenFlag
,int _ShareFlag
,int _PermissionMode
= 0);
719 #endif /* !_WIO_DEFINED */
724 _In_
int _Filehandle
);
729 _In_
int _Filehandle
);
735 _In_
int _FileHandle
);
741 _In_
intptr_t _OSFileHandle
,
751 _In_z_
const char *_Filename
,
752 _In_
int _AccessMode
);
759 _In_z_
const char *_Filename
,
760 _In_
int _AccessMode
);
767 _In_
int _FileHandle
,
775 _In_
int _FileHandle
);
782 _In_z_
const char *_Filename
,
783 _In_
int _PermissionMode
);
790 _In_
int _FileHandle
);
797 _In_
int _FileHandleSrc
,
798 _In_
int _FileHandleDst
);
805 _In_
int _FileHandle
);
812 _In_
int _FileHandle
);
819 _In_
int _FileHandle
);
826 _In_
int _FileHandle
,
828 _In_
long _NumOfBytes
);
835 _In_
int _FileHandle
,
843 _Inout_z_
char *_TemplateName
);
850 _In_z_
const char *_Filename
,
858 _In_
int _FileHandle
,
859 _Out_writes_bytes_(_MaxCharCount
) void *_DstBuf
,
860 _In_
unsigned int _MaxCharCount
);
867 _In_
int _FileHandle
,
874 const char *_Filename
,
884 _In_
int _FileHandle
);
897 _In_
int _Filehandle
,
898 _In_reads_bytes_(_MaxCharCount
) const void *_Buf
,
899 _In_
unsigned int _MaxCharCount
);
901 #endif /* NO_OLDNAMES */
913 char *getlogin(void);
914 #ifdef __USE_MINGW_ALARM
915 unsigned int alarm(unsigned int seconds
);
918 #ifdef __USE_MINGW_ACCESS
919 /* Old versions of MSVCRT access() just ignored X_OK, while the version
920 shipped with Vista, returns an error code. This will restore the
922 static inline int __mingw_access (const char *__fname
, int __mode
) {
923 return _access (__fname
, __mode
& ~X_OK
);
926 #define access(__f,__m) __mingw_access (__f, __m)
935 #include <sec_api/io_s.h>
937 #endif /* End _IO_H_ */