* of the context is freed, which includes memory obtained by calls to
* cf_malloc().
**/
-void cf_free_context(struct cf_context *cc);
+void cf_delete_context(struct cf_context *cc);
/**
* Make the given configuration context current and return the previously
* configuration specified in the file are undone.
**/
int cf_load(const char *file);
+
/**
* Reload configuration from @file, replace the old one.
* If @file is NULL, reload all loaded configuration files and re-apply
* settings are rolled back to the state before calling this function.
**/
int cf_reload(const char *file);
+
/**
* Parse some part of configuration passed in @string.
* The syntax is the same as in the <<config:,configuration file>>.
**/
int cf_close_group(void);
+/**
+ * Return all configuration items to their initial state before loading the
+ * configuration file. If journalling is disabled, it does nothing.
+ **/
+void cf_revert(void);
+
/*** === Data types [[conf_types]] ***/
enum cf_class { /** Class of the configuration item. **/
* If @allow_unknown is set to 0 and a variable not described in @sec
* is found in the configuration file, it produces an error.
* If you set it to 1, all such variables are ignored.
+ *
+ * Please note that a single section definition cannot be used in multiple
+ * configuration contexts simultaneously.
**/
void cf_declare_section(const char *name, struct cf_section *sec, uns allow_unknown);
+/**
+ * Like @cf_declare_section(), but instead of item pointers, the section
+ * contains offsets relative to @ptr. In other words, it does the same
+ * as `CF_SECTION`, but for top-level sections.
+ **/
+void cf_declare_rel_section(const char *name, struct cf_section *sec, void *ptr, uns allow_unknown);
/**
* If you have a section in a structure and you want to initialize it
* (eg. if you want a copy of default values outside the configuration),