home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d109 / uupc.lha / UUpc / Source / LOCAL / ndir.h < prev    next >
C/C++ Source or Header  |  1987-10-28  |  1KB  |  51 lines

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