home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / DIRENT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  2.5 KB  |  107 lines

  1. /*  dirent.h
  2.  
  3.     Definitions for POSIX directory operations.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 6.0
  9.  *
  10.  *      Copyright (c) 1991, 1993 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. #ifndef __DIRENT_H
  16. #define __DIRENT_H
  17.  
  18. #if !defined(___DEFS_H)
  19. #include <_defs.h>
  20. #endif
  21.  
  22. #ifndef NULL
  23. #include <_null.h>
  24. #endif
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. #if !defined(_RC_INVOKED)
  31. #pragma option -a-
  32. #endif
  33.  
  34.  
  35. /* dirent structure returned by readdir().
  36.  */
  37. struct dirent
  38. {
  39. #if defined(__OS2__)
  40.     char        d_name[256];
  41. #elif defined(__WIN32__) || defined(__DPMI32__)
  42.     char        d_name[260];
  43. #else
  44.     char        d_name[13];
  45. #endif
  46. };
  47.  
  48. #if !defined(__FLAT__)
  49.  
  50. /* _DIR type returned by _opendir().  The first two members cannot
  51.  * be separated, because they make up the DOS DTA structure used
  52.  * by _findfirst() and _findnext().
  53.  */
  54. typedef struct
  55. {
  56.     char           _d_reserved[30];      /* reserved part of DTA */
  57.     struct dirent  _d_dirent;            /* filename part of DTA */
  58.     char    _FAR  *_d_dirname;           /* directory name */
  59.     char           _d_first;             /* first file flag */
  60.     unsigned char  _d_magic;             /* magic cookie for verifying handle */
  61. } DIR;
  62.  
  63. #else    /* defined __FLAT__ */
  64.  
  65.  
  66. #if defined(__WIN32__)
  67. #include <winbase.h>
  68. #endif
  69.     
  70. /* DIR type returned by opendir().  The members of this structure
  71.  * must not be accessed by application programs.
  72.  */
  73. typedef struct
  74. {
  75.     unsigned long _d_hdir;              /* directory handle */
  76.     char         *_d_dirname;           /* directory name */
  77.     unsigned      _d_magic;             /* magic cookie for verifying handle */
  78.     unsigned      _d_nfiles;            /* no. of files remaining in buf */
  79. #if defined(__OS2__)
  80.     char         *_d_bufp;              /* next entry in buffer */
  81.     char          _d_buf[512];          /* buffer for found filenames */
  82. #endif
  83. #if defined(__WIN32__)
  84.     char          _d_buf[sizeof(WIN32_FIND_DATA)];  /* buffer for a single file */
  85. #endif
  86. } DIR;
  87.  
  88. #endif  /* __FLAT__ */
  89.  
  90. /* Prototypes.
  91.  */
  92. DIR            _FAR * _RTLENTRY _EXPFUNC opendir  (const char _FAR *__dirname);
  93. struct dirent  _FAR * _RTLENTRY _EXPFUNC readdir  (DIR _FAR *__dir);
  94. int                   _RTLENTRY _EXPFUNC closedir (DIR _FAR *__dir);
  95. void                  _RTLENTRY _EXPFUNC rewinddir(DIR _FAR *__dir);
  96.  
  97. #if !defined(_RC_INVOKED)
  98. #pragma option -a. /* restore default packing  */
  99. #endif
  100.  
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104.  
  105. #endif  /* __DIRENT_H */
  106.  
  107.