c67: remove global #define's for TRUE/FALSE/BOOL
[tinycc.git] / win32 / include / dirent.h
blobcd31f59e0cfc505a2d8877dc184f1b35482e8b07
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6 /* All the headers include this file. */
7 #include <_mingw.h>
9 #ifndef __STRICT_ANSI__
11 #ifndef _DIRENT_H_
12 #define _DIRENT_H_
15 #pragma pack(push,_CRT_PACKING)
17 #include <io.h>
19 #ifndef RC_INVOKED
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 struct dirent
27 long d_ino; /* Always zero. */
28 unsigned short d_reclen; /* Always zero. */
29 unsigned short d_namlen; /* Length of name in d_name. */
30 char* d_name; /* File name. */
31 /* NOTE: The name in the dirent structure points to the name in the
32 * finddata_t structure in the DIR. */
36 * This is an internal data structure. Good programmers will not use it
37 * except as an argument to one of the functions below.
38 * dd_stat field is now int (was short in older versions).
40 typedef struct
42 /* disk transfer area for this dir */
43 struct _finddata_t dd_dta;
45 /* dirent struct to return from dir (NOTE: this makes this thread
46 * safe as long as only one thread uses a particular DIR struct at
47 * a time) */
48 struct dirent dd_dir;
50 /* _findnext handle */
51 long dd_handle;
54 * Status of search:
55 * 0 = not started yet (next entry to read is first entry)
56 * -1 = off the end
57 * positive = 0 based index of next entry
59 int dd_stat;
61 /* given path for dir with search pattern (struct is extended) */
62 char dd_name[1];
63 } DIR;
65 DIR* __cdecl opendir (const char*);
66 struct dirent* __cdecl readdir (DIR*);
67 int __cdecl closedir (DIR*);
68 void __cdecl rewinddir (DIR*);
69 long __cdecl telldir (DIR*);
70 void __cdecl seekdir (DIR*, long);
73 /* wide char versions */
75 struct _wdirent
77 long d_ino; /* Always zero. */
78 unsigned short d_reclen; /* Always zero. */
79 unsigned short d_namlen; /* Length of name in d_name. */
80 wchar_t* d_name; /* File name. */
81 /* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */
85 * This is an internal data structure. Good programmers will not use it
86 * except as an argument to one of the functions below.
88 typedef struct
90 /* disk transfer area for this dir */
91 struct _wfinddata_t dd_dta;
93 /* dirent struct to return from dir (NOTE: this makes this thread
94 * safe as long as only one thread uses a particular DIR struct at
95 * a time) */
96 struct _wdirent dd_dir;
98 /* _findnext handle */
99 long dd_handle;
102 * Status of search:
103 * 0 = not started yet (next entry to read is first entry)
104 * -1 = off the end
105 * positive = 0 based index of next entry
107 int dd_stat;
109 /* given path for dir with search pattern (struct is extended) */
110 wchar_t dd_name[1];
111 } _WDIR;
115 _WDIR* __cdecl _wopendir (const wchar_t*);
116 struct _wdirent* __cdecl _wreaddir (_WDIR*);
117 int __cdecl _wclosedir (_WDIR*);
118 void __cdecl _wrewinddir (_WDIR*);
119 long __cdecl _wtelldir (_WDIR*);
120 void __cdecl _wseekdir (_WDIR*, long);
123 #ifdef __cplusplus
125 #endif
127 #endif /* Not RC_INVOKED */
129 #pragma pack(pop)
131 #endif /* Not _DIRENT_H_ */
134 #endif /* Not __STRICT_ANSI__ */