]> git.pond.sub.org Git - empserver/blobdiff - include/file.h
Change empfile members postread() and prewrite() to return void
[empserver] / include / file.h
index 6dd42dfa6096730e5faf56ae4365bf5425c4f773..de7486b41fbffffb53352d6bd8c3e36f762895ea 100644 (file)
@@ -59,9 +59,19 @@ struct empfile {
     int fd;                    /* file descriptor, -1 if not open */
     /* flags bits EFF_PRIVATE, EFF_CUSTOM also vary */
 
-    /* User callbacks */
-    int (*postread)(int, void *); /* called after read, unless null */
-    int (*prewrite)(int, void *); /* called before write, unless null */
+    /* User callbacks, may all be null */
+    /*
+     * Called after read, with file type and element as arguments.
+     * May modify the element.  Modifications are visible to caller of
+     * ef_read(), but have no effect on the file.
+     */
+    void (*postread)(int, void *);
+    /*
+     * Called before write, with file type and element as arguments.
+     * May modify the element.  Modifications will be visible to
+     * caller of ef_write() and are written to the file.
+     */
+    void (*prewrite)(int, void *);
 };
 
 struct emptypedstr {