Commit /bin/cc.exe (a hardlink of /bin/gcc.exe)
[msysgit.git] / include / sys / dirent.h
blobf911a5612e5b76f8429c2b33c626482ee92bb745
1 /* Posix dirent.h for WIN32.
3 Copyright 2001 Red Hat, Inc.
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. */
9 /* Including this file should not require any Windows headers. */
11 #ifndef _SYS_DIRENT_H
12 #define _SYS_DIRENT_H
14 #include <sys/types.h>
16 #define __DIRENT_VERSION 1
18 struct dirent
20 long d_version; /* Used since Cygwin 1.3.3. */
21 long __d_reserved[2];
22 long d_fd; /* File descriptor of open directory. Used since Cygwin 1.3.3. */
23 ino_t d_ino; /* Just for compatibility, it's junk */
24 char d_name[256]; /* FIXME: use NAME_MAX? */
27 #define __DIRENT_COOKIE 0xdede4242
29 typedef struct
31 /* This is first to set alignment in non _COMPILING_NEWLIB case. */
32 unsigned long __d_cookie;
33 struct dirent *__d_dirent;
34 char *__d_dirname; /* directory name with trailing '*' */
35 off_t __d_position; /* used by telldir/seekdir */
36 unsigned long __d_dirhash; /* hash of directory name for use by
37 readdir */
38 union
40 #ifdef _COMPILING_NEWLIB
41 struct
43 void *__handle;
44 char __open_p;
45 } __d_data;
46 #endif
47 char __d_filler[16];
48 } __d_u;
49 } DIR;
51 DIR *opendir (const char *);
52 struct dirent *readdir (DIR *);
53 void rewinddir (DIR *);
54 int closedir (DIR *);
56 int dirfd (DIR *);
58 #ifndef _POSIX_SOURCE
59 off_t telldir (DIR *);
60 void seekdir (DIR *, off_t loc);
62 int scandir (const char *__dir,
63 struct dirent ***__namelist,
64 int (*select) (const struct dirent *),
65 int (*compar) (const struct dirent **, const struct dirent **));
67 int alphasort (const struct dirent **__a, const struct dirent **__b);
68 #endif /* _POSIX_SOURCE */
70 #endif