summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/readdir.h48
-rw-r--r--TSRM/tsrm_win32.c4
2 files changed, 5 insertions, 47 deletions
diff --git a/TSRM/readdir.h b/TSRM/readdir.h
index 0665810c85..11c0f31ea1 100644
--- a/TSRM/readdir.h
+++ b/TSRM/readdir.h
@@ -1,45 +1,3 @@
-#ifndef READDIR_H
-#define READDIR_H
-
-
-/*
- * Structures and types used to implement opendir/readdir/closedir
- * on Windows 95/NT.
- */
-
-#include <windows.h>
-
-#include <io.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <direct.h>
-
-/* struct dirent - same as Unix */
-
-struct dirent {
- long d_ino; /* inode (always 1 in WIN32) */
- off_t d_off; /* offset to this dirent */
- unsigned short d_reclen; /* length of d_name */
- char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */
-};
-
-
-/* typedef DIR - not the same as Unix */
-typedef struct {
- HANDLE handle; /* _findfirst/_findnext handle */
- short offset; /* offset into directory */
- short finished; /* 1 if there are not more files */
- WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */
- char *dir; /* the dir we are reading */
- struct dirent dent; /* the dirent to return */
-} DIR;
-
-/* Function prototypes */
-DIR *opendir(const char *);
-struct dirent *readdir(DIR *);
-int readdir_r(DIR *, struct dirent *, struct dirent **);
-int closedir(DIR *);
-int rewinddir(DIR *);
-
-#endif /* READDIR_H */
+/* Keep this header for compatibility with external code, it's currently not
+ used anywhere in the core and there are no implementations in TSRM. */
+#include "win32/readdir.h"
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 7fa38198de..ac9d667788 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -296,14 +296,14 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
if (CWDG(realpath_cache_size_limit)) {
t = time(0);
- bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
+ bucket = realpath_cache_lookup(pathname, strlen(pathname), t);
if(bucket == NULL && real_path == NULL) {
/* We used the pathname directly. Call tsrm_realpath */
/* so that entry is created in realpath cache */
real_path = (char *)malloc(MAXPATHLEN);
if(tsrm_realpath(pathname, real_path) != NULL) {
pathname = real_path;
- bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
+ bucket = realpath_cache_lookup(pathname, strlen(pathname), t);
PHP_WIN32_IOUTIL_REINIT_W(pathname);
}
}