os_dirent.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_dirent.h
00006  *
00007  *  format of directory entries
00008  *
00009  *  os_dirent.h,v 1.10 2006/05/30 11:07:33 jwillemsen Exp
00010  *
00011  *  @author Don Hinton <dhinton@dresystems.com>
00012  *  @author This code was originally in various places including ace/OS.h.
00013  */
00014 //=============================================================================
00015 
00016 #ifndef ACE_OS_INCLUDE_OS_DIRENT_H
00017 #define ACE_OS_INCLUDE_OS_DIRENT_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include "ace/config-all.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "ace/os_include/sys/os_types.h"
00028 #include "ace/os_include/os_limits.h"
00029 
00030 #if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
00031 #  include "ace/os_include/os_unistd.h"  // VxWorks needs this to compile
00032 #endif /* ACE_VXWORKS */
00033 
00034 #if !defined (ACE_LACKS_DIRENT_H)
00035 # include /**/ <dirent.h>
00036 #endif /* !ACE_LACKS_DIRENT_H */
00037 
00038 // Place all additions (especially function declarations) within extern "C" {}
00039 #ifdef __cplusplus
00040 extern "C"
00041 {
00042 #endif /* __cplusplus */
00043 
00044 #if !defined (MAXNAMLEN)
00045 #  define MAXNAMLEN NAME_MAX
00046 #endif /* !MAXNAMLEN */
00047 
00048 // At least compile on some of the platforms without <ACE_DIR> info yet.
00049 #if !defined (ACE_HAS_DIRENT)
00050 typedef int ACE_DIR;
00051 struct dirent {
00052 };
00053 #endif /* ACE_HAS_DIRENT */
00054 
00055 #if defined (ACE_LACKS_STRUCT_DIR)
00056 struct dirent {
00057   unsigned short d_ino;
00058   unsigned short d_off;
00059   unsigned short d_reclen;
00060   // This must be a ACE_TCHAR * and not a one element
00061   // ACE_TCHAR array.  It causes problems on wide
00062   // character builds with Visual C++ 6.0.
00063   ACE_TCHAR *d_name;
00064 };
00065 
00066 #define ACE_DIRENT dirent
00067 
00068 struct ACE_DIR {
00069   /// The name of the directory we are looking into
00070   ACE_TCHAR *directory_name_;
00071 
00072   /// Remember the handle between calls.
00073   HANDLE current_handle_;
00074 
00075   /// The struct for the results
00076   ACE_DIRENT *dirent_;
00077 
00078   /// The struct for intermediate results.
00079   ACE_TEXT_WIN32_FIND_DATA fdata_;
00080 
00081   /// A flag to remember if we started reading already.
00082   int started_reading_;
00083 };
00084 #elif defined (ACE_WIN32) && (__BORLANDC__) && defined (ACE_USES_WCHAR)
00085 #define ACE_DIRENT wdirent
00086 typedef wDIR ACE_DIR;
00087 #else
00088 #define ACE_DIRENT dirent
00089 typedef DIR ACE_DIR;
00090 #endif /* ACE_LACKS_STRUCT_DIR */
00091 
00092 #if defined rewinddir
00093 # undef rewinddir
00094 #endif /* rewinddir */
00095 
00096 #if defined (ACE_LACKS_SCANDIR_PROTOTYPE)
00097 int scandir (const char *,
00098              struct dirent ***,
00099              int (*) (const struct dirent *),
00100              int (*) (const void *, const void *));
00101 #endif /* ACE_LACKS_SCANDIR_PROTOTYPE */
00102 
00103 #ifdef __cplusplus
00104 }
00105 #endif /* __cplusplus */
00106 
00107 #include /**/ "ace/post.h"
00108 #endif /* ACE_OS_INCLUDE_OS_DIRENT_H */

Generated on Thu Nov 9 09:41:57 2006 for ACE by doxygen 1.3.6