nw_config* nw_config_unref(nw_config* config);
int nw_config_destroy(nw_config* config);
+int nw_config_copy(nw_config* config, nw_config** copy);
const char* nw_config_path(nw_config* config);
int nw_config_get_bool(nw_config* config, const char* key);
int nw_config_set_bool(nw_config* config, const char* key, const int value);
+/*
+ Options
+*/
+
+int nw_config_options_read(nw_config* config);
+int nw_config_options_write(nw_config* config);
+
+typedef int (*nw_config_option_read_callback_t)
+ (nw_config* config, const char* key, void* value);
+typedef int (*nw_config_option_write_callback_t)
+ (nw_config* config, const char* key, const void* value);
+
+int nw_config_option_add(nw_config* config, const char* key, void* value,
+ nw_config_option_read_callback_t read_callback,
+ nw_config_option_write_callback_t write_callback);
+
+#define NW_CONFIG_OPTION(config, key, data, read_callback, write_callback) \
+ nw_config_option_add(config, key, data, read_callback, write_callback)
+
+#define NW_CONFIG_OPTION_STRING(config, key, value) \
+ nw_config_option_add(config, key, value, nw_config_read_string, nw_config_write_string)
+
+int nw_config_read_string(nw_config* config, const char* key, void* value);
+int nw_config_write_string(nw_config* config, const char* key, const void* value);
+
+#define NW_CONFIG_OPTION_INT(config, key, value) \
+ nw_config_option_add(config, key, value, nw_config_read_int, nw_config_write_int)
+
+int nw_config_read_int(nw_config* config, const char* key, void* value);
+int nw_config_write_int(nw_config* config, const char* key, const void* value);
+
+#define NW_CONFIG_OPTION_ADDRESS(config, key, value) \
+ nw_config_option_add(config, key, value, nw_config_read_address, nw_config_write_address)
+
+int nw_config_read_address(nw_config* config, const char* key, void* value);
+int nw_config_write_address(nw_config* config, const char* key, const void* value);
+
#endif /* NETWORKD_CONFIG_H */