3 * DIRENT.H (formerly DIRLIB.H)
7 * by M. J. Weinstein Released to public domain 1-Jan-89
11 * Because I have heard that this feature (opendir, readdir, closedir)
13 * it so useful for programmers coming from UNIX or attempting to port
15 * UNIX code, and because it is reasonably light weight, I have included
17 * it in the Mingw32 package. I have also added an implementation of
19 * rewinddir, seekdir and telldir.
21 * - Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
25 * This code is distributed in the hope that is will be useful but
27 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
29 * DISCLAIMED. This includeds but is not limited to warranties of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
47 #ifndef __STRICT_ANSI__
57 /* All the headers include this file. */
59 /*#include <_mingw.h>*/
83 long d_ino; /* Always zero. */
85 unsigned short d_reclen; /* Always zero. */
87 unsigned short d_namlen; /* Length of name in d_name. */
89 char* d_name; /* File name. */
91 /* NOTE: The name in the dirent structure points to the name in the
93 * finddata_t structure in the DIR. */
101 * This is an internal data structure. Good programmers will not use it
103 * except as an argument to one of the functions below.
105 * dd_stat field is now int (was short in older versions).
113 /* disk transfer area for this dir */
115 struct _finddata_t dd_dta;
119 /* dirent struct to return from dir (NOTE: this makes this thread
121 * safe as long as only one thread uses a particular DIR struct at
125 struct dirent dd_dir;
129 /* _findnext handle */
139 * 0 = not started yet (next entry to read is first entry)
143 * positive = 0 based index of next entry
151 /* given path for dir with search pattern (struct is extended) */
159 DIR* opendir (const char*);
161 struct dirent* readdir (DIR*);
165 void rewinddir (DIR*);
169 void seekdir (DIR*, long);
175 /* wide char versions */
183 long d_ino; /* Always zero. */
185 unsigned short d_reclen; /* Always zero. */
187 unsigned short d_namlen; /* Length of name in d_name. */
189 wchar_t* d_name; /* File name. */
191 /* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */
199 * This is an internal data structure. Good programmers will not use it
201 * except as an argument to one of the functions below.
209 /* disk transfer area for this dir */
211 struct _wfinddata_t dd_dta;
215 /* dirent struct to return from dir (NOTE: this makes this thread
217 * safe as long as only one thread uses a particular DIR struct at
221 struct _wdirent dd_dir;
225 /* _findnext handle */
235 * 0 = not started yet (next entry to read is first entry)
239 * positive = 0 based index of next entry
247 /* given path for dir with search pattern (struct is extended) */
259 _WDIR* _wopendir (const wchar_t*);
261 struct _wdirent* _wreaddir (_WDIR*);
263 int _wclosedir (_WDIR*);
265 void _wrewinddir (_WDIR*);
267 long _wtelldir (_WDIR*);
269 void _wseekdir (_WDIR*, long);
283 #endif /* Not RC_INVOKED */
287 #endif /* Not _DIRENT_H_ */
291 #endif /* Not __STRICT_ANSI__ */