home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / dirent.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  2.5 KB  |  109 lines

  1. /*  dirent.h
  2.  
  3.     Definitions for POSIX directory operations.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 9.0
  9.  *
  10.  *      Copyright (c) 1991, 1998 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14. /* $Revision:   9.2  $ */
  15.  
  16. #ifndef __DIRENT_H
  17. #define __DIRENT_H
  18.  
  19. #ifndef ___STDDEF_H
  20. #include <_stddef.h>
  21. #endif
  22.  
  23. #ifndef _WINDOWS_
  24. #include <windows.h>  /* For WIN32_FIND_DATA */
  25. #endif
  26.  
  27. #if !defined(RC_INVOKED)
  28.  
  29. #if defined(__STDC__)
  30. #pragma warn -nak
  31. #endif
  32.  
  33. #pragma pack(push, 1)
  34.  
  35. #endif  /* !RC_INVOKED */
  36.  
  37.  
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41.  
  42.  
  43. /* dirent structure returned by readdir().
  44.  */
  45. struct dirent
  46. {
  47.     char        d_name[260];
  48. };
  49.  
  50. /* wdirent structure returned by wreaddir().
  51.  */
  52. struct wdirent
  53. {
  54.     wchar_t        d_name[260];
  55. };
  56.  
  57. /* DIR type returned by opendir().  The members of this structure
  58.  * must not be accessed by application programs.
  59.  */
  60. typedef struct
  61. {
  62.     unsigned long _d_hdir;              /* directory handle */
  63.     char         *_d_dirname;           /* directory name */
  64.     unsigned      _d_magic;             /* magic cookie for verifying handle */
  65.     unsigned      _d_nfiles;            /* no. of files remaining in buf */
  66.     char          _d_buf[sizeof(WIN32_FIND_DATA)];  /* buffer for a single file */
  67. } DIR;
  68.  
  69. typedef struct
  70. {
  71.     unsigned long _d_hdir;              /* directory handle */
  72.     wchar_t      *_d_dirname;           /* directory name */
  73.     unsigned      _d_magic;             /* magic cookie for verifying handle */
  74.     unsigned      _d_nfiles;            /* no. of files remaining in buf */
  75.     char          _d_buf[sizeof(WIN32_FIND_DATA)];  /* buffer for a single file */
  76. } wDIR;
  77.  
  78. wDIR           * _RTLENTRY _EXPFUNC wopendir  (const wchar_t *__dirname);
  79. struct wdirent * _RTLENTRY _EXPFUNC wreaddir  (wDIR *__dir);
  80. int              _RTLENTRY _EXPFUNC wclosedir (wDIR *__dir);
  81. void             _RTLENTRY _EXPFUNC wrewinddir(wDIR *__dir);
  82.  
  83. /* Prototypes.
  84.  */
  85. DIR            _FAR * _RTLENTRY _EXPFUNC opendir  (const char _FAR *__dirname);
  86. struct dirent  _FAR * _RTLENTRY _EXPFUNC readdir  (DIR _FAR *__dir);
  87. int                   _RTLENTRY _EXPFUNC closedir (DIR _FAR *__dir);
  88. void                  _RTLENTRY _EXPFUNC rewinddir(DIR _FAR *__dir);
  89.  
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93.  
  94.  
  95. #if !defined(RC_INVOKED)
  96.  
  97. /* restore default packing */
  98. #pragma pack(pop)
  99.  
  100. #if defined(__STDC__)
  101. #pragma warn .nak
  102. #endif
  103.  
  104. #endif  /* !RC_INVOKED */
  105.  
  106.  
  107. #endif  /* __DIRENT_H */
  108.  
  109.