home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 June / PCWorld_2005-06_cd.bin / software / vyzkuste / firewally / firewally.exe / framework-2.3.exe / dirent.h < prev    next >
C/C++ Source or Header  |  2004-01-30  |  2KB  |  91 lines

  1. /* Posix dirent.h for WIN32.
  2.  
  3.    Copyright 2001, 2002, 2003 Red Hat, Inc.
  4.  
  5.    This software is a copyrighted work licensed under the terms of the
  6.    Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
  7.    details. */
  8.  
  9. /* Including this file should not require any Windows headers.  */
  10.    
  11. #ifndef _SYS_DIRENT_H
  12. #define _SYS_DIRENT_H
  13.  
  14. #include <sys/types.h>
  15.  
  16. #define __DIRENT_VERSION    2
  17.  
  18. #pragma pack(push,4)
  19. #ifdef __INSIDE_CYGWIN__
  20. struct dirent
  21. {
  22.   long d_version;    /* Used since Cygwin 1.3.3. */
  23.   __ino64_t d_ino;    /* still junk but with more bits */
  24.   long d_fd;        /* File descriptor of open directory.
  25.                Used since Cygwin 1.3.3. */
  26.   unsigned __ino32;
  27.   char d_name[256];    /* FIXME: use NAME_MAX? */
  28. };
  29. #else
  30. #ifdef __CYGWIN_USE_BIG_TYPES__
  31. struct dirent
  32. {
  33.   long d_version;
  34.   ino_t d_ino;
  35.   long d_fd;
  36.   unsigned long __ino32;
  37.   char d_name[256];
  38. };
  39. #else
  40. struct dirent
  41. {
  42.   long d_version;
  43.   long d_reserved[2];
  44.   long d_fd;
  45.   ino_t d_ino;
  46.   char d_name[256];
  47. };
  48. #endif
  49. #endif
  50. #pragma pack(pop)
  51.  
  52. #define __DIRENT_COOKIE 0xdede4242
  53.  
  54. #pragma pack(push,4)
  55. typedef struct __DIR
  56. {
  57.   /* This is first to set alignment in non _COMPILING_NEWLIB case.  */
  58.   unsigned long __d_cookie;
  59.   struct dirent *__d_dirent;
  60.   char *__d_dirname;        /* directory name with trailing '*' */
  61.   _off_t __d_position;        /* used by telldir/seekdir */
  62.   __ino64_t __d_dirhash;    /* hash of directory name for use by readdir */
  63.   void *__handle;
  64.   void *__fh;
  65.   unsigned __flags;
  66. } DIR;
  67. #pragma pack(pop)
  68.  
  69. DIR *opendir (const char *);
  70. struct dirent *readdir (DIR *);
  71. void rewinddir (DIR *);
  72. int closedir (DIR *);
  73.  
  74. int dirfd (DIR *);
  75.  
  76. #ifndef _POSIX_SOURCE
  77. #ifndef __INSIDE_CYGWIN__
  78. off_t telldir (DIR *);
  79. void seekdir (DIR *, off_t loc);
  80. #endif
  81.  
  82. int scandir (const char *__dir,
  83.          struct dirent ***__namelist,
  84.          int (*select) (const struct dirent *),
  85.          int (*compar) (const struct dirent **, const struct dirent **));
  86.  
  87. int alphasort (const struct dirent **__a, const struct dirent **__b);
  88. #endif /* _POSIX_SOURCE */
  89.  
  90. #endif
  91.