Source code of Windows XP (NT5)
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.

68 lines
1.7 KiB

  1. /*
  2. <dirent.h> -- definitions for SVR3 directory access routines
  3. last edit: 25-Apr-1987 D A Gwyn
  4. Prerequisite: <sys/types.h>
  5. */
  6. #ifndef _PAX_DIRENT_H
  7. #define _PAX_DIRENT_H
  8. #include "config.h"
  9. #ifdef USG
  10. #define UFS
  11. #else
  12. #ifdef BSD
  13. #define BFS
  14. #endif
  15. #endif
  16. struct dirent { /* data from getdents()/readdir() */
  17. long d_ino; /* inode number of entry */
  18. off_t d_off; /* offset of disk directory entry */
  19. unsigned short d_reclen; /* length of this record */
  20. char d_name[1]; /* name of file (non-POSIX) */
  21. };
  22. typedef struct {
  23. int dd_fd; /* file descriptor */
  24. int dd_loc; /* offset in block */
  25. int dd_size; /* amount of valid data */
  26. char *dd_buf; /* -> directory block */
  27. } DIR; /* stream data from opendir() */
  28. /*
  29. * The following nonportable ugliness could have been avoided by defining
  30. * DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments.
  31. */
  32. #define DIRENTBASESIZ (((struct dirent *)0)->d_name \
  33. - (char *)&((struct dirent *)0)->d_ino)
  34. #define DIRENTSIZ( namlen ) ((DIRENTBASESIZ + sizeof(long) + (namlen)) \
  35. / sizeof(long) * sizeof(long))
  36. #define MAXNAMLEN 512 /* maximum filename length */
  37. #ifndef NAME_MAX
  38. #define NAME_MAX (MAXNAMLEN - 1) /* DAG -- added for POSIX */
  39. #endif
  40. #define DIRBUF 8192 /* buffer size for fs-indep. dirs */
  41. /* must in general be larger than the filesystem buffer size */
  42. #ifdef __STDC__ /* Xn */
  43. extern DIR *opendir(char *);
  44. extern struct dirent *readdir(DIR *);
  45. extern OFFSET telldir(DIR *);
  46. extern void seekdir(DIR *, OFFSET);
  47. extern int closedir(DIR *);
  48. #else /* Xn */
  49. extern DIR *opendir();
  50. extern struct dirent *readdir();
  51. extern OFFSET telldir();
  52. extern void seekdir();
  53. extern int closedir();
  54. #endif /* Xn */
  55. #endif /* _PAX_DIRENT_H */