dirent.h 717 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef __DIRENT_H
  2. #define __DIRENT_H
  3. #pragma lib "/$M/lib/ape/libap.a"
  4. /*
  5. * this must be a power of 2 and a multiple of all the ones in the system
  6. */
  7. #define MAXNAMLEN 255
  8. struct dirent {
  9. char d_name[MAXNAMLEN + 1];
  10. };
  11. typedef struct _dirdesc {
  12. int dd_fd; /* file descriptor */
  13. long dd_loc; /* buf offset of entry from last readdir() */
  14. long dd_size; /* amount of valid data in buffer */
  15. char *dd_buf; /* directory data buffer */
  16. void *dirs;
  17. int dirsize;
  18. int dirloc;
  19. } DIR;
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /*
  24. * functions defined on directories
  25. */
  26. DIR *opendir(const char *);
  27. struct dirent *readdir(DIR *);
  28. void rewinddir(DIR *);
  29. int closedir(DIR *);
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif