Classes | Macros | Typedefs | Functions
win_dirent.h File Reference
#include <cstdint>
#include <stdio.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wchar.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
Include dependency graph for win_dirent.h:

Go to the source code of this file.

Classes

struct  _WDIR
 
struct  _wdirent
 
struct  DIR
 
struct  dirent
 

Macros

#define _D_ALLOC_NAMLEN(p)   (PATH_MAX)
 
#define _D_EXACT_NAMLEN(p)   ((p)->d_namlen)
 
#define _DIRENT_HAVE_D_NAMLEN
 
#define _DIRENT_HAVE_D_TYPE
 
#define DT_BLK   S_IFBLK
 
#define DT_CHR   S_IFCHR
 
#define DT_DIR   S_IFDIR
 
#define DT_FIFO   S_IFIFO
 
#define DT_LNK   S_IFLNK
 
#define DT_REG   S_IFREG
 
#define DT_SOCK   S_IFSOCK
 
#define DT_UNKNOWN   0
 
#define DTTOIF(type)   (type)
 
#define FILE_ATTRIBUTE_DEVICE   0x40
 
#define FILENAME_MAX   MAX_PATH
 
#define IFTODT(mode)   ((mode) & S_IFMT)
 
#define NAME_MAX   FILENAME_MAX
 
#define PATH_MAX   MAX_PATH
 
#define S_IEXEC   _S_IEXEC
 
#define S_IFBLK   0
 
#define S_IFCHR   _S_IFCHR
 
#define S_IFDIR   _S_IFDIR
 
#define S_IFFIFO   _S_IFFIFO
 
#define S_IFIFO   _S_IFIFO
 
#define S_IFLNK   0
 
#define S_IFMT   _S_IFMT
 
#define S_IFREG   _S_IFREG
 
#define S_IFSOCK   0
 
#define S_IREAD   _S_IREAD
 
#define S_ISBLK(mode)   (((mode) & S_IFMT) == S_IFBLK)
 
#define S_ISCHR(mode)   (((mode) & S_IFMT) == S_IFCHR)
 
#define S_ISDIR(mode)   (((mode) & S_IFMT) == S_IFDIR)
 
#define S_ISFIFO(mode)   (((mode) & S_IFMT) == S_IFIFO)
 
#define S_ISLNK(mode)   (((mode) & S_IFMT) == S_IFLNK)
 
#define S_ISREG(mode)   (((mode) & S_IFMT) == S_IFREG)
 
#define S_ISSOCK(mode)   (((mode) & S_IFMT) == S_IFSOCK)
 
#define S_IWRITE   _S_IWRITE
 
#define wclosedir   _wclosedir
 
#define WDIR   _WDIR
 
#define wdirent   _wdirent
 
#define wopendir   _wopendir
 
#define wreaddir   _wreaddir
 
#define wrewinddir   _wrewinddir
 

Typedefs

typedef struct _WDIR _WDIR
 
typedef struct _wdirent _wdirent
 
typedef struct DIR DIR
 
typedef struct dirent dirent
 

Functions

static int _wclosedir (_WDIR *dirp)
 
static _WDIR_wopendir (const wchar_t *dirname)
 
static struct _wdirent_wreaddir (_WDIR *dirp)
 
static void _wrewinddir (_WDIR *dirp)
 
static int closedir (DIR *dirp)
 
static WIN32_FIND_DATAW * dirent_first (_WDIR *dirp)
 
static int dirent_mbstowcs_s (size_t *pReturnValue, wchar_t *wcstr, size_t sizeInWords, const char *mbstr, size_t count)
 
static WIN32_FIND_DATAW * dirent_next (_WDIR *dirp)
 
static void dirent_set_errno (int error)
 
static int dirent_wcstombs_s (size_t *pReturnValue, char *mbstr, size_t sizeInBytes, const wchar_t *wcstr, size_t count)
 
static DIRopendir (const char *dirname)
 
static void rewinddir (DIR *dirp)
 

Macro Definition Documentation

#define _D_ALLOC_NAMLEN (   p)    (PATH_MAX)
#define _D_EXACT_NAMLEN (   p)    ((p)->d_namlen)
#define _DIRENT_HAVE_D_NAMLEN
#define _DIRENT_HAVE_D_TYPE
#define DT_BLK   S_IFBLK
#define DT_CHR   S_IFCHR

Referenced by _wreaddir().

#define DT_DIR   S_IFDIR

Referenced by _wreaddir().

#define DT_FIFO   S_IFIFO
#define DT_LNK   S_IFLNK
#define DT_REG   S_IFREG

Referenced by _wreaddir().

#define DT_SOCK   S_IFSOCK
#define DT_UNKNOWN   0
#define DTTOIF (   type)    (type)
#define FILE_ATTRIBUTE_DEVICE   0x40

Referenced by _wreaddir().

#define FILENAME_MAX   MAX_PATH
#define IFTODT (   mode)    ((mode) & S_IFMT)
#define NAME_MAX   FILENAME_MAX
#define PATH_MAX   MAX_PATH

Referenced by _wreaddir(), and opendir().

#define S_IEXEC   _S_IEXEC
#define S_IFBLK   0
#define S_IFCHR   _S_IFCHR
#define S_IFDIR   _S_IFDIR
#define S_IFFIFO   _S_IFFIFO
#define S_IFIFO   _S_IFIFO
#define S_IFLNK   0
#define S_IFMT   _S_IFMT
#define S_IFREG   _S_IFREG
#define S_IFSOCK   0
#define S_IREAD   _S_IREAD
#define S_ISBLK (   mode)    (((mode) & S_IFMT) == S_IFBLK)
#define S_ISCHR (   mode)    (((mode) & S_IFMT) == S_IFCHR)
#define S_ISDIR (   mode)    (((mode) & S_IFMT) == S_IFDIR)
#define S_ISFIFO (   mode)    (((mode) & S_IFMT) == S_IFIFO)
#define S_ISLNK (   mode)    (((mode) & S_IFMT) == S_IFLNK)
#define S_ISREG (   mode)    (((mode) & S_IFMT) == S_IFREG)
#define S_ISSOCK (   mode)    (((mode) & S_IFMT) == S_IFSOCK)
#define S_IWRITE   _S_IWRITE
#define wclosedir   _wclosedir
#define WDIR   _WDIR
#define wdirent   _wdirent
#define wopendir   _wopendir
#define wreaddir   _wreaddir
#define wrewinddir   _wrewinddir

Typedef Documentation

typedef struct _WDIR _WDIR
typedef struct _wdirent _wdirent
typedef struct DIR DIR
typedef struct dirent dirent

Function Documentation

static int _wclosedir ( _WDIR dirp)
static

References dirent_set_errno(), _WDIR::handle, NULL, and _WDIR::patt.

Referenced by _wopendir(), and closedir().

static _WDIR * _wopendir ( const wchar_t *  dirname)
static
static struct _wdirent * _wreaddir ( _WDIR dirp)
static
static void _wrewinddir ( _WDIR dirp)
static

References dirent_first(), and _WDIR::handle.

Referenced by rewinddir().

static int closedir ( DIR dirp)
static
static WIN32_FIND_DATAW * dirent_first ( _WDIR dirp)
static
static int dirent_mbstowcs_s ( size_t *  pReturnValue,
wchar_t *  wcstr,
size_t  sizeInWords,
const char *  mbstr,
size_t  count 
)
static

Referenced by opendir().

static WIN32_FIND_DATAW * dirent_next ( _WDIR dirp)
static

References _WDIR::cached, _WDIR::data, _WDIR::handle, and NULL.

Referenced by _wreaddir().

static void dirent_set_errno ( int  error)
static
static int dirent_wcstombs_s ( size_t *  pReturnValue,
char *  mbstr,
size_t  sizeInBytes,
const wchar_t *  wcstr,
size_t  count 
)
static
static DIR * opendir ( const char *  dirname)
static
static void rewinddir ( DIR dirp)
static

References _wrewinddir(), and DIR::wdirp.