| /* |
| * This file has no copyright assigned and is placed in the Public Domain. |
| * This file is a part of the mingw-runtime package. |
| * No warranty is given; refer to the file DISCLAIMER within the package. |
| * |
| */ |
| |
| #ifndef _DIRENT_H |
| #define _DIRENT_H |
| |
| /* All the headers include this file. */ |
| #include <_mingw.h> |
| |
| #include <windows.h> |
| //#include <io.h> |
| |
| #ifndef RC_INVOKED |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| #define DT_UNKNOWN 0 |
| #define DT_FIFO 1 |
| #define DT_CHR 2 |
| #define DT_DIR 4 |
| #define DT_BLK 6 |
| #define DT_REG 8 |
| #define DT_LNK 10 |
| #define DT_SOCK 12 |
| #define DT_WHT 14 |
| |
| struct dirent { |
| long int d_ino; /* Always zero. */ |
| unsigned short d_reclen; /* Length of this struct */ |
| unsigned char d_type; /* File type */ |
| unsigned short d_namlen; /* Length of name in d_name. */ |
| char d_name[FILENAME_MAX]; /* File name. */ |
| }; |
| |
| #define _DIRENT_HAVE_D_RECLEN |
| #define _DIRENT_HAVE_D_NAMLEN |
| #define _DIRENT_HAVE_D_TYPE |
| |
| /* |
| * This is an internal data structure. Good programmers will not use it |
| * except as an argument to one of the functions below. |
| * dd_stat field is now int (was short in older versions). |
| */ |
| typedef struct { |
| WIN32_FIND_DATAW dd_data; |
| |
| /* dirent struct to return from dir (NOTE: this makes this thread |
| * safe as long as only one thread uses a particular DIR struct at |
| * a time) */ |
| struct dirent dd_dir; |
| |
| void * dd_handle; |
| |
| /* |
| * Status of search: |
| * 0 = not started yet (next entry to read is first entry) |
| * -1 = off the end |
| * positive = 0 based index of next entry |
| */ |
| int dd_stat; |
| |
| /* given path for dir with search pattern (struct is extended) */ |
| char dd_name[0]; |
| } DIR; |
| |
| DIR *__cdecl __MINGW_NOTHROW opendir(const char *); |
| struct dirent *__cdecl __MINGW_NOTHROW readdir(DIR *); |
| int __cdecl __MINGW_NOTHROW closedir(DIR *); |
| void __cdecl __MINGW_NOTHROW rewinddir(DIR *); |
| long __cdecl __MINGW_NOTHROW telldir(DIR *); |
| void __cdecl __MINGW_NOTHROW seekdir(DIR *, long int); |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| #endif /* Not RC_INVOKED */ |
| |
| #endif |