home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / e_mac / dirent.h next >
Encoding:
Text File  |  1995-09-05  |  972 b   |  39 lines  |  [TEXT/CWIE]

  1. /* dirent.h */
  2. /* 05Sep95 e */
  3.  
  4. // per Berkeley dirent.h
  5. /*
  6.  * A directory entry has a struct dirent at the front of it, containing its
  7.  * inode number, the length of the entry, and the length of the name
  8.  * contained in the entry.  These are followed by the name padded to a 4
  9.  * byte boundary with null bytes.  All names are guaranteed null terminated.
  10.  * The maximum length of a name in a directory is MAXNAMLEN.
  11.  */
  12.  
  13. #define    MAXNAMLEN    255
  14.  
  15. struct dirent {
  16.     unsigned long  d_fileno;     /* file number of entry */
  17.     unsigned short d_reclen;     /* length of this record */
  18.     unsigned short d_namlen;     /* length of string in d_name */
  19.     char d_name[MAXNAMLEN + 1];  /* name must be no longer than this */
  20. };
  21.  
  22. struct _open_dir
  23. {    short openp;
  24.     short ioVRefNum;
  25.     long dirID;
  26.     long numFiles;
  27.     long index;
  28.     struct dirent entry;
  29. };
  30.  
  31. #define DIR struct _open_dir
  32.  
  33. DIR *opendir(const char *);
  34. struct dirent *readdir(DIR *);
  35. void rewinddir(DIR *);
  36. int closedir(DIR *);
  37.  
  38. /* ** */
  39.