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 , brianmo@microsoft.com |
17 |
*/ |
18 |
|
19 |
#ifndef _DIRENT |
20 |
#define _DIRENT |
21 |
|
22 |
#include <direct.h> |
23 |
|
24 |
struct dirent |
25 |
{ |
26 |
ino_t d_ino; /* a bit of a farce */ |
27 |
short d_reclen; /* more farce */ |
28 |
short d_namlen; /* length of d_name */ |
29 |
char *d_name; |
30 |
}; |
31 |
|
32 |
struct _dircontents |
33 |
{ |
34 |
char *_d_entry; |
35 |
struct _dircontents *_d_next; |
36 |
}; |
37 |
|
38 |
typedef struct _dirdesc |
39 |
{ |
40 |
int dd_id; /* uniquely identify each open directory*/ |
41 |
long dd_loc; /* where we are in directory entry */ |
42 |
struct _dircontents *dd_contents; /* pointer to contents of dir */ |
43 |
struct _dircontents *dd_cp; /* pointer to current position */ |
44 |
} |
45 |
DIR; |
46 |
|
47 |
extern DIR *opendir(char *); |
48 |
extern struct dirent *readdir(DIR *); |
49 |
extern void seekdir(DIR *, long); |
50 |
extern long telldir(DIR *); |
51 |
extern void closedir(DIR *); |
52 |
#define rewinddir(dirp) seekdir(dirp, 0L) |
53 |
|
54 |
#endif /* _DIRENT */ |
55 |
|
56 |
/* end of dirent.h */ |