home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8708 / 24 / ndir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-13  |  1.1 KB  |  51 lines

  1. /* @(#)ndir.h    1.4    4/16/85 */
  2. #ifndef DEV_BSIZE
  3. #define    DEV_BSIZE    512
  4. #endif
  5. #define DIRBLKSIZ    DEV_BSIZE
  6. #define    MAXNAMLEN    255
  7.  
  8. struct    direct {
  9.     long    d_ino;            /* inode number of entry */
  10.     short    d_reclen;        /* length of this record */ 
  11.     short    d_namlen;        /* length of string in d_name */
  12.     char    d_name[MAXNAMLEN + 1];    /* name must be no longer than this */
  13. };
  14.  
  15. /*
  16.  * The DIRSIZ macro gives the minimum record length which will hold
  17.  * the directory entry.  This requires the amount of space in struct direct
  18.  * without the d_name field, plus enough space for the name with a terminating
  19.  * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  20.  */
  21.  
  22. #ifdef DIRSIZ
  23. #undef DIRSIZ
  24. #endif /* DIRSIZ */
  25. #define DIRSIZ(dp) \
  26.     ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
  27.  
  28. /*
  29.  * Definitions for library routines operating on directories.
  30.  */
  31. /*
  32. typedef struct _dirdesc {
  33.     int    dd_fd;
  34.     long    dd_loc;
  35.     long    dd_size;
  36.     char    dd_buf[DIRBLKSIZ];
  37. } DIR;
  38. */
  39. typedef struct _dirdesc {
  40.     int     ioVRefNum;
  41.     long    ioDrDirID;
  42.     int        ioFDirIndex;
  43. } DIR;
  44. #ifndef NULL
  45. #define NULL 0L
  46. #endif
  47. extern    DIR *opendir();
  48. extern    struct direct *readdir();
  49. extern    void closedir();
  50.  
  51.