struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / cpp / win32 / dirent.h
blob53c4dc846927b13a07113bce5177152ee4fcca0b
1 /*
2 * DIRENT.H (formerly DIRLIB.H)
3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is a part of the mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within the package.
7 */
8 #ifndef _DIRENT_H_
9 #define _DIRENT_H_
11 #include <stdio.h>
12 #include <io.h>
14 #ifndef RC_INVOKED
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 struct dirent
22 long d_ino; /* Always zero. */
23 unsigned short d_reclen; /* Always zero. */
24 unsigned short d_namlen; /* Length of name in d_name. */
25 char d_name[FILENAME_MAX]; /* File name. */
29 * This is an internal data structure. Good programmers will not use it
30 * except as an argument to one of the functions below.
31 * dd_stat field is now int (was short in older versions).
33 typedef struct
35 /* disk transfer area for this dir */
36 struct _finddata_t dd_dta;
38 /* dirent struct to return from dir (NOTE: this makes this thread
39 * safe as long as only one thread uses a particular DIR struct at
40 * a time) */
41 struct dirent dd_dir;
43 /* _findnext handle */
44 long dd_handle;
47 * Status of search:
48 * 0 = not started yet (next entry to read is first entry)
49 * -1 = off the end
50 * positive = 0 based index of next entry
52 int dd_stat;
54 /* given path for dir with search pattern (struct is extended) */
55 char dd_name[1];
56 } DIR;
58 DIR* __cdecl opendir (const char*);
59 struct dirent* __cdecl readdir (DIR*);
60 int __cdecl closedir (DIR*);
61 void __cdecl rewinddir (DIR*);
62 long __cdecl telldir (DIR*);
63 void __cdecl seekdir (DIR*, long);
66 /* wide char versions */
68 struct _wdirent
70 long d_ino; /* Always zero. */
71 unsigned short d_reclen; /* Always zero. */
72 unsigned short d_namlen; /* Length of name in d_name. */
73 wchar_t d_name[FILENAME_MAX]; /* File name. */
77 * This is an internal data structure. Good programmers will not use it
78 * except as an argument to one of the functions below.
80 typedef struct
82 /* disk transfer area for this dir */
83 struct _wfinddata_t dd_dta;
85 /* dirent struct to return from dir (NOTE: this makes this thread
86 * safe as long as only one thread uses a particular DIR struct at
87 * a time) */
88 struct _wdirent dd_dir;
90 /* _findnext handle */
91 long dd_handle;
94 * Status of search:
95 * 0 = not started yet (next entry to read is first entry)
96 * -1 = off the end
97 * positive = 0 based index of next entry
99 int dd_stat;
101 /* given path for dir with search pattern (struct is extended) */
102 wchar_t dd_name[1];
103 } _WDIR;
107 _WDIR* __cdecl _wopendir (const wchar_t*);
108 struct _wdirent* __cdecl _wreaddir (_WDIR*);
109 int __cdecl _wclosedir (_WDIR*);
110 void __cdecl _wrewinddir (_WDIR*);
111 long __cdecl _wtelldir (_WDIR*);
112 void __cdecl _wseekdir (_WDIR*, long);
115 #ifdef __cplusplus
117 #endif
119 #endif /* Not RC_INVOKED */
121 #endif /* Not _DIRENT_H_ */