12 /* Directory stream type. */
14 int dd_fd
; /* file descriptor */
15 int dd_loc
; /* offset in buffer */
16 int dd_size
; /* # of valid entries in buffer */
17 struct dirent
*dd_buf
; /* -> directory buffer */
18 } DIR; /* stream data from opendir() */
20 typedef int (*__dir_select_fn_t
) __P ((__const
struct dirent
*));
22 typedef int (*__dir_compar_fn_t
) __P ((
23 __const
struct dirent
* __const
*,
24 __const
struct dirent
* __const
*
30 unsigned short d_reclen
;
31 char d_name
[MAXNAMLEN
+1];
34 extern DIR *opendir
__P ((__const
char *__name
));
35 extern int closedir
__P ((DIR * __dirp
));
36 extern struct dirent
*readdir
__P ((DIR * __dirp
));
37 extern void rewinddir
__P ((DIR * __dirp
));
39 extern void seekdir
__P ((DIR * __dirp
, off_t __pos
));
40 extern off_t telldir
__P ((DIR * __dirp
));
42 /* Scan the directory DIR, calling SELECT on each directory entry.
43 Entries for which SELECT returns nonzero are individually malloc'd,
44 sorted using qsort with CMP, and collected in a malloc'd array in
45 *NAMELIST. Returns the number of entries selected, or -1 on error. */
46 extern int scandir
__P ((__const
char *__dir
,
47 struct dirent
***__namelist
,
48 __dir_select_fn_t __select
,
49 __dir_compar_fn_t __compar
));