diff options
author | Dmitry Stogov <dmitry@php.net> | 2006-11-10 11:20:48 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2006-11-10 11:20:48 +0000 |
commit | 41c81f20e180bb73d1765866ef2b1eafe8ccc35c (patch) | |
tree | 503349e650deba64c30aabfa0aa6e32f35ace113 /TSRM | |
parent | a5f951f27cf9937f0cfd43afe0ff8938faa7cfb4 (diff) | |
download | php-git-41c81f20e180bb73d1765866ef2b1eafe8ccc35c.tar.gz |
opendir() is reimplemented using GetFistFile/GetNextFile those are faster then _findfirst/_findnext
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/readdir.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/TSRM/readdir.h b/TSRM/readdir.h index b0f1ad9e6f..139bc7bb70 100644 --- a/TSRM/readdir.h +++ b/TSRM/readdir.h @@ -7,11 +7,15 @@ * on Windows 95/NT. */ +#define _WIN32_WINNT 0x0400 + +#include <windows.h> + #include <io.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> - +#include <direct.h> /* struct dirent - same as Unix */ @@ -25,10 +29,10 @@ struct dirent { /* typedef DIR - not the same as Unix */ typedef struct { - long handle; /* _findfirst/_findnext handle */ + HANDLE handle; /* _findfirst/_findnext handle */ short offset; /* offset into directory */ short finished; /* 1 if there are not more files */ - struct _finddata_t fileinfo; /* from _findfirst/_findnext */ + WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */ char *dir; /* the dir we are reading */ struct dirent dent; /* the dirent to return */ } DIR; @@ -38,7 +42,6 @@ DIR *opendir(const char *); struct dirent *readdir(DIR *); int readdir_r(DIR *, struct dirent *, struct dirent **); int closedir(DIR *); -void rewinddir(DIR *); - +int rewinddir(DIR *); #endif /* READDIR_H */ |