dav/system.h

changeset 611
a7c48e0dca88
parent 608
3e4c0285a868
child 789
378b5ab86f77
--- a/dav/system.h	Fri Aug 02 21:40:05 2019 +0200
+++ b/dav/system.h	Fri Aug 02 22:04:00 2019 +0200
@@ -57,11 +57,12 @@
 #define SYS_DIR struct WinDir*
 #define SYS_STAT struct __stat64
 
-#define S_ISLNK(s) 0
-
 typedef int uid_t;
 typedef int gid_t;
 
+#define SYS_ISLINK(path, mode) sys_islink(path)
+#define SYS_LINK_EXT ".lnk"
+
 #else
 
 typedef struct SysDir {
@@ -71,10 +72,16 @@
 
 #define SYS_DIR SysDir*
 #define SYS_STAT struct stat
+
+#define SYS_ISLINK(p, s) S_ISLNK(s.st_mode)
+
 #endif
 
 typedef int(*stat_func)(const char*, SYS_STAT *);
 
+void sys_init(void);
+void sys_uninit(void);
+
 void sys_freedirent(SysDirEnt *ent);
 SYS_DIR sys_opendir(const char *path);
 SysDirEnt* sys_readdir(SYS_DIR dir);
@@ -85,11 +92,13 @@
 int sys_stat(const char *path, SYS_STAT *s);
 int sys_lstat(const char *path, SYS_STAT *s);
 
+int sys_islink(const char *path);
+
 int sys_rename(const char *oldpath, const char *newpath);
 int sys_unlink(const char *path);
 int sys_mkdir(const char *path);
 
-ssize_t sys_readlink(const char *path, char *buffer, size_t size);
+char* sys_readlink(const char *path, SYS_STAT *s);
 
 int sys_symlink(const char *target, const char *linkpath);
 

mercurial