dir.h 839 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. #ifndef _DIR_H
  7. #define _DIR_H
  8. #ifdef __BSD4_2
  9. #define MAXNAMLEN 255
  10. #else
  11. #define MAXNAMLEN 14
  12. #endif
  13. #define DIRBLKSIZ 512
  14. #undef DIRSIZ
  15. #define DIRSIZ(dp) \
  16. ((sizeof(struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1+3)&~3))
  17. struct direct {
  18. long d_ino;
  19. short d_reclen;
  20. short d_namlen;
  21. char d_name[MAXNAMLEN+1];
  22. };
  23. struct _dirdesc {
  24. int dd_fd;
  25. long dd_loc;
  26. long dd_size;
  27. char *dd_buf;
  28. int dd_bsize;
  29. };
  30. typedef struct _dirdesc DIR;
  31. #ifndef NULL
  32. #define NULL 0
  33. #endif
  34. extern DIR *opendir();
  35. extern struct direct *readdir();
  36. extern long telldir();
  37. extern seekdir();
  38. #define rewinddir(dirp) seekdir((dirp), 0L)
  39. extern closedir();
  40. #endif /* _DIR_H */