Back to index

php5  5.3.10
readdir.h
Go to the documentation of this file.
00001 #ifndef READDIR_H
00002 #define READDIR_H
00003 
00004 
00005 /*
00006  * Structures and types used to implement opendir/readdir/closedir
00007  * on Windows 95/NT.
00008  */
00009 
00010 #include <config.w32.h>
00011 
00012 #include <windows.h>
00013 
00014 #include <io.h>
00015 #include <stdio.h>
00016 #include <stdlib.h>
00017 #include <sys/types.h>
00018 #include <direct.h>
00019 
00020 #define php_readdir_r readdir_r
00021 
00022 /* struct dirent - same as Unix */
00023 
00024 struct dirent {
00025        long d_ino;                               /* inode (always 1 in WIN32) */
00026        off_t d_off;                       /* offset to this dirent */
00027        unsigned short d_reclen;    /* length of d_name */
00028        char d_name[_MAX_FNAME + 1];       /* filename (null terminated) */
00029 };
00030 
00031 
00032 /* typedef DIR - not the same as Unix */
00033 typedef struct {
00034        HANDLE handle;                            /* _findfirst/_findnext handle */
00035        short offset;                      /* offset into directory */
00036        short finished;                           /* 1 if there are not more files */
00037        WIN32_FIND_DATA fileinfo;   /* from _findfirst/_findnext */
00038        char *dir;                                /* the dir we are reading */
00039        struct dirent dent;                /* the dirent to return */
00040 } DIR;
00041 
00042 /* Function prototypes */
00043 DIR *opendir(const char *);
00044 struct dirent *readdir(DIR *);
00045 int readdir_r(DIR *, struct dirent *, struct dirent **);
00046 int closedir(DIR *);
00047 int rewinddir(DIR *);
00048 
00049 #endif /* READDIR_H */