Win32-OpenSSH/win32_dirent.h
quamrulmina 4d952924e1 sftp client and server code changed to build & work with MS Visual Studio
Use new compile flag WIN32_VS to add/change logic of sftp client and
sftp server codes so that MS Visual Studio 2015 compiler and runtime can
be used. opendir(), readdir(), closedir() directory APIs and basename()
API of Unix/Linux are implemented in Windows as they are not available
in Windows/VisualStudio C-runtime. win32_dirent.c and win32_dirent.h
files added as dirent.c and dirent.h are not available in Windows and we
do not want to affect mingW/gcc builds for Windows which have those
files available.
2015-11-06 03:02:51 -06:00

33 lines
716 B
C

// direntry functions in Windows platform like Ubix/Linux
// opendir(), readdir(), closedir().
// NT_DIR * nt_opendir(char *name) ;
// struct nt_dirent *nt_readdir(NT_DIR *dirp);
// int nt_closedir(NT_DIR *dirp) ;
#ifndef __DIRENT_H__
#define __DIRENT_H__
#include <direct.h>
#include <io.h>
// Windows directory structure content
struct dirent {
char *d_name ; // name of the directory entry
int d_ino; // UNIX inode
//unsigned attrib ; // its attributes
};
typedef struct {
intptr_t hFile;
struct _finddata_t c_file;
int bRoot;
int bDrive;
char initName[260];
} DIR;
DIR * opendir(char *name);
int closedir(DIR *dirp);
struct dirent *readdir(void *avp);
char *basename(char *path);
#endif