You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0 KiB

  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 <io.h>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <sys/types.h>
  11. /* struct dirent - same as Unix */
  12. struct dirent {
  13. long d_ino; /* inode (always 1 in WIN32) */
  14. off_t d_off; /* offset to this dirent */
  15. unsigned short d_reclen; /* length of d_name */
  16. char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */
  17. };
  18. /* typedef DIR - not the same as Unix */
  19. typedef struct {
  20. long handle; /* _findfirst/_findnext handle */
  21. short offset; /* offset into directory */
  22. short finished; /* 1 if there are not more files */
  23. struct _finddata_t fileinfo; /* from _findfirst/_findnext */
  24. char *dir; /* the dir we are reading */
  25. struct dirent dent; /* the dirent to return */
  26. } DIR;
  27. /* Function prototypes */
  28. DIR *opendir(const char *);
  29. struct dirent *readdir(DIR *);
  30. int readdir_r(DIR *, struct dirent *, struct dirent **);
  31. int closedir(DIR *);
  32. void rewinddir(DIR *);
  33. #endif /* READDIR_H */