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 <windows.h>
00011 
00012 #include <io.h>
00013 #include <stdio.h>
00014 #include <stdlib.h>
00015 #include <sys/types.h>
00016 #include <direct.h>
00017 
00018 /* struct dirent - same as Unix */
00019 
00020 struct dirent {
00021        long d_ino;                               /* inode (always 1 in WIN32) */
00022        off_t d_off;                       /* offset to this dirent */
00023        unsigned short d_reclen;    /* length of d_name */
00024        char d_name[_MAX_FNAME + 1];       /* filename (null terminated) */
00025 };
00026 
00027 
00028 /* typedef DIR - not the same as Unix */
00029 typedef struct {
00030        HANDLE handle;                            /* _findfirst/_findnext handle */
00031        short offset;                      /* offset into directory */
00032        short finished;                           /* 1 if there are not more files */
00033        WIN32_FIND_DATA fileinfo;   /* from _findfirst/_findnext */
00034        char *dir;                                /* the dir we are reading */
00035        struct dirent dent;                /* the dirent to return */
00036 } DIR;
00037 
00038 /* Function prototypes */
00039 DIR *opendir(const char *);
00040 struct dirent *readdir(DIR *);
00041 int readdir_r(DIR *, struct dirent *, struct dirent **);
00042 int closedir(DIR *);
00043 int rewinddir(DIR *);
00044 
00045 #endif /* READDIR_H */