|
|
1.1 root 1: /* (-lgl
2: * COHERENT Version 4.0
3: * Copyright (c) 1982, 1992 by Mark Williams Company.
4: * All rights reserved. May not be copied without permission.
5: -lgl) */
6:
7: #ifndef DIRENT_H
8: #define DIRENT_H 1
9:
10: #ifdef _I386
11:
12: struct dirent {
13: long d_ino; /* i-node number */
14: daddr_t d_off; /* offset in actual directory*/
15: unsigned short d_reclen; /*record length*/
16: char d_name[1];
17: };
18:
19: #define MAXNAMLEN 14 /* maximum filename length */
20:
21: #define DIRBUF 2048 /* buffer size for fs-indep. dirs */
22: /* must in general be larger than the filesystem buffer size */
23:
24: typedef struct
25: {
26: int dd_fd; /* file descriptor */
27: int dd_loc; /* offset in block */
28: int dd_size; /* amount of valid data */
29: char *dd_buf; /* -> directory block */
30: } DIR; /* stream data from opendir() */
31:
32: extern DIR *opendir();
33: extern struct dirent *readdir();
34: extern void rewinddir();
35: extern int closedir();
36: extern daddr_t telldir();
37: extern void seekdir();
38:
39: #define DIRSIZ 14 /* Size of directory name */
40: struct direct {
41: ino_t d_ino; /* Inode number */
42: char d_name[DIRSIZ]; /* Name */
43: };
44:
45: #else
46: /*
47: *-------------------- 286 version ----------------
48: */
49: /*
50: * Rely on COHERENT's sys/dir.h to define type DIR and structure direct with
51: * fields d_ino of type ino_t and d_name of type char [].
52: */
53: #include <sys/types.h>
54:
55: #define DIRSIZ 14 /* Size of directory name */
56: #define DIR char * /* Directory type */
57:
58: /*
59: * Directory entry structure.
60: */
61: struct direct {
62: ino_t d_ino; /* Inode number */
63: char d_name[DIRSIZ]; /* Name */
64: };
65:
66: /*
67: * Implement dirent as a macro, making struct dirent equivalent to COHERENT's
68: * struct direct.
69: */
70: #define dirent direct
71:
72: #endif
73: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.