Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /**
  2.  * This file has no copyright assigned and is placed in the Public Domain.
  3.  * This file is part of the w64 mingw-runtime package.
  4.  * No warranty is given; refer to the file DISCLAIMER within this package.
  5.  */
  6. /* All the headers include this file. */
  7. #include <_mingw.h>
  8.  
  9. #ifndef __STRICT_ANSI__
  10.  
  11. #ifndef _DIRENT_H_
  12. #define _DIRENT_H_
  13.  
  14.  
  15. #pragma pack(push,_CRT_PACKING)
  16.  
  17. #include <io.h>
  18.  
  19. #ifndef RC_INVOKED
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25.   struct dirent
  26.   {
  27.     long                d_ino;          /* Always zero. */
  28.     unsigned short      d_reclen;       /* Always zero. */
  29.     unsigned short      d_namlen;       /* Length of name in d_name. */
  30.     char*               d_name;         /* File name. */
  31.     /* NOTE: The name in the dirent structure points to the name in the
  32.     *       finddata_t structure in the DIR. */
  33.   };
  34.  
  35.   /*
  36.   * This is an internal data structure. Good programmers will not use it
  37.   * except as an argument to one of the functions below.
  38.   * dd_stat field is now int (was short in older versions).
  39.   */
  40.   typedef struct
  41.   {
  42.     /* disk transfer area for this dir */
  43.     struct _finddata_t  dd_dta;
  44.  
  45.     /* dirent struct to return from dir (NOTE: this makes this thread
  46.     * safe as long as only one thread uses a particular DIR struct at
  47.     * a time) */
  48.     struct dirent               dd_dir;
  49.  
  50.     /* _findnext handle */
  51.     long                        dd_handle;
  52.  
  53.     /*
  54.     * Status of search:
  55.     *   0 = not started yet (next entry to read is first entry)
  56.     *  -1 = off the end
  57.     *   positive = 0 based index of next entry
  58.     */
  59.     int                 dd_stat;
  60.  
  61.     /* given path for dir with search pattern (struct is extended) */
  62.     char                        dd_name[1];
  63.   } DIR;
  64.  
  65.   DIR* __cdecl opendir (const char*);
  66.   struct dirent* __cdecl readdir (DIR*);
  67.   int __cdecl closedir (DIR*);
  68.   void __cdecl rewinddir (DIR*);
  69.   long __cdecl telldir (DIR*);
  70.   void __cdecl seekdir (DIR*, long);
  71.  
  72.  
  73.   /* wide char versions */
  74.  
  75.   struct _wdirent
  76.   {
  77.     long                d_ino;          /* Always zero. */
  78.     unsigned short      d_reclen;       /* Always zero. */
  79.     unsigned short      d_namlen;       /* Length of name in d_name. */
  80.     wchar_t*    d_name;         /* File name. */
  81.     /* NOTE: The name in the dirent structure points to the name in the  *       wfinddata_t structure in the _WDIR. */
  82.   };
  83.  
  84.   /*
  85.   * This is an internal data structure. Good programmers will not use it
  86.   * except as an argument to one of the functions below.
  87.   */
  88.   typedef struct
  89.   {
  90.     /* disk transfer area for this dir */
  91.     struct _wfinddata_t dd_dta;
  92.  
  93.     /* dirent struct to return from dir (NOTE: this makes this thread
  94.     * safe as long as only one thread uses a particular DIR struct at
  95.     * a time) */
  96.     struct _wdirent             dd_dir;
  97.  
  98.     /* _findnext handle */
  99.     long                        dd_handle;
  100.  
  101.     /*
  102.     * Status of search:
  103.     *   0 = not started yet (next entry to read is first entry)
  104.     *  -1 = off the end
  105.     *   positive = 0 based index of next entry
  106.     */
  107.     int                 dd_stat;
  108.  
  109.     /* given path for dir with search pattern (struct is extended) */
  110.     wchar_t                     dd_name[1];
  111.   } _WDIR;
  112.  
  113.  
  114.  
  115.   _WDIR* __cdecl _wopendir (const wchar_t*);
  116.   struct _wdirent*  __cdecl _wreaddir (_WDIR*);
  117.   int __cdecl _wclosedir (_WDIR*);
  118.   void __cdecl _wrewinddir (_WDIR*);
  119.   long __cdecl _wtelldir (_WDIR*);
  120.   void __cdecl _wseekdir (_WDIR*, long);
  121.  
  122.  
  123. #ifdef  __cplusplus
  124. }
  125. #endif
  126.  
  127. #endif  /* Not RC_INVOKED */
  128.  
  129. #pragma pack(pop)
  130.  
  131. #endif  /* Not _DIRENT_H_ */
  132.  
  133.  
  134. #endif  /* Not __STRICT_ANSI__ */
  135.  
  136.