Pristine Ack-5.5
[Ack-5.5.git] / include / _tail_cc / sys / dir.h
1 /* $Id: dir.h,v 1.7 1994/06/24 13:20:29 ceriel Exp $ */
2 /*
3  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4  * See the copyright notice in the ACK home directory, in the file "Copyright".
5  */
6 #ifndef _DIR_H
7 #define _DIR_H
8
9 #ifdef __BSD4_2
10 #define MAXNAMLEN 255
11 #else
12 #define MAXNAMLEN 14
13 #endif
14 #define DIRBLKSIZ 512
15 #undef DIRSIZ
16 #define DIRSIZ(dp) \
17         ((sizeof(struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1+3)&~3))
18 struct direct {
19         long    d_ino;
20         short   d_reclen;
21         short   d_namlen;
22         char    d_name[MAXNAMLEN+1];
23 };
24
25 struct _dirdesc {
26         int     dd_fd;
27         long    dd_loc;
28         long    dd_size;
29         char    *dd_buf;
30         int     dd_bsize;
31 };
32
33 typedef struct _dirdesc DIR;
34
35 #ifndef NULL
36 #define NULL 0
37 #endif
38 extern DIR *opendir();
39 extern struct direct *readdir();
40 extern long telldir();
41 extern seekdir();
42 #define rewinddir(dirp) seekdir((dirp), 0L)
43 extern closedir();
44
45 #endif /* _DIR_H */