dirent.h (833B)
1 #ifndef _SYS_DIRENT_H 2 # define _SYS_DIRENT_H 3 4 #define MAX_NAME_LEN 255 5 6 #if 0 7 typedef struct _dirdesc { 8 int dd_fd; 9 long dd_loc; 10 long dd_size; 11 char *dd_buf; 12 int dd_len; 13 long dd_seek; 14 } DIR; 15 16 # define __dirfd(dp) ((dp)->dd_fd) 17 18 DIR *opendir (const char *); 19 struct dirent *readdir (DIR *); 20 void rewinddir (DIR *); 21 int closedir (DIR *); 22 23 #include <sys/types.h> 24 25 struct dirent { 26 long d_ino; 27 off_t d_off; 28 unsigned short d_reclen; 29 /* we need better syntax for variable-sized arrays */ 30 char d_name[1]; 31 }; 32 #endif 33 34 #include <sys/types.h> 35 36 typedef struct DIR { 37 int fd; 38 unsigned long off; 39 } DIR; 40 41 struct dirent { 42 ino_t d_inode; 43 off_t d_off; 44 unsigned short d_namelen; 45 char d_name[MAX_NAME_LEN + 1]; 46 }; 47 48 DIR *opendir (const char *); 49 struct dirent *readdir (DIR *); 50 void rewinddir (DIR *); 51 int closedir (DIR *); 52 53 #endif 54