* added compilers lcc and bcc (linux86)
[mascara-docs.git] / compilers / linux86-0.16.17 / libc / include / dirent.h
blobc2e8f37c89472a9e3215a870a1943250b2ca0492
2 #ifndef __DIRENT_H
3 #define __DIRENT_H
5 #include <features.h>
6 #include <sys/types.h>
8 #ifndef MAXNAMLEN
9 #define MAXNAMLEN 255
10 #endif
12 /* Directory stream type. */
13 typedef struct {
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 *
25 ));
27 struct dirent {
28 long d_ino;
29 off_t d_off;
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));
51 #endif /* dirent.h */