ReactOS  0.4.13-dev-464-g6b95727
dirent.h
Go to the documentation of this file.
1 
6 #include <crtdefs.h>
7 
8 #ifndef __STRICT_ANSI__
9 
10 #ifndef _DIRENT_H_
11 #define _DIRENT_H_
12 
13 
14 #pragma pack(push,_CRT_PACKING)
15 
16 #include <io.h>
17 
18 #ifndef RC_INVOKED
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24  struct dirent
25  {
26  long d_ino; /* Always zero. */
27  unsigned short d_reclen; /* Always zero. */
28  unsigned short d_namlen; /* Length of name in d_name. */
29  char* d_name; /* File name. */
30  /* NOTE: The name in the dirent structure points to the name in the
31  * finddata_t structure in the DIR. */
32  };
33 
34  /*
35  * This is an internal data structure. Good programmers will not use it
36  * except as an argument to one of the functions below.
37  * dd_stat field is now int (was short in older versions).
38  */
39  typedef struct
40  {
41  /* disk transfer area for this dir */
42  struct _finddata_t dd_dta;
43 
44  /* dirent struct to return from dir (NOTE: this makes this thread
45  * safe as long as only one thread uses a particular DIR struct at
46  * a time) */
47  struct dirent dd_dir;
48 
49  /* _findnext handle */
50  long dd_handle;
51 
52  /*
53  * Status of search:
54  * 0 = not started yet (next entry to read is first entry)
55  * -1 = off the end
56  * positive = 0 based index of next entry
57  */
58  int dd_stat;
59 
60  /* given path for dir with search pattern (struct is extended) */
61  char dd_name[1];
62  } DIR;
63 
64  DIR* __cdecl opendir (const char*);
65  struct dirent* __cdecl readdir (DIR*);
66  int __cdecl closedir (DIR*);
67  void __cdecl rewinddir (DIR*);
68  long __cdecl telldir (DIR*);
69  void __cdecl seekdir (DIR*, long);
70 
71 
72  /* wide char versions */
73 
74  struct _wdirent
75  {
76  long d_ino; /* Always zero. */
77  unsigned short d_reclen; /* Always zero. */
78  unsigned short d_namlen; /* Length of name in d_name. */
79  wchar_t* d_name; /* File name. */
80  /* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */
81  };
82 
83  /*
84  * This is an internal data structure. Good programmers will not use it
85  * except as an argument to one of the functions below.
86  */
87  typedef struct
88  {
89  /* disk transfer area for this dir */
90  struct _wfinddata_t dd_dta;
91 
92  /* dirent struct to return from dir (NOTE: this makes this thread
93  * safe as long as only one thread uses a particular DIR struct at
94  * a time) */
95  struct _wdirent dd_dir;
96 
97  /* _findnext handle */
98  long dd_handle;
99 
100  /*
101  * Status of search:
102  * 0 = not started yet (next entry to read is first entry)
103  * -1 = off the end
104  * positive = 0 based index of next entry
105  */
106  int dd_stat;
107 
108  /* given path for dir with search pattern (struct is extended) */
109  wchar_t dd_name[1];
110  } _WDIR;
111 
112 
113 
114  _WDIR* __cdecl _wopendir (const wchar_t*);
115  struct _wdirent* __cdecl _wreaddir (_WDIR*);
116  int __cdecl _wclosedir (_WDIR*);
117  void __cdecl _wrewinddir (_WDIR*);
118  long __cdecl _wtelldir (_WDIR*);
119  void __cdecl _wseekdir (_WDIR*, long);
120 
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* Not RC_INVOKED */
127 
128 #pragma pack(pop)
129 
130 #endif /* Not _DIRENT_H_ */
131 
132 
133 #endif /* Not __STRICT_ANSI__ */
134 
int __cdecl _wclosedir(_WDIR *)
void __cdecl rewinddir(DIR *)
#define __cdecl
Definition: accygwin.h:79
unsigned short d_reclen
Definition: dirent.h:27
int dd_stat
Definition: dirent.h:58
struct __dirdesc DIR
Definition: fatfs.h:198
DIR *__cdecl opendir(const char *)
void __cdecl _wrewinddir(_WDIR *)
unsigned short d_namlen
Definition: dirent.h:28
Definition: dirent.h:39
unsigned short d_reclen
Definition: dirent.h:77
void __cdecl seekdir(DIR *, long)
_WDIR *__cdecl _wopendir(const wchar_t *)
long dd_handle
Definition: dirent.h:98
char * d_name
Definition: dirent.h:29
void __cdecl _wseekdir(_WDIR *, long)
long d_ino
Definition: dirent.h:26
unsigned short d_namlen
Definition: dirent.h:78
long __cdecl telldir(DIR *)
long __cdecl _wtelldir(_WDIR *)
int __cdecl closedir(DIR *)
long d_ino
Definition: dirent.h:76
struct dirent *__cdecl readdir(DIR *)
wchar_t * d_name
Definition: dirent.h:79
Definition: io.h:37
struct _wdirent *__cdecl _wreaddir(_WDIR *)
Definition: dirent.h:87
long dd_handle
Definition: dirent.h:50
int dd_stat
Definition: dirent.h:106