dav/system.h

changeset 411
a182e503617b
parent 410
0b9bea2d7283
child 412
dc74f736aea1
equal deleted inserted replaced
410:0b9bea2d7283 411:a182e503617b
35 #include <sys/stat.h> 35 #include <sys/stat.h>
36 #include <dirent.h> 36 #include <dirent.h>
37 37
38 #ifdef _WIN32 38 #ifdef _WIN32
39 #include <Windows.h> 39 #include <Windows.h>
40 struct WinDir {
41 int first;
42 HANDLE handle;
43 WIN32_FIND_DATAW finddata;
44 };
45 #define SYS_DIR struct WinDir*
46 #define SYS_STAT struct __stat64
47
48 #else
49 #define SYS_DIR DIR*
50 #define SYS_STAT struct stat
51 #endif 40 #endif
52 41
53 #ifdef __cplusplus 42 #ifdef __cplusplus
54 extern "C" { 43 extern "C" {
55 #endif 44 #endif
56 45
57 typedef struct SysDirEnt { 46 typedef struct SysDirEnt {
58 char *name; 47 char *name;
59 } SysDirEnt; 48 } SysDirEnt;
49
50 #ifdef _WIN32
51 struct WinDir {
52 int first;
53 HANDLE handle;
54 WIN32_FIND_DATAW finddata;
55 SysDirEnt *ent;
56 };
57 #define SYS_DIR struct WinDir*
58 #define SYS_STAT struct __stat64
59
60 #else
61
62 typedef struct SysDir {
63 DIR *dir;
64 SysDirEnt *ent;
65 } SysDir;
66
67 #define SYS_DIR SysDir*
68 #define SYS_STAT struct stat
69 #endif
60 70
61 void sys_freedirent(SysDirEnt *ent); 71 void sys_freedirent(SysDirEnt *ent);
62 SYS_DIR sys_opendir(const char *path); 72 SYS_DIR sys_opendir(const char *path);
63 SysDirEnt* sys_readdir(SYS_DIR dir); 73 SysDirEnt* sys_readdir(SYS_DIR dir);
64 void sys_closedir(SYS_DIR dir); 74 void sys_closedir(SYS_DIR dir);
65 75
66 FILE* sys_fopen(const char *path, const char *mode); 76 FILE* sys_fopen(const char *path, const char *mode);
67 77
68 int sys_stat(const char *path, SYS_STAT *s); 78 int sys_stat(const char *path, SYS_STAT *s);
69 79
80 int sys_rename(const char *oldpath, const char *newpath);
81
70 #ifdef __cplusplus 82 #ifdef __cplusplus
71 } 83 }
72 #endif 84 #endif
73 85
74 #endif /* DAV_SYSTEM_H */ 86 #endif /* DAV_SYSTEM_H */

mercurial