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
Defined macros
NULL
defined in line
55; used 1 times
Usage of this include