Need double escape
[ACE_TAO.git] / ACE / ace / os_include / os_dirent.h
blob9ff7d83acee1bf8e7306f2ef8339160635496367
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file os_dirent.h
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)
22 # 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" {}
33 #ifdef __cplusplus
34 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)
44 typedef int ACE_DIR;
45 struct dirent {
47 #endif /* ACE_HAS_DIRENT */
49 #if defined (ACE_LACKS_STRUCT_DIR)
50 struct dirent {
51 unsigned short d_ino;
52 unsigned short d_off;
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.
57 ACE_TCHAR *d_name;
60 #define ACE_DIRENT dirent
61 #define ACE_HAS_TCHAR_DIRENT
63 struct ACE_DIR {
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_;
70 #endif
72 /// The struct for the results
73 ACE_DIRENT *dirent_;
75 /// The struct for intermediate results.
76 ACE_TEXT_WIN32_FIND_DATA fdata_;
78 /// A flag to remember if we started reading already.
79 int started_reading_;
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;
86 #else
87 # define ACE_DIRENT wdirent
88 typedef wDIR ACE_DIR;
89 #endif
90 #else
91 #define ACE_DIRENT dirent
92 typedef DIR ACE_DIR;
93 #endif /* ACE_LACKS_STRUCT_DIR */
95 #if defined (ACE_LACKS_SCANDIR_PROTOTYPE)
96 int scandir (const char *,
97 struct dirent ***,
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 */
106 #ifdef __cplusplus
108 #endif /* __cplusplus */
110 #include /**/ "ace/post.h"
111 #endif /* ACE_OS_INCLUDE_OS_DIRENT_H */