summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-05 16:27:31 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-05 16:27:31 +0200
commitcf87432e410cbe2ee61e90b8f4c2e8d2a75f09ca (patch)
tree73a38b16215515ce7d3cd87b9f8ccfb55e22e885 /config.h
parentdb66484c4300f5f0e857eff01d15fd3593002a79 (diff)
Split config into generic and dir watching parts
Diffstat (limited to 'config.h')
-rw-r--r--config.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/config.h b/config.h
index c70c6ef..30be385 100644
--- a/config.h
+++ b/config.h
@@ -1,12 +1,29 @@
#ifndef fooconfighfoo
#define fooconfighfoo
-void scfg_monitor_dir(struct cfg *cfg);
+enum cfg_value_type {
+ CFG_VAL_TYPE_INVALID,
+ CFG_VAL_TYPE_STRING,
+ CFG_VAL_TYPE_UINT16,
+ CFG_VAL_TYPE_ADDRS,
+};
-void inotify_refdump(struct inotify_ev *iev);
+struct cfg_key_value_map {
+ const char *key_name;
+ int key_value;
+ enum cfg_value_type value_type;
+};
-void scfg_stop_monitor_dir(struct cfg *cfg);
+union cfg_value {
+ const char *str;
+ uint16_t uint16;
+ struct list_head addr_list; /* FIXME: addrs */
+};
-void scfg_read_all(struct cfg *cfg);
+bool config_parse_line(struct cfg *cfg, char **buf,
+ struct cfg_key_value_map *kvmap,
+ int *key, union cfg_value *value);
+
+bool config_parse_header(struct cfg *cfg, const char *title, char **buf);
#endif