|
|
1.1 ! root 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: typedef struct _dirdesc { ! 32: int dd_fd; ! 33: long dd_loc; ! 34: long dd_size; ! 35: char dd_buf[DIRBLKSIZ]; ! 36: } DIR; ! 37: #ifndef NULL ! 38: #define NULL 0 ! 39: #endif ! 40: extern DIR *opendir(); ! 41: extern struct direct *readdir(); ! 42: extern void closedir();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.