readdir.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef READDIR_H
  2. #define READDIR_H
  3. /*
  4. * Structures and types used to implement opendir/readdir/closedir
  5. * on Windows 95/NT.
  6. */
  7. #include <config.w32.h>
  8. #include <windows.h>
  9. #include <io.h>
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <sys/types.h>
  13. #include <direct.h>
  14. #define php_readdir_r readdir_r
  15. /* struct dirent - same as Unix */
  16. struct dirent {
  17. long d_ino; /* inode (always 1 in WIN32) */
  18. off_t d_off; /* offset to this dirent */
  19. unsigned short d_reclen; /* length of d_name */
  20. char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */
  21. };
  22. /* typedef DIR - not the same as Unix */
  23. typedef struct {
  24. HANDLE handle; /* _findfirst/_findnext handle */
  25. short offset; /* offset into directory */
  26. short finished; /* 1 if there are not more files */
  27. WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */
  28. char *dir; /* the dir we are reading */
  29. struct dirent dent; /* the dirent to return */
  30. } DIR;
  31. /* Function prototypes */
  32. DIR *opendir(const char *);
  33. struct dirent *readdir(DIR *);
  34. int readdir_r(DIR *, struct dirent *, struct dirent **);
  35. int closedir(DIR *);
  36. int rewinddir(DIR *);
  37. #endif /* READDIR_H */