2003-05-12 13:06:27 +02:00
|
|
|
/* Posix dirent.h for WIN32.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
/* Including this file should not require any Windows headers. */
|
2005-05-02 05:50:11 +02:00
|
|
|
|
2003-05-12 13:06:27 +02:00
|
|
|
#ifndef _SYS_DIRENT_H
|
|
|
|
#define _SYS_DIRENT_H
|
|
|
|
|
2016-03-14 22:17:38 +01:00
|
|
|
#include <sys/cdefs.h>
|
2003-05-12 13:06:27 +02:00
|
|
|
#include <sys/types.h>
|
2007-12-06 19:24:06 +01:00
|
|
|
#include <limits.h>
|
2003-05-12 13:06:27 +02:00
|
|
|
|
|
|
|
#define __DIRENT_VERSION 2
|
|
|
|
|
2017-11-27 14:36:06 +01:00
|
|
|
#ifdef __i386__
|
2003-05-12 13:06:27 +02:00
|
|
|
#pragma pack(push,4)
|
2013-04-23 11:44:36 +02:00
|
|
|
#endif
|
2008-11-28 10:04:35 +01:00
|
|
|
#define _DIRENT_HAVE_D_TYPE
|
2003-05-12 13:06:27 +02:00
|
|
|
struct dirent
|
|
|
|
{
|
2013-04-23 11:44:36 +02:00
|
|
|
uint32_t __d_version; /* Used internally */
|
|
|
|
ino_t d_ino;
|
2008-11-28 10:04:35 +01:00
|
|
|
unsigned char d_type;
|
|
|
|
unsigned char __d_unused1[3];
|
2006-01-27 22:50:42 +01:00
|
|
|
__uint32_t __d_internal1;
|
2007-12-05 16:10:20 +01:00
|
|
|
char d_name[NAME_MAX + 1];
|
2003-05-12 13:06:27 +02:00
|
|
|
};
|
2017-11-27 14:36:06 +01:00
|
|
|
#ifdef __i386__
|
2003-05-12 13:06:27 +02:00
|
|
|
#pragma pack(pop)
|
2013-04-23 11:44:36 +02:00
|
|
|
#endif
|
2003-05-12 13:06:27 +02:00
|
|
|
|
2010-08-06 20:55:25 +02:00
|
|
|
#define d_fileno d_ino /* BSD compatible definition */
|
|
|
|
|
2013-04-23 11:44:36 +02:00
|
|
|
#ifdef __x86_64__
|
|
|
|
#define __DIRENT_COOKIE 0xcdcd8484
|
|
|
|
#else
|
2003-05-12 13:06:27 +02:00
|
|
|
#define __DIRENT_COOKIE 0xdede4242
|
2013-04-23 11:44:36 +02:00
|
|
|
#endif
|
2003-05-12 13:06:27 +02:00
|
|
|
|
2017-11-27 14:36:06 +01:00
|
|
|
#ifdef __i386__
|
2003-09-08 06:04:19 +02:00
|
|
|
#pragma pack(push,4)
|
2013-04-23 11:44:36 +02:00
|
|
|
#endif
|
2003-05-12 13:06:27 +02:00
|
|
|
typedef struct __DIR
|
|
|
|
{
|
|
|
|
/* This is first to set alignment in non _COMPILING_NEWLIB case. */
|
|
|
|
unsigned long __d_cookie;
|
|
|
|
struct dirent *__d_dirent;
|
2006-01-20 17:04:40 +01:00
|
|
|
char *__d_dirname; /* directory name with trailing '*' */
|
2013-04-23 11:44:36 +02:00
|
|
|
__int32_t __d_position; /* used by telldir/seekdir */
|
2006-01-21 03:24:17 +01:00
|
|
|
int __d_fd;
|
2013-04-23 11:44:36 +02:00
|
|
|
uintptr_t __d_internal;
|
2003-09-08 06:04:19 +02:00
|
|
|
void *__handle;
|
|
|
|
void *__fh;
|
|
|
|
unsigned __flags;
|
2003-05-12 13:06:27 +02:00
|
|
|
} DIR;
|
2017-11-27 14:36:06 +01:00
|
|
|
#ifdef __i386__
|
2003-09-08 06:04:19 +02:00
|
|
|
#pragma pack(pop)
|
2013-04-23 11:44:36 +02:00
|
|
|
#endif
|
2003-05-12 13:06:27 +02:00
|
|
|
|
2016-03-14 22:17:38 +01:00
|
|
|
#if __BSD_VISIBLE
|
2008-11-28 10:04:35 +01:00
|
|
|
#ifdef _DIRENT_HAVE_D_TYPE
|
2005-08-07 01:00:06 +02:00
|
|
|
/* File types for `d_type'. */
|
|
|
|
enum
|
2005-08-12 04:39:13 +02:00
|
|
|
{
|
|
|
|
DT_UNKNOWN = 0,
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_UNKNOWN DT_UNKNOWN
|
2005-08-12 04:39:13 +02:00
|
|
|
DT_FIFO = 1,
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_FIFO DT_FIFO
|
2005-08-12 04:39:13 +02:00
|
|
|
DT_CHR = 2,
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_CHR DT_CHR
|
2005-08-12 04:39:13 +02:00
|
|
|
DT_DIR = 4,
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_DIR DT_DIR
|
2005-08-12 04:39:13 +02:00
|
|
|
DT_BLK = 6,
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_BLK DT_BLK
|
2005-08-12 04:39:13 +02:00
|
|
|
DT_REG = 8,
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_REG DT_REG
|
2005-08-12 04:39:13 +02:00
|
|
|
DT_LNK = 10,
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_LNK DT_LNK
|
2005-08-12 04:39:13 +02:00
|
|
|
DT_SOCK = 12,
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_SOCK DT_SOCK
|
2005-08-12 04:39:13 +02:00
|
|
|
DT_WHT = 14
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DT_WHT DT_WHT
|
2005-08-12 04:39:13 +02:00
|
|
|
};
|
2005-08-07 01:00:06 +02:00
|
|
|
|
|
|
|
/* Convert between stat structure types and directory types. */
|
2005-08-12 04:39:13 +02:00
|
|
|
# define IFTODT(mode) (((mode) & 0170000) >> 12)
|
2005-08-07 01:00:06 +02:00
|
|
|
# define DTTOIF(dirtype) ((dirtype) << 12)
|
2008-11-28 10:04:35 +01:00
|
|
|
#endif /* _DIRENT_HAVE_D_TYPE */
|
2016-03-14 22:17:38 +01:00
|
|
|
#endif /* __BSD_VISIBLE */
|
2005-08-12 04:39:13 +02:00
|
|
|
#endif /*_SYS_DIRENT_H*/
|