src/server/public/vfs.h

branch
webdav
changeset 211
2160585200ac
parent 189
a2438f6d1e73
child 241
4adad7faf452
--- a/src/server/public/vfs.h	Tue Aug 13 22:14:32 2019 +0200
+++ b/src/server/public/vfs.h	Thu Oct 31 10:26:35 2019 +0100
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 2013 Olaf Wintermann. All rights reserved.
+ * Copyright 2018 Olaf Wintermann. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -52,9 +52,11 @@
     int (*stat)(VFSContext *ctx, char *path, struct stat *buf);
     int (*fstat)(VFSContext *ctx, SYS_FILE fd, struct stat *buf);
     VFS_DIR (*opendir)(VFSContext *ctx, char *path);
+    VFS_DIR (*fdopendir)(VFSContext *ctx, SYS_FILE fd);
     int (*mkdir)(VFSContext *ctx, char *path);
     int (*unlink)(VFSContext *ctx, char *path);
     uint32_t flags;
+    void *instance;
 };
 
 struct VFSContext {
@@ -70,16 +72,16 @@
 
 struct VFSFile {
     VFSContext *ctx;
-    VFS_IO *io; // IO functions
-    void *data; // private data used by the VFSFile implementation
-    int fd; // native file descriptor if available, or -1
+    VFS_IO *io; /* IO functions */
+    void *data; /* private data used by the VFSFile implementation */
+    int fd; /* native file descriptor if available, or -1 */
 };
 
 struct VFSDir {
     VFSContext *ctx;
     VFS_DIRIO *io;
-    void *data; // private data used by the VFSDir implementation
-    int fd; // native file descriptor if available, or -1
+    void *data; /* private data used by the VFSDir implementation */
+    int fd; /* native file descriptor if available, or -1 */
 };
 
 struct VFSEntry {
@@ -124,6 +126,7 @@
 int vfs_fstat(VFSContext *ctx, SYS_FILE fd, struct stat *buf);
 void vfs_close(SYS_FILE fd);
 VFS_DIR vfs_opendir(VFSContext *ctx, char *path);
+VFS_DIR vfs_fdopendir(VFSContext *ctx, SYS_FILE fd);
 int vfs_readdir(VFS_DIR dir, VFS_ENTRY *entry);
 int vfs_readdir_stat(VFS_DIR dir, VFS_ENTRY *entry);
 void vfs_closedir(VFS_DIR dir);

mercurial