]> www.fi.muni.cz Git - evince.git/blob - pdf/goo/vms_sys_dirent.h
Merge with Xpdf 2.02 and make it build
[evince.git] / pdf / goo / vms_sys_dirent.h
1 /*      @(#)dirent.h 1.4 89/06/16 SMI   */
2
3 /*
4  * Filesystem-independent directory information.
5  * Directory entry structures are of variable length.
6  * Each directory entry is a struct dirent containing its file number, the
7  * offset of the next entry (a cookie interpretable only the filesystem
8  * type that generated it), the length of the entry, and the length of the
9  * name contained in the entry.  These are followed by the name. The
10  * entire entry is padded with null bytes to a 4 byte boundary. All names
11  * are guaranteed null terminated. The maximum length of a name in a
12  * directory is MAXNAMLEN, plus a null byte.
13  */
14
15 #ifndef __sys_dirent_h
16 #define __sys_dirent_h
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 #define dirent GOO_dirent
23
24 struct  dirent {
25         long            d_off;          /* offset of next disk dir entry */
26         unsigned long   d_fileno;       /* file number of entry */
27         unsigned short  d_reclen;       /* length of this record */
28         unsigned short  d_namlen;       /* length of string in d_name */
29         char            d_name[255+1];  /* name (up to MAXNAMLEN + 1) */
30 };
31
32 #ifndef _POSIX_SOURCE
33 /*
34  * It's unlikely to change, but make sure that sizeof d_name above is
35  * at least MAXNAMLEN + 1 (more may be added for padding).
36  */
37 #define MAXNAMLEN       255
38 /*
39  * The macro DIRSIZ(dp) gives the minimum amount of space required to represent
40  * a directory entry.  For any directory entry dp->d_reclen >= DIRSIZ(dp).
41  * Specific filesystem types may use this macro to construct the value
42  * for d_reclen.
43  */
44 #undef  DIRSIZ
45 #define DIRSIZ(dp) \
46         (((sizeof(struct dirent) - (MAXNAMLEN+1) + ((dp)->d_namlen+1)) +3) & ~3)
47
48 #endif  /* !_POSIX_SOURCE */
49
50 #ifdef __cplusplus
51 }
52 #endif
53
54 #endif  /* !__sys_dirent_h */