Debian Codegraph @

lib/dirent.h

raw
1 /*
2 * @(#) dirent.h 2.0 17 Jun 91 Public Domain.
3 *
4 * A public domain implementation of BSD directory routines for
5 * MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield),
6 * August 1987
7 *
8 * Enhanced and ported to OS/2 by Kai Uwe Rommel; added scandir() prototype
9 * December 1989, February 1990
10 * Change of MAXPATHLEN for HPFS, October 1990
11 *
12 * Unenhanced and ported to Windows NT by Bill Gallagher
13 * 17 Jun 91
14 * changed d_name to char * instead of array, removed non-std extensions
15 *
16 * Cleanup, other hackery, Summer '92, Brian Moran , [email protected]
17 */
18
19 #ifndef _DIRENT
20 #define _DIRENT
21
22 #include <direct.h>
23
24 struct dirent {
25 ino_t d_ino; /* a bit of a farce */
26 short d_reclen; /* more farce */
27 short d_namlen; /* length of d_name */
28 char *d_name;
29 };
30
31 struct _dircontents {
32 char *_d_entry;
33 struct _dircontents *_d_next;
34 };
35
36 typedef struct _dirdesc {
37 int dd_id; /* uniquely identify each open directory */
38 long dd_loc; /* where we are in directory entry */
39 struct _dircontents *dd_contents; /* pointer to contents of dir */
40 struct _dircontents *dd_cp; /* pointer to current position */
41 } DIR;
42
43 extern DIR *opendir(char *);
44 extern struct dirent *readdir(DIR *);
45 extern void seekdir(DIR *, long);
46 extern long telldir(DIR *);
47 extern void closedir(DIR *);
48
49 #define rewinddir(dirp) seekdir(dirp, 0L)
50
51 #endif /* _DIRENT */
52
53 /* end of dirent.h */