22 #ifndef __BG_CFG_REGISTRY_H_
23 #define __BG_CFG_REGISTRY_H_
25 #include <gmerlin/parameter.h>
326 const char * gettext_domain,
327 const char * gettext_directory);
409 const char * name,
int value);
419 const char * name,
float value);
429 const char * name,
const char * value);
452 const char * name,
int * value);
463 const char * name,
float * value);
474 const char * name,
const char ** value);
505 void * callback_data);
521 void * callback_data);
539 void * callback_data);
bg_cfg_section_t * bg_cfg_section_find_subsection_by_index(bg_cfg_section_t *section, int index)
Find a child of a section by index.
void bg_cfg_section_destroy(bg_cfg_section_t *section)
Destroy a config section.
void bg_cfg_section_set_parameter_int(bg_cfg_section_t *section, const char *name, int value)
Store an integer value in a section.
bg_cfg_section_t * bg_cfg_section_copy(const bg_cfg_section_t *src)
Duplicate a configuration section.
bg_cfg_section_t * bg_cfg_section_create_from_parameters(const char *name, const bg_parameter_info_t *parameters)
Create a config section from a parameter array.
void bg_cfg_registry_save(bg_cfg_registry_t *reg, const char *filename)
Save a configuration registry to an xml-file.
struct bg_cfg_section_s bg_cfg_section_t
Configuration section.
Definition: cfg_registry.h:59
void bg_cfg_section_move_child(bg_cfg_section_t *section, bg_cfg_section_t *child, int pos)
Move a subsection to the specified position.
void bg_cfg_section_apply_noterminate(bg_cfg_section_t *section, const bg_parameter_info_t *infos, bg_set_parameter_func_t func, void *callback_data)
Send all parameters to a module without terminating.
void bg_cfg_section_transfer_children(bg_cfg_section_t *src, bg_cfg_section_t *dst)
Like bg_cfg_section_transfer but acts only on the subsections.
void bg_cfg_section_delete_subsections(bg_cfg_section_t *section)
Delete all subsections.
void bg_cfg_section_get_parameter(bg_cfg_section_t *section, const bg_parameter_info_t *info, bg_parameter_value_t *value)
Read a value from the section.
void bg_cfg_section_set_parameter_time(bg_cfg_section_t *section, const char *name, gavl_time_t value)
Store a time value in a section.
void bg_cfg_section_delete_subsection(bg_cfg_section_t *section, bg_cfg_section_t *subsection)
Delete a subsection.
void bg_cfg_registry_destroy(bg_cfg_registry_t *reg)
Destroy configuration registry and free all associated memory.
bg_cfg_section_t * bg_cfg_section_create(const char *name)
Create an empty config section.
void bg_cfg_section_set_parameter_string(bg_cfg_section_t *section, const char *name, const char *value)
Store a string value in a section.
int bg_cfg_section_get_parameter_time(bg_cfg_section_t *section, const char *name, gavl_time_t *value)
Get an time value from a section.
bg_cfg_section_t * bg_cfg_registry_find_section(bg_cfg_registry_t *reg, const char *path)
Find a section in the registry.
int bg_cfg_section_get_parameter_int(bg_cfg_section_t *section, const char *name, int *value)
Get an integer value from a section.
void bg_cfg_section_restore_defaults(bg_cfg_section_t *section, const bg_parameter_info_t *info)
Restore default values of a section.
void bg_cfg_section_get(bg_cfg_section_t *section, const bg_parameter_info_t *parameters, bg_get_parameter_func_t func, void *callback_data)
Get parameters from a module.
bg_cfg_section_t * bg_cfg_section_find_subsection(bg_cfg_section_t *section, const char *name)
Find a child of a section.
Parmeter description.
Definition: parameter.h:134
int(* bg_get_parameter_func_t)(void *data, const char *name, bg_parameter_value_t *v)
Generic prototype for getting parameters from a module.
Definition: parameter.h:221
void bg_cfg_section_create_items(bg_cfg_section_t *section, const bg_parameter_info_t *parameters)
Create items from a parameter info.
int bg_cfg_section_set_parameters_from_string(bg_cfg_section_t *section, const bg_parameter_info_t *info, const char *str)
Set values from an option string.
void(* bg_set_parameter_func_t)(void *data, const char *name, const bg_parameter_value_t *v)
Generic prototype for setting parameters in a module.
Definition: parameter.h:205
int bg_cfg_section_get_parameter_string(bg_cfg_section_t *section, const char *name, const char **value)
Get an string value from a section.
void bg_cfg_section_dump(bg_cfg_section_t *section, const char *filename)
Dump a config section to a file.
void bg_cfg_section_transfer(bg_cfg_section_t *src, bg_cfg_section_t *dst)
Set values in a configuration section from another section.
void bg_cfg_section_add_ref(bg_cfg_section_t *section, bg_cfg_section_t *ref)
Insert a reference to a section as child.
bg_cfg_section_t * bg_cfg_section_create_subsection_at_pos(bg_cfg_section_t *section, int pos)
Create a subsection at the specified position.
struct bg_cfg_registry_s bg_cfg_registry_t
Configuration registry.
Definition: cfg_registry.h:67
bg_cfg_registry_t * bg_cfg_registry_create()
Create an empty configuration registry.
Container for a parameter value.
Definition: parameter.h:82
int bg_cfg_section_has_subsection(bg_cfg_section_t *section, const char *name)
Qurey if a child section is available.
void bg_cfg_registry_load(bg_cfg_registry_t *reg, const char *filename)
Load a configuration registry from an xml- file.
const char * bg_cfg_section_get_name(bg_cfg_section_t *section)
Get the name of a configuration section.
void bg_cfg_section_set_parameter_float(bg_cfg_section_t *section, const char *name, float value)
Store a float value in a section.
void bg_cfg_section_apply(bg_cfg_section_t *section, const bg_parameter_info_t *parameters, bg_set_parameter_func_t func, void *callback_data)
Send all parameters to a module.
void bg_cfg_section_set_name(bg_cfg_section_t *section, const char *name, const char *gettext_domain, const char *gettext_directory)
Set the name of a configuration section.
int bg_cfg_section_get_parameter_float(bg_cfg_section_t *section, const char *name, float *value)
Get an float value from a section.
void bg_cfg_xml_2_section(xmlDocPtr xml_doc, xmlNodePtr xml_section, bg_cfg_section_t *section)
Convert libxml2 node into a configuration section.
int bg_cfg_registry_has_section(bg_cfg_registry_t *reg, const char *name)
Check if a registry has a section.
char * bg_cfg_section_get_name_translated(bg_cfg_section_t *section)
Get the translated name of a configuration section.
void bg_cfg_section_set_parameter(bg_cfg_section_t *section, const bg_parameter_info_t *info, const bg_parameter_value_t *value)
Store a value in the section.
void bg_cfg_section_2_xml(const bg_cfg_section_t *section, xmlNodePtr xml_section)
Convert a configuration section into a libxml2 node.