Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (35 sloc) 1.102 kb
03432bf @andigutmans - Make TSRM work on Windows.
andigutmans authored
1 #ifndef READDIR_H
2 #define READDIR_H
3
4
5 /*
6 * Structures and types used to implement opendir/readdir/closedir
7 * on Windows 95/NT.
8 */
9
a68d5f0 opendir() is reimplemented using GetFistFile/GetNextFile those are fa…
Dmitry Stogov authored
10 #include <windows.h>
11
03432bf @andigutmans - Make TSRM work on Windows.
andigutmans authored
12 #include <io.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <sys/types.h>
a68d5f0 opendir() is reimplemented using GetFistFile/GetNextFile those are fa…
Dmitry Stogov authored
16 #include <direct.h>
03432bf @andigutmans - Make TSRM work on Windows.
andigutmans authored
17
18 /* struct dirent - same as Unix */
19
20 struct dirent {
21 long d_ino; /* inode (always 1 in WIN32) */
22 off_t d_off; /* offset to this dirent */
23 unsigned short d_reclen; /* length of d_name */
24 char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */
25 };
26
27
28 /* typedef DIR - not the same as Unix */
29 typedef struct {
a68d5f0 opendir() is reimplemented using GetFistFile/GetNextFile those are fa…
Dmitry Stogov authored
30 HANDLE handle; /* _findfirst/_findnext handle */
03432bf @andigutmans - Make TSRM work on Windows.
andigutmans authored
31 short offset; /* offset into directory */
32 short finished; /* 1 if there are not more files */
a68d5f0 opendir() is reimplemented using GetFistFile/GetNextFile those are fa…
Dmitry Stogov authored
33 WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */
03432bf @andigutmans - Make TSRM work on Windows.
andigutmans authored
34 char *dir; /* the dir we are reading */
35 struct dirent dent; /* the dirent to return */
36 } DIR;
37
38 /* Function prototypes */
39 DIR *opendir(const char *);
40 struct dirent *readdir(DIR *);
41 int readdir_r(DIR *, struct dirent *, struct dirent **);
42 int closedir(DIR *);
a68d5f0 opendir() is reimplemented using GetFistFile/GetNextFile those are fa…
Dmitry Stogov authored
43 int rewinddir(DIR *);
03432bf @andigutmans - Make TSRM work on Windows.
andigutmans authored
44
45 #endif /* READDIR_H */
Something went wrong with that request. Please try again.