plugin: remove gst_plugin_get_module()
[platform/upstream/gstreamer.git] / win32 / common / dirent.h
1 /*
2
3  * DIRENT.H (formerly DIRLIB.H)
4
5  *
6
7  * by M. J. Weinstein   Released to public domain 1-Jan-89
8
9  *
10
11  * Because I have heard that this feature (opendir, readdir, closedir)
12
13  * it so useful for programmers coming from UNIX or attempting to port
14
15  * UNIX code, and because it is reasonably light weight, I have included
16
17  * it in the Mingw32 package. I have also added an implementation of
18
19  * rewinddir, seekdir and telldir.
20
21  *   - Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
22
23  *
24
25  *  This code is distributed in the hope that is will be useful but
26
27  *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
28
29  *  DISCLAIMED. This includeds but is not limited to warranties of
30
31  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
32
33  *
34
35  * $Revision$
36
37  * $Author$
38
39  * $Date$
40
41  *
42
43  */
44
45
46
47 #ifndef __STRICT_ANSI__
48
49
50
51 #ifndef _DIRENT_H_
52
53 #define _DIRENT_H_
54
55
56
57 /* All the headers include this file. */
58
59 /*#include <_mingw.h>*/
60
61
62
63 #include <io.h>
64
65
66
67 #ifndef RC_INVOKED
68
69
70
71 #ifdef __cplusplus
72
73 extern "C" {
74
75 #endif
76
77
78
79 struct dirent
80
81 {
82
83         long            d_ino;          /* Always zero. */
84
85         unsigned short  d_reclen;       /* Always zero. */
86
87         unsigned short  d_namlen;       /* Length of name in d_name. */
88
89         char*           d_name;         /* File name. */
90
91         /* NOTE: The name in the dirent structure points to the name in the
92
93          *       finddata_t structure in the DIR. */
94
95 };
96
97
98
99 /*
100
101  * This is an internal data structure. Good programmers will not use it
102
103  * except as an argument to one of the functions below.
104
105  * dd_stat field is now int (was short in older versions).
106
107  */
108
109 typedef struct
110
111 {
112
113         /* disk transfer area for this dir */
114
115         struct _finddata_t      dd_dta;
116
117
118
119         /* dirent struct to return from dir (NOTE: this makes this thread
120
121          * safe as long as only one thread uses a particular DIR struct at
122
123          * a time) */
124
125         struct dirent           dd_dir;
126
127
128
129         /* _findnext handle */
130
131         long                    dd_handle;
132
133
134
135         /*
136
137          * Status of search:
138
139          *   0 = not started yet (next entry to read is first entry)
140
141          *  -1 = off the end
142
143          *   positive = 0 based index of next entry
144
145          */
146
147         int                     dd_stat;
148
149
150
151         /* given path for dir with search pattern (struct is extended) */
152
153         char                    dd_name[1];
154
155 } DIR;
156
157
158
159 DIR*            opendir (const char*);
160
161 struct dirent*  readdir (DIR*);
162
163 int             closedir (DIR*);
164
165 void            rewinddir (DIR*);
166
167 long            telldir (DIR*);
168
169 void            seekdir (DIR*, long);
170
171
172
173
174
175 /* wide char versions */
176
177
178
179 struct _wdirent
180
181 {
182
183         long            d_ino;          /* Always zero. */
184
185         unsigned short  d_reclen;       /* Always zero. */
186
187         unsigned short  d_namlen;       /* Length of name in d_name. */
188
189         wchar_t*        d_name;         /* File name. */
190
191         /* NOTE: The name in the dirent structure points to the name in the      *       wfinddata_t structure in the _WDIR. */
192
193 };
194
195
196
197 /*
198
199  * This is an internal data structure. Good programmers will not use it
200
201  * except as an argument to one of the functions below.
202
203  */
204
205 typedef struct
206
207 {
208
209         /* disk transfer area for this dir */
210
211         struct _wfinddata_t     dd_dta;
212
213
214
215         /* dirent struct to return from dir (NOTE: this makes this thread
216
217          * safe as long as only one thread uses a particular DIR struct at
218
219          * a time) */
220
221         struct _wdirent         dd_dir;
222
223
224
225         /* _findnext handle */
226
227         long                    dd_handle;
228
229
230
231         /*
232
233          * Status of search:
234
235          *   0 = not started yet (next entry to read is first entry)
236
237          *  -1 = off the end
238
239          *   positive = 0 based index of next entry
240
241          */
242
243         int                     dd_stat;
244
245
246
247         /* given path for dir with search pattern (struct is extended) */
248
249         wchar_t                 dd_name[1];
250
251 } _WDIR;
252
253
254
255
256
257
258
259 _WDIR*          _wopendir (const wchar_t*);
260
261 struct _wdirent* _wreaddir (_WDIR*);
262
263 int             _wclosedir (_WDIR*);
264
265 void            _wrewinddir (_WDIR*);
266
267 long            _wtelldir (_WDIR*);
268
269 void            _wseekdir (_WDIR*, long);
270
271
272
273
274
275 #ifdef  __cplusplus
276
277 }
278
279 #endif
280
281
282
283 #endif  /* Not RC_INVOKED */
284
285
286
287 #endif  /* Not _DIRENT_H_ */
288
289
290
291 #endif  /* Not __STRICT_ANSI__ */
292
293
294