home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / unixtools / unixlib / clib / sys / h / dirent < prev    next >
Encoding:
Text File  |  1992-07-21  |  754 b   |  30 lines

  1. /* sys/dirent.h (c) Copyright 1990 H.Rogers */
  2.  
  3. #ifndef __SYS_DIRENT_H
  4. #define __SYS_DIRENT_H
  5.  
  6. #ifndef __SYS_TYPES_H
  7. #include "sys/types.h"
  8. #endif
  9.  
  10. #define MAXNAMLEN    10    /* ADFS braindamage */
  11.  
  12. /* This isn't really how ADFS stores files in a directory, but
  13.  * since no I/O is permitted on directories anyway this doesn't
  14.  * really matter. */
  15.  
  16. struct    direct
  17.   {
  18.   off_t     d_off;        /* offset of next disk directory entry */
  19.   ino_t     d_fileno;        /* file number of entry */
  20.   size_t    d_reclen;        /* length of this record */
  21.   size_t    d_namlen;        /* length of d_name */
  22.   char        d_name[MAXNAMLEN + 1];    /* name */
  23.   };
  24.  
  25. #define DIRSIZ(dp) (((sizeof(struct direct) - \
  26.     (MAXNAMLEN + 1) + ((dp)->d_namlen + 1)) + \
  27.     (sizeof(size_t) - 1)) & ~(sizeof(size_t) - 1))
  28.  
  29. #endif
  30.