8 # include <sys/types.h>
11 #define MAXNAMLEN 255 /* maximum filename length */
14 #define NAME_MAX (MAXNAMLEN - 1)
17 struct dirent /* data from getdents()/readdir() */
19 ino_t d_ino; /* inode number of entry */
20 off_t d_off; /* offset of disk directory entry */
21 wchar_t d_reclen; /* length of this record */
22 char d_name[MAXNAMLEN + 1];
26 /* The following nonportable ugliness could have been avoided by defining
27 * DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments.
28 * There shouldn't be any problem if you avoid using the DIRENTSIZ() macro.
31 #define DIRENTBASESIZ (((struct dirent *)0)->d_name \
32 - (char *)&((struct dirent *)0)->d_ino)
34 #define DIRENTSIZ(namlen) ((DIRENTBASESIZ + sizeof(long) + (namlen)) \
35 / sizeof(long) * sizeof(long))
39 # ifndef _BOOL_T_DEFINED
40 typedef unsigned char bool;
41 # define _BOOL_T_DEFINED
44 # define DIRBUF 8192 /* buffer size for fs-indep. dirs */
45 /* must in general be larger than the */
46 /* filesystem buffer size */
50 struct _dircontents *_d_next;
53 typedef struct _dirdesc {
54 int dd_id; /* uniquely identify each open directory */
55 long dd_loc; /* where we are in directory entry is this */
56 struct _dircontents *dd_contents; /* pointer to contents of dir */
57 struct _dircontents *dd_cp; /* pointer to current position */
61 #if defined (__STDC__)
71 extern DIR * opendir _PROTO ((const char *));
72 extern struct dirent * readdir _PROTO ((DIR *));
73 extern void rewinddir _PROTO ((DIR *));
75 extern int closedir _PROTO ((DIR *));
76 extern void seekdir _PROTO ((DIR *, off_t));
77 extern off_t telldir _PROTO ((DIR *));
79 extern int chdir _PROTO ((const char *));
80 extern char * getcwd _PROTO ((char *, size_t));
82 extern int mkdir _PROTO ((const char *));
84 extern int rmdir _PROTO ((const char *));
85 extern int scandir _PROTO ((char *,
87 int (*)(const void *, const void *),
88 int (*)(const void *, const void *)));
90 extern int _chdrive _PROTO ((int));
91 extern int _getdrive _PROTO ((void));
92 extern char * _getdcwd _PROTO ((int, char *, int));
94 extern bool IsHPFSFileSystem _PROTO ((char *));