![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
The whole configuration state. One instance lives at darktable.conf. More...
#include <conf.h>
Collaboration diagram for dt_conf_t:Data Fields | |
| dt_pthread_mutex_t | mutex |
| char | filename [DT_PATH_MAX] |
| GHashTable * | table |
| GHashTable * | x_confgen |
| GHashTable * | override_entries |
| GPtrArray * | retired_values |
The whole configuration state. One instance lives at darktable.conf.
Every dt_conf_*() call below reaches it through that global and dereferences it WITHOUT checking, so dt_conf_init() must have run before any of them. There is no "conf not ready" return value; calling early is a NULL dereference.
The two hash tables have opposite lifetimes, and that difference decides which returned pointers are safe to hold:
| char dt_conf_t::filename[DT_PATH_MAX] |
Absolute path of the anselrc this instance loads from and saves to.
Definition at line 103 of file conf.h.
Referenced by dt_conf_init(), dt_conf_save(), update_modelines.modelines_updater_t::load_lines(), update_modelines.modelines_updater_t::remove_lines(), update_modelines.modelines_updater_t::update(), and update_modelines.modelines_updater_t::write_file().
| dt_pthread_mutex_t dt_conf_t::mutex |
Guards table and override_entries. Not needed for x_confgen.
Definition at line 101 of file conf.h.
Referenced by dt_conf_all_string_entries(), dt_conf_cleanup(), dt_conf_get_string(), dt_conf_get_var(), dt_conf_init(), dt_conf_key_exists(), and dt_conf_set_if_not_overridden().
| GHashTable* dt_conf_t::override_entries |
Keys forced on the command line; they win over table on read. Written once by dt_conf_init() and read-only afterwards, so pointers into it are stable.
Definition at line 110 of file conf.h.
Referenced by _dt_conf_get_var_locked(), dt_conf_cleanup(), dt_conf_init(), dt_conf_key_exists(), and dt_conf_set_if_not_overridden().
| GPtrArray* dt_conf_t::retired_values |
Values displaced by a later write, kept alive until dt_conf_cleanup(). dt_conf_get_string_const() borrows pointers into table and its readers hold them without the lock, so a replaced value cannot be freed at the moment it is replaced. Grows only when a key's value actually changes.
Definition at line 115 of file conf.h.
Referenced by dt_conf_cleanup(), dt_conf_init(), and dt_conf_set_if_not_overridden().
| GHashTable* dt_conf_t::table |
Live key -> value strings, user-writable. Values are replaced and freed at runtime.
Definition at line 105 of file conf.h.
Referenced by _dt_conf_get_var_locked(), dt_conf_all_string_entries(), dt_conf_cleanup(), dt_conf_init(), dt_conf_key_exists(), dt_conf_save(), and dt_conf_set_if_not_overridden().
| GHashTable* dt_conf_t::x_confgen |
Defaults, bounds and descriptions from the generated XML. Immutable after init.
Definition at line 107 of file conf.h.
Referenced by _sanitize_confgen(), dt_conf_cleanup(), dt_conf_init(), dt_confgen_exists(), dt_confgen_get(), dt_confgen_get_label(), dt_confgen_get_tooltip(), dt_confgen_type(), and dt_confgen_value_exists().