- Notifications
You must be signed in to change notification settings - Fork 7.8k
/
Copy pathreaddir.h
53 lines (42 loc) · 1.19 KB
/
readdir.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndefREADDIR_H
#defineREADDIR_H
#ifdef__cplusplus
extern"C" {
#endif
/*
* Structures and types used to implement opendir/readdir/closedir
* on Windows.
*/
#include<config.w32.h>
#include"ioutil.h"
#define_DIRENT_HAVE_D_TYPE
#defineDT_UNKNOWN 0
#defineDT_DIR 4
#defineDT_REG 8
/* struct dirent - same as Unix */
structdirent {
longd_ino; /* inode (always 1 in WIN32) */
off_td_off; /* offset to this dirent */
unsigned shortd_reclen; /* length of d_name */
unsigned chard_type;
chard_name[1]; /* null terminated filename in the current encoding, glyph number <= 255 wchar_t's + \0 byte */
};
/* typedef DIR - not the same as Unix */
structDIR_W32 {
HANDLEhandle; /* _findfirst/_findnext handle */
uint32_toffset; /* offset into directory */
uint8_tfinished; /* 1 if there are not more files */
WIN32_FIND_DATAWfileinfo; /* from _findfirst/_findnext */
wchar_t*dirw; /* the dir we are reading */
structdirentdent; /* the dirent to return */
};
typedefstructDIR_W32DIR;
/* Function prototypes */
DIR*opendir(constchar*);
structdirent*readdir(DIR*);
intclosedir(DIR*);
intrewinddir(DIR*);
#ifdef__cplusplus
}
#endif
#endif/* READDIR_H */