summaryrefslogtreecommitdiff
path: root/TSRM/readdir.h
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-09-03 18:47:35 (GMT)
committerAndi Gutmans <andi@php.net>2000-09-03 18:47:35 (GMT)
commit03432bf61f14bbd415972fe6b4e2ba94f342efaa (patch)
tree993700b4bfc39567c96e986a5bae7e26c893ea58 /TSRM/readdir.h
parent6c6471b16018b8e225043e436fa8c819a57cd459 (diff)
downloadphp-03432bf61f14bbd415972fe6b4e2ba94f342efaa.tar.gz
- Make TSRM work on Windows.
Diffstat (limited to 'TSRM/readdir.h')
-rw-r--r--TSRM/readdir.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/TSRM/readdir.h b/TSRM/readdir.h
new file mode 100644
index 0000000..b0f1ad9
--- /dev/null
+++ b/TSRM/readdir.h
@@ -0,0 +1,44 @@
+#ifndef READDIR_H
+#define READDIR_H
+
+
+/*
+ * Structures and types used to implement opendir/readdir/closedir
+ * on Windows 95/NT.
+ */
+
+#include <io.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.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 {
+ long 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 */
+ 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 *);
+void rewinddir(DIR *);
+
+
+#endif /* READDIR_H */