- /* and flags bit EFF_RDONLY */
- /* User callbacks */
- void (*init)(int, char *); /* called after entry creation, unless null */
- int (*postread)(int, char *); /* called after read, unless null */
- int (*prewrite)(int, char *); /* called before write, unless null */
+ /* flags bit EFF_CUSTOM also varies */
+
+ /* 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);
+};
+
+struct ef_typedstr {
+ signed ef_type: 8;
+ unsigned seqno: 12;
+ unsigned generation: 12;
+ int uid;
+ time_t timestamp;