summaryrefslogtreecommitdiff
path: root/win32/readdir.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /win32/readdir.h
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'win32/readdir.h')
-rw-r--r--win32/readdir.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/win32/readdir.h b/win32/readdir.h
new file mode 100644
index 0000000..f1fb3a7
--- /dev/null
+++ b/win32/readdir.h
@@ -0,0 +1,49 @@
+#ifndef READDIR_H
+#define READDIR_H
+
+
+/*
+ * Structures and types used to implement opendir/readdir/closedir
+ * on Windows 95/NT.
+ */
+
+#include <config.w32.h>
+
+#include <windows.h>
+
+#include <io.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <direct.h>
+
+#define php_readdir_r readdir_r
+
+/* 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 */