|
|
1.1 root 1: /*
2: COHERENT compatible
3: <sys/dirent.h> - dirent defs. for use with libndir routines by
4: D A Gwyn.
5: */
6:
7: #ifndef SDIRENT_H
8: #define SDIRENT_H 1
9:
10: #include <sys/dir.h>
11: #ifdef DIR
12: #undef DIR
13: #endif
14:
15: struct dirent {
16: long d_ino; /* i-node number */
17: daddr_t d_off; /* offset in actual directory*/
18: unsigned short d_reclen; /*record length*/
19: char d_name[1];
20: };
21:
22:
23: /* The following nonportable ugliness could have been avoided by defining
24: DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. */
25:
26: #define DIRENTBASESIZ (((struct dirent *)0)->d_name \
27: - (char *)&((struct dirent *)0)->d_ino)
28: #define DIRENTSIZ( namlen ) ((DIRENTBASESIZ + sizeof(int) + (namlen)) \
29: / sizeof(int) * sizeof(int))
30: #if 0
31: #define DIRENTBASESIZ (sizeof(struct dirent))
32:
33: #define DIRENTSIZ( namlen ) ( DIRENTBASESIZ + ((((namlen) << 1) +1) >> 1))
34: #endif
35: /* DAG -- the following was moved from <dirent.h>, which was the wrong place */
36:
37: #define MAXNAMLEN 14 /* maximum filename length */
38:
39: #define DIRBLKSIZ 512 /* buffer size for getdents. */
40:
41: #ifndef NAME_MAX
42: #define NAME_MAX (MAXNAMLEN - 1) /* DAG -- added for POSIX */
43: #endif
44:
45: #endif /*Not yet called*/
46:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.