3 //=============================================================================
7 * format of directory entries
9 * @author Don Hinton <dhinton@dresystems.com>
10 * @author This code was originally in various places including ace/OS.h.
12 //=============================================================================
14 #ifndef ACE_OS_INCLUDE_OS_DIRENT_H
15 #define ACE_OS_INCLUDE_OS_DIRENT_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/config-all.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "ace/os_include/sys/os_types.h"
26 #include "ace/os_include/os_limits.h"
28 #if !defined (ACE_LACKS_DIRENT_H)
29 # include /**/ <dirent.h>
30 #endif /* !ACE_LACKS_DIRENT_H */
32 // Place all additions (especially function declarations) within extern "C" {}
36 #endif /* __cplusplus */
38 #if !defined (MAXNAMLEN)
39 # define MAXNAMLEN NAME_MAX
40 #endif /* !MAXNAMLEN */
42 // At least compile on some of the platforms without <ACE_DIR> info yet.
43 #if !defined (ACE_HAS_DIRENT)
47 #endif /* ACE_HAS_DIRENT */
49 #if defined (ACE_LACKS_STRUCT_DIR)
53 unsigned short d_reclen
;
54 // This must be a ACE_TCHAR * and not a one element
55 // ACE_TCHAR array. It causes problems on wide
56 // character builds with Visual C++ 6.0.
60 #define ACE_DIRENT dirent
61 #define ACE_HAS_TCHAR_DIRENT
64 /// The name of the directory we are looking into
65 ACE_TCHAR
*directory_name_
;
67 #if !defined (ACE_MQX)
68 /// Remember the handle between calls.
69 HANDLE current_handle_
;
72 /// The struct for the results
75 /// The struct for intermediate results.
76 ACE_TEXT_WIN32_FIND_DATA fdata_
;
78 /// A flag to remember if we started reading already.
81 #elif defined (ACE_WIN32) && (__BORLANDC__) && defined (ACE_USES_WCHAR)
82 #define ACE_HAS_TCHAR_DIRENT
83 #if defined(__MINGW64__)
84 # define ACE_DIRENT _wdirent
85 typedef _WDIR ACE_DIR
;
87 # define ACE_DIRENT wdirent
91 #define ACE_DIRENT dirent
93 #endif /* ACE_LACKS_STRUCT_DIR */
95 #if defined (ACE_LACKS_SCANDIR_PROTOTYPE)
96 int scandir (const char *,
98 int (*) (const struct dirent
*),
99 int (*) (const void *, const void *));
100 #endif /* ACE_LACKS_SCANDIR_PROTOTYPE */
102 #if defined (ACE_LACKS_ALPHASORT_PROTOTYPE)
103 int alphasort (const void *, const void *);
104 #endif /* ACE_LACKS_ALPHASORT_PROTOTYPE */
108 #endif /* __cplusplus */
110 #include /**/ "ace/post.h"
111 #endif /* ACE_OS_INCLUDE_OS_DIRENT_H */