- /* 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 element initialization. @elt is the element.
+ * May modify the element.
+ */
+ void (*oninit)(void *elt);
+ /*
+ * Called after read. @id is the element ID, and @elt is the
+ * element read. May modify the element. Modifications are
+ * visible to caller of ef_read(), but have no effect on the file.
+ */
+ void (*postread)(int id, void *elt);
+ /*
+ * Called before write. @id is the element ID, @old is the
+ * element being updated (null unless it is cached) and @elt is
+ * the element being written. May modify the element.
+ * Modifications will be visible to caller of ef_write() and are
+ * written to the file.
+ */
+ void (*prewrite)(int id, void *old, void *elt);
+ /*
+ * Called after table size changed, with file type as argument.
+ */
+ void (*onresize)(int type);