aboutsummaryrefslogtreecommitdiff
path: root/src/lib/subsys/subsys.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/subsys/subsys.h')
-rw-r--r--src/lib/subsys/subsys.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/subsys/subsys.h b/src/lib/subsys/subsys.h
index 1cb3fe94a5..29a90c049d 100644
--- a/src/lib/subsys/subsys.h
+++ b/src/lib/subsys/subsys.h
@@ -101,6 +101,35 @@ typedef struct subsys_fns_t {
**/
const struct config_format_t *state_format;
+ /**
+ * Receive an options object as defined by options_format. Return 0
+ * on success, -1 on failure.
+ *
+ * It is safe to store the pointer to the object until set_options()
+ * is called again. */
+ int (*set_options)(void *);
+
+ /* XXXX Add an implementation for options_act_reversible() later in this
+ * branch. */
+
+ /**
+ * Receive a state object as defined by state_format. Return 0 on success,
+ * -1 on failure.
+ *
+ * It is safe to store the pointer to the object; set_state() is only
+ * called on startup.
+ **/
+ int (*set_state)(void *);
+
+ /**
+ * Update any information that needs to be stored in the provided state
+ * object (as defined by state_format). Return 0 on success, -1 on failure.
+ *
+ * The object provided here will be the same one as provided earlier to
+ * set_state(). This method is called when we are about to save the state
+ * to disk.
+ **/
+ int (*flush_state)(void *);
} subsys_fns_t;
/**