1: /* $Header: ndir.h,v 7.0 86/10/08 15:12:52 lwall Exp $
   2:  *
   3:  * $Log:	ndir.h,v $
   4:  * Revision 7.0  86/10/08  15:12:52  lwall
   5:  * Split into separate files.  Added amoebas and pirates.
   6:  *
   7:  * Revision 4.3.1.1  85/05/10  11:35:37  lwall
   8:  * Branch for patches.
   9:  *
  10:  * Revision 4.3  85/05/01  11:43:00  lwall
  11:  * Baseline for release with 4.3bsd.
  12:  *
  13:  */
  14: 
  15: #ifdef LIBNDIR
  16: #   include <ndir.h>
  17: #else
  18: #   ifndef USENDIR
  19: #	include <sys/dir.h>
  20: #   else
  21: 
  22: #ifndef DEV_BSIZE
  23: #define DEV_BSIZE   512
  24: #endif
  25: #define DIRBLKSIZ   DEV_BSIZE
  26: #define MAXNAMLEN   255
  27: 
  28: struct  direct {
  29:     long    d_ino;          /* inode number of entry */
  30:     short   d_reclen;       /* length of this record */
  31:     short   d_namlen;       /* length of string in d_name */
  32:     char    d_name[MAXNAMLEN + 1];  /* name must be no longer than this */
  33: };
  34: 
  35: /*
  36:  * The DIRSIZ macro gives the minimum record length which will hold
  37:  * the directory entry.  This requires the amount of space in struct direct
  38:  * without the d_name field, plus enough space for the name with a terminating
  39:  * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  40:  */
  41: #undef DIRSIZ
  42: #define DIRSIZ(dp) \
  43:     ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
  44: 
  45: /*
  46:  * Definitions for library routines operating on directories.
  47:  */
  48: typedef struct _dirdesc {
  49:     int dd_fd;
  50:     long    dd_loc;
  51:     long    dd_size;
  52:     char    dd_buf[DIRBLKSIZ];
  53: } DIR;
  54: #ifndef NULL
  55: #define NULL 0
  56: #endif
  57: extern  DIR *opendir();
  58: extern  struct direct *readdir();
  59: extern  long telldir();
  60: extern  void seekdir();
  61: #define rewinddir(dirp) seekdir((dirp), (long)0)
  62: extern  void closedir();
  63: 
  64: #   endif
  65: #endif

Defined struct's

_dirdesc defined in line 48; never used
direct defined in line 28; used 2 times
  • in line 58(2)

Defined macros

DEV_BSIZE defined in line 23; used 2 times
DIRBLKSIZ defined in line 25; used 1 times
  • in line 52
DIRSIZ defined in line 42; used 1 times
  • in line 41
MAXNAMLEN defined in line 26; used 2 times
NULL defined in line 55; used 1 times
  • in line 54
rewinddir defined in line 61; never used

Usage of this include

Last modified: 1987-06-19
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2623
Valid CSS Valid XHTML 1.0 Strict