dir.h 789 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* $Header$ */
  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. #ifdef BSD4_2
  7. #define MAXNAMLEN 255
  8. #else
  9. #define MAXNAMLEN 14
  10. #endif
  11. #define DIRBLKSIZ 512
  12. #undef DIRSIZ
  13. #define DIRSIZ(dp) \
  14. ((sizeof(struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1+3)&~3))
  15. struct direct {
  16. long d_ino;
  17. short d_reclen;
  18. short d_namlen;
  19. char d_name[MAXNAMLEN+1];
  20. };
  21. struct _dirdesc {
  22. int dd_fd;
  23. long dd_loc;
  24. long dd_size;
  25. char *dd_buf;
  26. int dd_bsize;
  27. };
  28. typedef struct _dirdesc DIR;
  29. #ifndef NULL
  30. #define NULL 0
  31. #endif
  32. extern DIR *opendir();
  33. extern struct direct *readdir();
  34. extern long telldir();
  35. extern seekdir();
  36. #define rewinddir(dirp) seekdir((dirp), 0L)
  37. extern closedir();