![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "math/calculator.h"#include "system/atomic.h"#include "common/paths.h"#include "darktable.h"#include "common/file_location.h"#include "math/math.h"#include "common/conf.h"#include <glib.h>#include <glib/gstdio.h>#include <glib/gprintf.h>#include <inttypes.h>#include <stdio.h>#include <stdlib.h>#include <strings.h>#include "common/utility.h"Go to the source code of this file.
Data Structures | |
| struct | dt_conf_dreggn_t |
Macros | |
| #define | LINE_SIZE 1023 |
| #define | CONFIG_DIR "$(config)" |
| #define | HOME_DIR "$(home)" |
Typedefs | |
| typedef struct dt_conf_dreggn_t | dt_conf_dreggn_t |
Functions | |
| static void | _free_confgen_value (void *value) |
| static char * | _dt_conf_get_var_locked (const char *name) |
| static char * | dt_conf_get_var (const char *name) |
| uint64_t | dt_conf_generation (void) |
| A counter that advances whenever a conf value actually changes. | |
| static int | dt_conf_set_if_not_overridden (const char *name, char *str) |
| void | dt_conf_set_int (const char *name, int val) |
| void | dt_conf_set_int64 (const char *name, int64_t val) |
| void | dt_conf_set_float (const char *name, float val) |
| void | dt_conf_set_bool (const char *name, int val) |
| void | dt_conf_set_string (const char *name, const char *val) |
| void | dt_conf_set_folder_from_file_chooser (const char *name, GtkFileChooser *chooser) |
| int | dt_conf_get_int_fast (const char *name) |
Stored integer for name, NOT clamped to its declared bounds. | |
| int | dt_conf_get_int (const char *name) |
Integer for name, clamped to the bounds declared in the XML. | |
| int64_t | dt_conf_get_int64_fast (const char *name) |
Stored 64-bit integer for name, NOT clamped. | |
| int64_t | dt_conf_get_int64 (const char *name) |
64-bit integer for name, clamped to its declared bounds. | |
| float | dt_conf_get_float_fast (const char *name) |
Stored float for name, NOT clamped. | |
| float | dt_conf_get_float (const char *name) |
Float for name, clamped to its declared bounds. | |
| int | dt_conf_get_and_sanitize_int (const char *name, int min, int max) |
| int64_t | dt_conf_get_and_sanitize_int64 (const char *name, int64_t min, int64_t max) |
| float | dt_conf_get_and_sanitize_float (const char *name, float min, float max) |
| int | dt_conf_get_bool (const char *name) |
| gchar * | dt_conf_get_string (const char *name) |
Read the stored string for name as a private copy. | |
| const char * | dt_conf_get_string_const (const char *name) |
Borrow the stored string for name without copying it. | |
| gboolean | dt_conf_key_not_empty (const char *name) |
| gboolean | dt_conf_get_folder_to_file_chooser (const char *name, GtkFileChooser *chooser) |
| gboolean | dt_conf_is_equal (const char *name, const char *value) |
| static char * | _sanitize_confgen (const char *name, const char *value) |
| void | dt_conf_init (dt_conf_t *cf, const char *filename, GSList *override_entries) |
Populate cf from filename and from the generated defaults. | |
| int | dt_conf_key_exists (const char *key) |
Does key have a value? | |
| static void | _conf_add (char *key, char *val, dt_conf_dreggn_t *d) |
| GSList * | dt_conf_all_string_entries (const char *dir) |
Every key under dir, as a list of copies. | |
| void | dt_conf_string_entry_free (gpointer data) |
| Free one dt_conf_string_entry_t. Shaped as a GDestroyNotify so it can be handed to g_slist_free_full(). | |
| gboolean | dt_confgen_exists (const char *name) |
| dt_confgen_type_t | dt_confgen_type (const char *name) |
| gboolean | dt_confgen_value_exists (const char *name, dt_confgen_value_kind_t kind) |
| const char * | dt_confgen_get (const char *name, dt_confgen_value_kind_t kind) |
One declared attribute of name from the generated XML, as text. | |
| const char * | dt_confgen_get_label (const char *name) |
Translated short description of name, borrowed and valid for the process lifetime. NULL when name is not declared. | |
| const char * | dt_confgen_get_tooltip (const char *name) |
Translated long description of name, borrowed and valid for the process lifetime. NULL when name is not declared. | |
| int | dt_confgen_get_int (const char *name, dt_confgen_value_kind_t kind) |
| int64_t | dt_confgen_get_int64 (const char *name, dt_confgen_value_kind_t kind) |
| gboolean | dt_confgen_get_bool (const char *name, dt_confgen_value_kind_t kind) |
| float | dt_confgen_get_float (const char *name, dt_confgen_value_kind_t kind) |
| gboolean | dt_conf_is_default (const char *name) |
Is name still at the value declared in the XML? FALSE for an undeclared key. | |
| gchar * | dt_conf_expand_default_dir (const char *dir) |
| Expand the placeholders in a default directory string. | |
| static int | _conf_save (dt_conf_t *cf) |
Write the whole table to cf->filename. | |
| int | dt_conf_flush (void) |
| Write the settings to their file now. Overridden keys keep their stored value. | |
| void | dt_conf_cleanup (dt_conf_t *cf) |
Free everything cf owns. No dt_conf_*() call is valid afterwards. | |
Variables | |
| static dt_atomic_uint64 | _conf_generation = 1 |
Store str for name unless the command line pinned that key. | |
| #define CONFIG_DIR "$(config)" |
Referenced by dt_conf_expand_default_dir().
| #define HOME_DIR "$(home)" |
Referenced by dt_conf_expand_default_dir().
| #define LINE_SIZE 1023 |
Referenced by dt_conf_init().
| typedef struct dt_conf_dreggn_t dt_conf_dreggn_t |
|
static |
Definition at line 656 of file common/conf.c.
References d, dt_conf_string_entry_t::key, key, and dt_conf_string_entry_t::value.
Referenced by dt_conf_all_string_entries().
|
static |
Write the whole table to cf->filename.
cf->mutex is held for the walk, since every dt_conf_set_*() writes the table under it, and for the write, so that two saves land in the order they read the table.
g_file_set_contents() writes a temporary file and renames it over the old one: a process that dies while saving leaves the previous file, never a truncated one.
Definition at line 960 of file common/conf.c.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), error(), dt_conf_t::filename, key, dt_conf_t::mutex, dt_conf_t::table, and TRUE.
Referenced by dt_conf_cleanup(), and dt_conf_flush().
|
inlinestatic |
same as dt_conf_get_var(), but the caller must already hold darktable.conf->mutex. The returned pointer is only valid for as long as that lock stays held: a concurrent dt_conf_set_*() on the same key can free it (g_hash_table_insert() destroys the old value it replaces) the instant the lock is released. Callers that need the value to survive past the lock (e.g. to compare or duplicate it) must do so before unlocking – see dt_conf_get_string() below for the pattern.
Definition at line 89 of file common/conf.c.
References darktable, dt_confgen_get(), DT_DEFAULT, IS_NULL_PTR, and name.
Referenced by dt_conf_get_string(), and dt_conf_get_var().
Definition at line 71 of file common/conf.c.
References dt_confgen_value_t::def, dt_free, dt_confgen_value_t::enum_values, dt_confgen_value_t::longdesc, dt_confgen_value_t::max, dt_confgen_value_t::min, dt_confgen_value_t::shortdesc, and value.
Referenced by dt_conf_init().
|
static |
Definition at line 495 of file common/conf.c.
References darktable, DT_BOOL, dt_calculator_solve(), dt_confgen_get(), dt_confgen_get_float(), dt_confgen_get_int(), dt_confgen_get_int64(), DT_DEFAULT, DT_ENUM, DT_FLOAT, dt_free, DT_INT, DT_INT64, dt_confgen_value_t::enum_values, IS_NULL_PTR, dt_confgen_value_t::max, max, dt_confgen_value_t::min, min, name, dt_confgen_value_t::type, v, and value.
Referenced by dt_conf_init().
| GSList * dt_conf_all_string_entries | ( | const char * | dir | ) |
Every key under dir, as a list of copies.
get all strings in
Definition at line 668 of file common/conf.c.
References _conf_add(), d, darktable, dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by gui_init().
Free everything cf owns. No dt_conf_*() call is valid afterwards.
Definition at line 991 of file common/conf.c.
References _conf_save(), darktable, dt_pthread_mutex_destroy(), dt_conf_t::override_entries, dt_conf_t::retired_values, dt_conf_t::table, and dt_conf_t::x_confgen.
Referenced by _teardown(), _teardown(), _teardown(), _teardown(), cache_teardown(), and dt_cleanup().
| gchar * dt_conf_expand_default_dir | ( | const char * | dir | ) |
Expand the placeholders in a default directory string.
Definition at line 923 of file common/conf.c.
References CONFIG_DIR, dt_free, dt_loc_get_home_dir(), dt_loc_get_user_config_dir(), DT_PATH_MAX, dt_util_normalize_path(), and HOME_DIR.
| int dt_conf_flush | ( | void | ) |
Write the settings to their file now. Overridden keys keep their stored value.
dt_conf_set_*() writes the in-memory table only: a change is on disk once this, or dt_conf_cleanup(), has run.
Definition at line 986 of file common/conf.c.
References _conf_save(), and darktable.
Referenced by _a_failed_flush_returns_1_and_writes_nothing(), _flush_replaces_the_file_rather_than_rewriting_it(), _flush_writes_what_was_set(), dt_cleanup(), dt_gui_preferences_show(), and dt_opencl_device_init().
A counter that advances whenever a conf value actually changes.
For code on a hot path that would otherwise read conf per call: keep what you derived alongside the generation you derived it at, and re-derive only when the two differ. Every dt_conf_get_* takes the application-wide conf mutex – the same one the GUI thread uses – and dt_conf_get_float additionally runs dt_calculator_solve() over the stored string, so on a pipeline thread this is contention, not arithmetic.
It never goes backwards and starts at 1, so 0 is usable as "nothing cached yet".
NOTE this says the CONFIGURATION changed, not that your derived value did. It is a cache key, never a substitute for folding state into a pipeline hash: a module whose pixels depend on a conf value still owes that value to its cache key (see iop/gamma.c and runtime_data_hash() in iop/iop_api.h), or the pipe serves pixels the key does not describe.
Definition at line 161 of file common/conf.c.
References _conf_generation, and dt_atomic_get_uint64().
Referenced by _the_generation_advances_on_a_change_and_not_otherwise(), and _userpref_cached().
| float dt_conf_get_and_sanitize_float | ( | const char * | name, |
| float | min, | ||
| float | max ) |
Definition at line 433 of file common/conf.c.
References CLAMPS, dt_conf_get_float_fast(), dt_conf_set_float(), dt_confgen_get_float(), DT_MAX, DT_MIN, MAX, max, MIN, min, and name.
Referenced by _circle_sanitize_config(), and _ellipse_sanitize_config().
| int dt_conf_get_and_sanitize_int | ( | const char * | name, |
| int | min, | ||
| int | max ) |
Definition at line 413 of file common/conf.c.
References CLAMPS, dt_conf_get_int_fast(), dt_conf_set_int(), dt_confgen_get_int(), DT_MAX, DT_MIN, MAX, max, MIN, min, and name.
Referenced by _ellipse_sanitize_config().
| int64_t dt_conf_get_and_sanitize_int64 | ( | const char * | name, |
| int64_t | min, | ||
| int64_t | max ) |
Definition at line 423 of file common/conf.c.
References CLAMPS, dt_conf_get_int64_fast(), dt_conf_set_int64(), dt_confgen_get_int64(), DT_MAX, DT_MIN, MAX, max, MIN, min, and name.
| int dt_conf_get_bool | ( | const char * | name | ) |
Definition at line 443 of file common/conf.c.
References dt_conf_get_var(), and name.
Referenced by __attribute__(), _add_mem_section(), _add_sample(), _ask_before_delete_style(), _choose_gpx_callback(), _collect_sorted_tree_names(), _colorspaces_build(), _compute_hud_brush_state(), _configure_tab(), _confirm_pending_import(), _datetime_key_pressed(), _delete_tagids(), _display_offset(), _dt_collection_changed_callback(), _export_button_clicked(), _file_activated(), _fill_input_brush_settings(), _film_import1(), _folder_survey_job_run(), _gui_presets_popup_menu_show_internal(), _history_copy_and_paste_on_image_merge(), _history_paste_apply(), _history_paste_parts_apply(), _history_style_apply(), _image_info_changed(), _init_expansion(), _init_widgets(), _menuitem_delete_preset(), _menuitem_update_preset(), _metadata_view_update_values(), _mipmap_settings_from_conf(), _new_datetime(), _panel_is_visible(), _populate_tree(), _process_file_list(), _refresh_brush_settings_cache(), _refresh_global_picker(), _remove_sample_cb(), _rule_get_recursive(), _seal_opencl_cache_policy(), _selection_changed_callback(), _set_sample_box_area(), _set_sample_point(), _set_test_path(), _setup_selected_images_list(), _show_milliseconds(), _studio_import_update_preview(), _styles_apply_callback(), _styles_ask_callback(), _styles_ask_checked_callback(), _styles_copy_iop_order_callback(), _styles_copy_iop_order_checked_callback(), _timezone_save(), _toggle_suggestion_button_callback(), _toggle_tree_button_callback(), _update_layout(), _variables_get_latitude(), _variables_get_longitude(), _view_map_button_press_callback(), _view_map_collection_changed(), _view_map_draw_main_location(), _view_map_draw_other_locations(), _view_map_show_osd(), _widget_stored_bool(), ask_user_confirmation(), collapse_grouped_callback(), collapse_grouped_checked_callback(), commit_params(), commit_params(), copy_iop_order_callback(), copy_iop_order_checked_callback(), delete_file_from_disk(), delete_history_callback(), dt_collection_get_browsed_folder(), dt_collection_get_property_values(), dt_collection_reset(), dt_collection_serialize(), dt_collection_update_query(), dt_conf_is_default(), dt_control_copy_images(), dt_control_delete_image(), dt_control_delete_images(), dt_control_delete_images_job_run(), dt_control_move_images(), dt_control_remove_images(), dt_dev_init(), dt_drawlayer_conf_ensure_defaults(), dt_drawlayer_conf_load_color_history(), dt_exif_decode_xmp_data(), dt_film_remove_empty(), dt_folder_survey_can_start(), dt_folder_survey_destination_preview(), dt_folder_survey_start(), dt_gui_gtk_init(), dt_gui_load_theme(), dt_gui_merge_options_dialog(), dt_gui_preferences_bool(), dt_gui_preferences_bool_update(), dt_gui_supervisor_window_show(), dt_guides_draw(), dt_guides_update_button_state(), dt_init(), dt_lib_gui_get_expanded(), dt_lib_is_visible(), dt_lib_presets_popup_menu_show(), dt_mask_scroll_increases(), dt_masks_gui_confirm_permanent_delete(), dt_opencl_device_init(), dt_opencl_init(), dt_opencl_update_settings(), dt_privacy_ask_consent(), dt_styles_apply_to_image_merge(), dt_tag_get_list(), dt_thumbtable_new(), dt_ui_restore_panels(), dt_updates_init(), dt_view_manager_switch_by_view(), export_clicked(), get_params(), get_params(), get_params(), group_borders_callback(), group_borders_checked_callback(), gui_cleanup(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_update(), gui_update(), import_clicked(), init(), init_tab_general(), legacy_params(), main(), menuitem_delete_preset(), menuitem_update_preset(), paste_all_callback(), paste_ask_callback(), paste_ask_checked_callback(), paste_parts_callback(), set_format_by_name(), update_preview_cb(), and use_sys_font_callback().
| float dt_conf_get_float | ( | const char * | name | ) |
Float for name, clamped to its declared bounds.
Definition at line 404 of file common/conf.c.
References dt_conf_get_float_fast(), dt_confgen_get_float(), DT_MAX, DT_MIN, max, min, and name.
Referenced by _brush_events_post_expose(), _circle_get_creation_values(), _circle_initial_source_pos(), _conf_softness(), _draw_background(), _ellipse_get_creation_values(), _ellipse_initial_source_pos(), _ellipse_sanitize_config(), _gradient_get_creation_values(), _polygon_events_button_pressed(), _print_size_display(), _resolve_export_size(), _set_params(), _unit_changed(), _view_map_display_selected(), autoset(), button_pressed(), commit_params(), commit_params(), dt_conf_get_sanitize_float(), dt_conf_is_default(), dt_configure_ppd_dpi(), dt_dev_init(), dt_drawlayer_conf_brush_color(), dt_drawlayer_conf_distance(), dt_drawlayer_conf_flow(), dt_drawlayer_conf_hdr_exposure(), dt_drawlayer_conf_load_color_history(), dt_drawlayer_conf_opacity(), dt_drawlayer_conf_size(), dt_drawlayer_conf_smoothing(), dt_drawlayer_conf_sprinkle_coarseness(), dt_drawlayer_conf_sprinkle_size(), dt_drawlayer_conf_sprinkles(), dt_gui_load_theme(), dt_guides_popover(), dt_guides_set_overlay_colors(), dt_guides_update_popover_values(), dt_masks_get_set_conf_value(), dt_masks_group_add_form(), dt_masks_gui_form_save_creation(), get_params(), gui_init(), gui_init(), gui_init(), gui_init(), gui_update(), init_tab_general(), and scrolled().
| float dt_conf_get_float_fast | ( | const char * | name | ) |
Stored float for name, NOT clamped.
Definition at line 374 of file common/conf.c.
References dt_calculator_solve(), dt_conf_get_var(), dt_conf_set_if_not_overridden(), dt_confgen_get(), DT_DEFAULT, dt_free, IS_NULL_PTR, and name.
Referenced by dt_conf_get_and_sanitize_float(), and dt_conf_get_float().
| gboolean dt_conf_get_folder_to_file_chooser | ( | const char * | name, |
| GtkFileChooser * | chooser ) |
Definition at line 478 of file common/conf.c.
References dt_conf_get_string_const(), FALSE, folder, IS_NULL_PTR, name, and TRUE.
Referenced by _choose_gpx_callback(), _edit_preset_response(), _save_clut_callback(), dt_control_copy_images(), dt_control_move_images(), export_clicked(), export_preset(), import_clicked(), import_preset(), and load_xmp_callback().
| int dt_conf_get_int | ( | const char * | name | ) |
Integer for name, clamped to the bounds declared in the XML.
Definition at line 320 of file common/conf.c.
References dt_conf_get_int_fast(), dt_confgen_get_int(), DT_MAX, DT_MIN, max, min, and name.
Referenced by __attribute__(), _active_channel_from_gui(), _active_ring_from_gui(), _build_display_popover(), _collection_folder_ui_inactive(), _colorspaces_build(), _columns_in_action(), _columns_out_action(), _configure_tab(), _database_settings_from_conf(), _dimensions_type(), _dt_collection_changed_callback(), _dt_opencl_get_conf_int(), _ellipse_get_creation_values(), _ensure_print_size_conf(), _export_button_clicked(), _folder_survey_job_run(), _folder_survey_reschedule(), _get_current_tab(), _get_recent_tags_list_length(), _gpu_runtime_crash_streak(), _grid_configure_dims(), _guides_gui_grid(), _history_paste_apply(), _history_paste_parts_apply(), _init_widgets(), _jpg_checked(), _jpg_combobox_changed(), _menuitem_preferences(), _mipmap_settings_from_conf(), _name_editing_done(), _panel_is_visible(), _populate_collect_combo(), _print_button_clicked(), _print_dpi(), _resolve_export_size(), _restore_geometry(), _rule_get_item(), _rule_get_mode(), _rules_count(), _set_params(), _settings_flip_update(), _shape_button_clicked(), _shape_manager_popup_restore_geometry(), _styles_history_append_checked_callback(), _styles_history_prepend_checked_callback(), _styles_history_replace_checked_callback(), _thumb_draw_image(), _thumbs_update_overlays_mode(), _thumbtable_scroll(), _ui_init_panel_left(), _ui_init_panel_size(), _update_layout(), _update_recentcollections(), _validate_dimensions(), _view_map_changed_callback_delayed(), _view_map_display_selected(), _view_map_location_changed(), _widget_stored_int(), _xmp_append_metadata(), always_hide_overlays_checked_callback(), always_show_overlays_checked_callback(), commit_params(), commit_params(), dt_cleanup(), dt_collection_get_browsed_folder(), dt_collection_get_property_values(), dt_collection_load_filmroll(), dt_collection_name(), dt_collection_reset(), dt_collection_serialize(), dt_collection_update_query(), dt_conf_is_default(), dt_dev_get_background_color(), dt_dev_init(), dt_dev_toolbox_apply_iso_12646_size(), dt_drawlayer_conf_brush_mode(), dt_drawlayer_conf_brush_shape(), dt_drawlayer_conf_mapping_profile(), dt_drawlayer_conf_pick_source(), dt_exif_read_blob(), dt_gui_merge_options_dialog(), dt_gui_preferences_int(), dt_gui_preferences_int_update(), dt_gui_preferences_show(), dt_guides_draw(), dt_guides_draw_grid(), dt_guides_popover(), dt_guides_set_overlay_colors(), dt_guides_update_popover_values(), dt_history_style_on_image(), dt_history_style_on_list(), dt_image_film_roll_name(), dt_init(), dt_iop_autoset_module_is_enabled(), dt_iop_gui_init_blending_body(), dt_lib_queue_postponed_update(), dt_metadata_clear(), dt_metadata_set_import(), dt_opencl_apply_scheduling_profile(), dt_opencl_detected_device_enabled(), dt_opencl_detected_device_headroom(), dt_opencl_detected_device_pinned_memory(), dt_opencl_init(), dt_opencl_read_device_config(), dt_opencl_reserve_device_for_pipe(), dt_pthread_create(), dt_tag_get_suggestions(), dt_ui_panel_get_size(), dt_ui_panel_show(), dt_ui_restore_panels(), dt_ui_toggle_panels_visibility(), dt_worker_threads(), enter(), get_params(), get_params(), get_params(), get_params(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_reset(), gui_reset(), gui_update(), gui_update(), history_append_checked_callback(), history_prepend_checked_callback(), history_replace_checked_callback(), hover_overlays_checked_callback(), init(), modify_roi_in(), reload_defaults(), reload_defaults(), set_storage_by_name(), write_image(), write_image(), and xtrans_fdc_interpolate().
| int64_t dt_conf_get_int64 | ( | const char * | name | ) |
64-bit integer for name, clamped to its declared bounds.
Definition at line 365 of file common/conf.c.
References dt_conf_get_int64_fast(), dt_confgen_get_int64(), DT_MAX, DT_MIN, max, min, and name.
Referenced by dt_conf_is_default(), dt_configure_runtime_performance(), dt_opencl_read_device_config(), and dt_updates_init().
| int64_t dt_conf_get_int64_fast | ( | const char * | name | ) |
Stored 64-bit integer for name, NOT clamped.
Definition at line 329 of file common/conf.c.
References dt_calculator_solve(), dt_conf_get_var(), dt_conf_set_if_not_overridden(), dt_confgen_get(), DT_DEFAULT, dt_free, IS_NULL_PTR, and name.
Referenced by dt_conf_get_and_sanitize_int64(), and dt_conf_get_int64().
| int dt_conf_get_int_fast | ( | const char * | name | ) |
Stored integer for name, NOT clamped to its declared bounds.
Definition at line 284 of file common/conf.c.
References dt_calculator_solve(), dt_conf_get_var(), dt_conf_set_if_not_overridden(), dt_confgen_get(), DT_DEFAULT, dt_free, IS_NULL_PTR, and name.
Referenced by _the_generation_advances_on_a_change_and_not_otherwise(), _typed_setters_retire_too(), dt_conf_get_and_sanitize_int(), and dt_conf_get_int().
| gchar * dt_conf_get_string | ( | const char * | name | ) |
Read the stored string for name as a private copy.
The copy is taken while the lock is held, so it cannot race a concurrent dt_conf_set_*() on the same key.
Definition at line 450 of file common/conf.c.
References _dt_conf_get_var_locked(), darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and name.
Referenced by _accels_recent_get(), _apply_filmroll_gpx(), _apply_gpx(), _choose_gpx_callback(), _conf_get_guide(), _configure_slider_blocks(), _database_settings_from_conf(), _dnd_folder_import_job_run(), _export_button_clicked(), _folder_survey_job_run(), _folder_survey_scan(), _folder_survey_styles_for_import(), _guides_add_guide(), _load_selection(), _new_printer_callback(), _print_button_clicked(), _process_file_list(), _rule_get_string(), _save_clut_callback(), _scale_optim(), _set_paper_size(), _set_test_path(), _studio_import_update_state(), _studio_style_load_pool(), _style_callback(), _thumbtable_dnd_import(), _update_recentcollections(), button_clicked(), calculate_clut(), dt_bauhaus_combobox_from_conf(), dt_collection_get_browsed_folder(), dt_collection_reset(), dt_collection_update_query(), dt_exif_xmp_encode(), dt_folder_survey_absorb_new_files(), dt_folder_survey_count_new_files(), dt_folder_survey_destination_preview(), dt_folder_survey_init(), dt_folder_survey_propose_resume(), dt_folder_survey_start(), dt_gui_preferences_enum(), dt_gui_preferences_enum_update(), dt_gui_presets_init(), dt_guides_update_popover_values(), dt_image_xmp_mode_refresh_from_conf(), dt_imageio_is_handled_by_libraw(), dt_init(), dt_install_id(), dt_l10n_init(), dt_lib_export_metadata_get_conf(), dt_opencl_update_priorities(), dt_view_audio_start(), dt_view_image_info_update(), get_params(), gui_init(), gui_init(), gui_init(), gui_reset(), gui_update(), gui_update(), and init_tab_general().
| const char * dt_conf_get_string_const | ( | const char * | name | ) |
Borrow the stored string for name without copying it.
Definition at line 465 of file common/conf.c.
References dt_conf_get_var(), and name.
Referenced by _borrowed_value_survives_being_replaced(), _colorspaces_build(), _configure_tab(), _dt_check_basedir(), _every_displaced_value_stays_readable(), _export_button_clicked(), _export_button_clicked(), _get_brush_smoothing(), _get_max_output_dimension(), _get_pressure_sensitivity(), _import_button_clicked(), _lib_location_search(), _resolve_by_name(), _resolve_export_size(), _rewriting_the_same_value_retires_nothing(), _save_last_tag_used(), _set_params(), _set_printer(), _size_recent_tags_list(), _the_generation_advances_on_a_change_and_not_otherwise(), _thumbnail_change_accel(), _typed_setters_retire_too(), _update(), _update_formats_combobox(), _update_recentcollections(), _updates_worker(), dt_collection_get_property_values(), dt_collection_serialize(), dt_colorspaces_set_display_profile(), dt_conf_get_folder_to_file_chooser(), dt_conf_key_not_empty(), dt_folder_survey_can_start(), dt_gui_gtk_init(), dt_gui_preferences_string(), dt_gui_preferences_string_update(), dt_gui_supervisor_window_show(), dt_imageio_get_format(), dt_imageio_get_storage(), dt_lib_export_metadata_get_conf_flags(), dt_masks_scroll_mapping_get(), dt_opencl_device_init(), dt_opencl_init(), dt_tag_get_suggestions(), enter(), get_params(), get_params(), get_params(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), init(), init_collection_line(), reload_ui_last_theme(), set_params(), set_storage_by_name(), and update_collection_callback().
|
inlinestatic |
return slot for this variable or newly allocated slot.
Definition at line 116 of file common/conf.c.
References _dt_conf_get_var_locked(), darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and name.
Referenced by dt_conf_get_bool(), dt_conf_get_float_fast(), dt_conf_get_int64_fast(), dt_conf_get_int_fast(), dt_conf_get_string_const(), dt_conf_is_default(), and dt_conf_is_equal().
Populate cf from filename and from the generated defaults.
Must run before ANY other dt_conf_*() call: the rest of this API reaches darktable.conf unconditionally.
| cf | storage to initialise, normally darktable.conf. |
| filename | anselrc to read; created from defaults when absent. |
| override_entries | command-line overrides, as dt_conf_string_entry_t. They win over stored values on read and are not written back on save. |
Definition at line 564 of file common/conf.c.
References _free_confgen_value(), _sanitize_confgen(), darktable, dt_confgen_value_t::def, dt_free_gpointer(), dt_pthread_mutex_init(), f, g_free(), IS_NULL_PTR, dt_conf_string_entry_t::key, key, LINE_SIZE, name, dt_conf_t::override_entries, p, dt_conf_t::retired_values, STR, dt_conf_t::table, dt_conf_string_entry_t::value, value, and dt_conf_t::x_confgen.
Referenced by _setup(), _setup(), _setup(), _setup(), cache_setup(), and dt_init().
| gboolean dt_conf_is_default | ( | const char * | name | ) |
Is name still at the value declared in the XML? FALSE for an undeclared key.
Definition at line 891 of file common/conf.c.
References DT_BOOL, dt_conf_get_bool(), dt_conf_get_float(), dt_conf_get_int(), dt_conf_get_int64(), dt_conf_get_var(), dt_confgen_exists(), dt_confgen_get(), dt_confgen_get_bool(), dt_confgen_get_float(), dt_confgen_get_int(), dt_confgen_get_int64(), dt_confgen_type(), DT_DEFAULT, DT_ENUM, DT_FLOAT, DT_INT, DT_INT64, DT_PATH, DT_STRING, name, and TRUE.
| gboolean dt_conf_is_equal | ( | const char * | name, |
| const char * | value ) |
Definition at line 489 of file common/conf.c.
References dt_conf_get_var(), name, and value.
Referenced by commit_params(), and reload_defaults().
| int dt_conf_key_exists | ( | const char * | key | ) |
Does key have a value?
check if key exists, return 1 if lookup succeeded, 0 if failed..
Definition at line 647 of file common/conf.c.
References darktable, dt_confgen_value_exists(), DT_DEFAULT, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), key, and res.
Referenced by _accels_recent_get(), _add_mem_section(), _conf_get_guide(), _dt_collection_changed_callback(), _ensure_print_size_conf(), _guides_gui_grid(), _init_widgets(), _mem_list(), _restore_geometry(), _seal_opencl_cache_policy(), _shape_manager_popup_restore_geometry(), _ui_init_panel_size(), _widget_stored_int(), autoset(), dt_drawlayer_conf_ensure_defaults(), dt_drawlayer_conf_load_color_history(), dt_gui_load_theme(), dt_gui_supervisor_window_show(), dt_guides_draw(), dt_guides_draw_grid(), dt_guides_update_popover_values(), dt_iop_autoset_module_is_enabled(), dt_lib_export_metadata_get_conf(), dt_lib_export_metadata_set_conf(), dt_lib_is_visible(), dt_metadata_init(), dt_opencl_device_init(), dt_opencl_read_device_config(), dt_privacy_ask_consent(), dt_ui_panel_get_size(), dt_ui_restore_panels(), get_params(), gui_init(), gui_update(), and write_image().
| gboolean dt_conf_key_not_empty | ( | const char * | name | ) |
Definition at line 470 of file common/conf.c.
References dt_conf_get_string_const(), FALSE, IS_NULL_PTR, name, and TRUE.
Referenced by _dt_opencl_get_conf_int(), _seal_opencl_cache_policy(), dt_opencl_detected_device_enabled(), dt_opencl_detected_device_headroom(), dt_opencl_detected_device_pinned_memory(), and dt_opencl_read_device_config().
| void dt_conf_set_bool | ( | const char * | name, |
| int | val ) |
Definition at line 237 of file common/conf.c.
References dt_conf_set_if_not_overridden(), dt_free, and name.
Referenced by _attached_view_combo_changed(), _auto_set_illuminant(), _cache_disable_callback(), _callback_bool(), _confirm_pending_import(), _copy_toggled_callback(), _display_extremes_changed(), _display_samples_changed(), _dttags_check_toggled(), _gui_preferences_bool_callback(), _gui_set_single_expanded(), _lock_callback(), _no_uncategorized_toggled(), _on_mem_section_expanded(), _on_record_toggled(), _opencl_disable_callback(), _printer_bpc_callback(), _restrict_histogram_changed(), _rule_set_recursive(), _seal_opencl_cache_policy(), _show_all_button_clicked(), _sort_combo_changed(), _sort_dir_toggled(), _spot_settings_changed_callback(), _store_color_history(), _studio_import_copy_callback(), _studio_import_delete_callback(), _styles_ask_callback(), _styles_copy_iop_order_callback(), _toggle_suggestion_button_callback(), _toggle_tree_button_callback(), _widget_store_bool(), apply_style_to_image(), collapse_grouped_callback(), copy_iop_order_callback(), delete_history_callback(), display_mask_black_and_white_callback(), dt_collection_deserialize(), dt_collection_update(), dt_drawlayer_conf_ensure_defaults(), dt_drawlayer_conf_sync_params_from_gui(), dt_gui_gtk_write_config(), dt_gui_load_theme(), dt_gui_merge_options_dialog(), dt_guides_button_toggled(), dt_lib_gui_set_expanded(), dt_lib_set_visible(), dt_masks_gui_confirm_permanent_delete(), dt_opencl_disable(), dt_opencl_read_device_config(), dt_opencl_set_detected_device_enabled(), dt_privacy_ask_consent(), dt_ui_panel_show(), duplicate_callback(), group_borders_callback(), gui_init(), icc_toggle_callback(), paste_ask_callback(), rotate_toggle_callback(), set_format_by_name(), set_params(), set_params(), tiling_changed(), use_sys_font_callback(), and usercss_callback().
| void dt_conf_set_float | ( | const char * | name, |
| float | val ) |
Definition at line 227 of file common/conf.c.
References dt_conf_set_if_not_overridden(), dt_free, and name.
Referenced by _area_scrolled_callback(), _auto_set_exposure(), _auto_set_illuminant(), _bottom_border_callback(), _ellipse_events_button_released(), _ellipse_events_mouse_moved(), _gradient_sanitize_config(), _grid_size_changed(), _left_border_callback(), _print_size_changed(), _print_size_from_pixels(), _right_border_callback(), _settings_contrast_changed(), _spot_settings_changed_callback(), _spot_settings_changed_callback(), _store_color_history(), _top_border_callback(), _view_map_changed_callback_delayed(), colorpick_color_set(), display_mask_checker_1_callback(), display_mask_checker_2_callback(), dpi_changed_callback(), dpi_scaling_changed_callback(), dt_conf_get_and_sanitize_float(), dt_conf_get_sanitize_float(), dt_dev_cleanup(), dt_drawlayer_conf_apply_brush_color(), dt_drawlayer_conf_ensure_defaults(), dt_drawlayer_conf_sync_params_from_gui(), dt_masks_get_set_conf_value(), font_size_changed_callback(), init_tab_general(), mouse_moved(), rt_masks_form_change_opacity(), safety_changed_callback(), scrolled(), scrolled(), scrolled(), and set_params().
| void dt_conf_set_folder_from_file_chooser | ( | const char * | name, |
| GtkFileChooser * | chooser ) |
Definition at line 255 of file common/conf.c.
References dt_conf_set_if_not_overridden(), dt_free, folder, and name.
Referenced by _choose_gpx_callback(), _edit_preset_response(), _save_clut_callback(), dt_control_copy_images(), dt_control_move_images(), export_clicked(), export_preset(), import_clicked(), import_preset(), and load_xmp_callback().
|
static |
Definition at line 166 of file common/conf.c.
References _conf_generation, darktable, dt_atomic_get_uint64(), dt_atomic_set_uint64(), dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), g_ptr_array_add(), IS_NULL_PTR, and name.
Referenced by dt_conf_get_float_fast(), dt_conf_get_int64_fast(), dt_conf_get_int_fast(), dt_conf_set_bool(), dt_conf_set_float(), dt_conf_set_folder_from_file_chooser(), dt_conf_set_int(), dt_conf_set_int64(), and dt_conf_set_string().
| void dt_conf_set_int | ( | const char * | name, |
| int | val ) |
Definition at line 209 of file common/conf.c.
References dt_conf_set_if_not_overridden(), dt_free, and name.
Referenced by _blendop_blending_notebook_switch(), _channel_tabs_switch_callback(), _channelmixerrgb_mixer_mode_callback(), _channelmixerrgb_reject_mixer_mode(), _colorspaces_destroy(), _columns_in_action(), _columns_out_action(), _confidence_changed(), _control_import_job_run(), _darkroom_change_rendering_size(), _dimensions_type_changed(), _display_borders_callback(), _display_brightness_callback(), _dt_collection_changed_callback(), _ellipse_events_button_released(), _event_aspect_presets_changed(), _folder_levels_changed(), _gpu_runtime_set_crash_streak(), _gradient_events_button_released(), _grid_horizontal_changed(), _grid_subdiv_changed(), _grid_vertical_changed(), _gui_preferences_int_callback(), _height_changed(), _intent_callback(), _intent_changed(), _jpg_combobox_changed(), _lib_collect_gui_update(), _lib_lighttable_columns_slider_changed(), _mem_list(), _menuitem_preferences(), _mixer_mode_callback(), _mouse_scroll(), _on_configure(), _on_tab_switch(), _panel_handle_resize(), _print_dpi_changed(), _printer_intent_callback(), _printer_profile_changed(), _profile_changed(), _profile_changed(), _recent_tags_changed(), _resize_dialog(), _resize_dialog(), _ring_tabs_switch_callback(), _rule_set_item(), _rule_set_mode(), _rules_set_count(), _scope_resize_handle_resize(), _set_columns(), _set_delay(), _set_dimensions(), _set_scope(), _set_stage(), _settings_colors_changed(), _settings_flip_changed(), _shape_button_clicked(), _shape_manager_popup_save_geometry(), _studio_import_conflict_callback(), _studio_import_interval_callback(), _styles_history_append_callback(), _styles_history_prepend_callback(), _styles_history_replace_callback(), _switch_page(), _the_generation_advances_on_a_change_and_not_otherwise(), _thumbtable_scroll(), _typed_setters_retire_too(), _update_point_gui(), _update_recentcollections(), _view_map_changed_callback_delayed(), _view_map_location_changed(), _widget_store_int(), _width_changed(), area_button_press(), aspect_presets_changed(), bit_depth_changed(), bit_depth_changed(), bpp_combobox_changed(), bpp_combobox_changed(), bpp_toggle_callback(), color_mode_changed(), compress_combobox_changed(), compress_level_changed(), compression_changed(), compression_combobox_changed(), compression_level_changed(), compression_toggle_callback(), compression_type_changed(), cropmode_callback(), display_mask_checker_size_callback(), dt_cleanup(), dt_collection_deserialize(), dt_collection_load_filmroll(), dt_collection_update(), dt_conf_get_and_sanitize_int(), dt_dev_cleanup(), dt_drawlayer_conf_ensure_defaults(), dt_drawlayer_conf_sync_params_from_gui(), dt_film_set_query(), dt_gui_gtk_write_config(), dt_gui_merge_options_dialog(), dt_iop_autoset_module_set_enabled(), dt_metadata_init(), dt_opencl_set_detected_device_enabled(), dt_opencl_set_detected_device_headroom(), dt_opencl_set_detected_device_pinned_memory(), dt_opencl_write_device_config(), dt_thumbtable_set_overlays_mode(), dt_ui_panel_show(), dt_ui_toggle_panels_visibility(), format_changed(), get_params(), gui_changed(), gui_cleanup(), gui_cleanup(), gui_init(), gui_init(), gui_reset(), gui_reset(), hint_combobox_changed(), history_append_callback(), history_prepend_callback(), history_replace_callback(), mode_toggle_callback(), onsave_action_toggle_callback(), optimize_changed_callback(), orientation_toggle_callback(), pages_toggle_callback(), preset_changed(), quality_changed(), quality_changed(), quality_changed(), quality_changed(), rt_select_algorithm_callback(), set_params(), set_params(), and shortfile_combobox_changed().
| void dt_conf_set_int64 | ( | const char * | name, |
| int64_t | val ) |
Definition at line 218 of file common/conf.c.
References dt_conf_set_if_not_overridden(), dt_free, and name.
Referenced by dt_conf_get_and_sanitize_int64(), and dt_updates_init().
| void dt_conf_set_string | ( | const char * | name, |
| const char * | val ) |
Definition at line 246 of file common/conf.c.
References dt_conf_set_if_not_overridden(), dt_free, and name.
Referenced by _a_failed_flush_returns_1_and_writes_nothing(), _accels_recent_set(), _base_dir_changed(), _borrowed_value_survives_being_replaced(), _color_mode_changed(), _colorspaces_destroy(), _combobox_conf_value_changed(), _conf_get_guide(), _darkroom_change_mask_rasterization(), _database_renamed(), _dt_check_basedir(), _every_displaced_value_stays_readable(), _export_button_clicked(), _filename_changed(), _flush_replaces_the_file_rather_than_rewriting_it(), _flush_writes_what_was_set(), _gui_preferences_enum_callback(), _gui_preferences_string_callback(), _import_button_clicked(), _insert_default_modules(), _jobcode_changed(), _media_changed(), _on_groupby_changed(), _on_page_changed(), _paper_changed(), _printer_profile_changed(), _profile_changed(), _profile_changed(), _project_dir_changed(), _rewriting_the_same_value_retires_nothing(), _rule_get_string(), _rule_set_string(), _save_last_tag_used(), _save_preferences(), _save_selection(), _scale_changed(), _scale_optim(), _set_paper_size(), _set_params(), _set_printer(), _set_stage(), _settings_guides_changed(), _setup(), _size_recent_tags_list(), _sort_by_changed(), _statistic_changed(), _studio_import_base_folder_callback(), _studio_import_datetime_callback(), _studio_import_file_pattern_callback(), _studio_import_jobcode_callback(), _studio_import_source_folder_callback(), _studio_import_subfolder_callback(), _studio_style_save(), _style_callback(), _style_changed(), _the_generation_advances_on_a_change_and_not_otherwise(), _thumbnail_change_accel(), _timezone_save(), _unit_changed(), _update_directory(), _update_recentcollections(), _view_map_set_map_source(), border_changed_callback(), checker_changed_callback(), checker_color_changed_callback(), dt_collection_deserialize(), dt_collection_load_filmroll(), dt_collection_update(), dt_dev_init_default_history(), dt_film_set_query(), dt_folder_survey_init(), dt_folder_survey_start(), dt_gui_load_theme(), dt_gui_presets_init(), dt_guides_update_popover_values(), dt_image_xmp_mode_refresh_from_conf(), dt_install_id(), dt_lib_export_metadata_set_conf(), dt_lib_presets_apply(), dt_masks_scroll_mapping_set(), dt_opencl_device_init(), entry_changed_callback(), entry_changed_callback(), fontsel_callback(), gui_init(), gui_reset(), init(), language_callback(), leave(), set_format_by_name(), set_params(), set_params(), set_params(), set_storage_by_name(), set_visible_widgets(), text_callback(), title_changed_callback(), and title_changed_callback().
| void dt_conf_string_entry_free | ( | gpointer | data | ) |
Free one dt_conf_string_entry_t. Shaped as a GDestroyNotify so it can be handed to g_slist_free_full().
Definition at line 679 of file common/conf.c.
References data, dt_free, dt_conf_string_entry_t::key, and dt_conf_string_entry_t::value.
Referenced by gui_init().
| gboolean dt_confgen_exists | ( | const char * | name | ) |
Definition at line 689 of file common/conf.c.
References darktable, and name.
Referenced by dt_conf_is_default().
| const char * dt_confgen_get | ( | const char * | name, |
| dt_confgen_value_kind_t | kind ) |
One declared attribute of name from the generated XML, as text.
| kind | which attribute: default, min, max, or the enum's value list. |
name or kind is not declared. Do NOT free it. Unlike dt_conf_get_string_const(), this one is safe to hold: the confgen table is built once at init and never mutated, which is also why these readers take no lock. Definition at line 724 of file common/conf.c.
References darktable, dt_confgen_value_t::def, DT_DEFAULT, DT_MAX, DT_MIN, DT_VALUES, dt_confgen_value_t::enum_values, IS_NULL_PTR, kind, dt_confgen_value_t::max, dt_confgen_value_t::min, and name.
Referenced by _dt_conf_get_var_locked(), _sanitize_confgen(), _set_params(), dt_bauhaus_combobox_from_conf(), dt_conf_get_float_fast(), dt_conf_get_int64_fast(), dt_conf_get_int_fast(), dt_conf_is_default(), dt_confgen_get_bool(), dt_confgen_get_float(), dt_confgen_get_int(), dt_confgen_get_int64(), dt_gui_preferences_enum(), dt_gui_preferences_enum_reset(), dt_gui_preferences_string_reset(), gui_reset(), and gui_reset().
| gboolean dt_confgen_get_bool | ( | const char * | name, |
| dt_confgen_value_kind_t | kind ) |
Definition at line 846 of file common/conf.c.
References dt_confgen_get(), kind, and name.
Referenced by dt_conf_is_default(), dt_gui_preferences_bool_reset(), gui_reset(), and gui_reset().
| float dt_confgen_get_float | ( | const char * | name, |
| dt_confgen_value_kind_t | kind ) |
Definition at line 852 of file common/conf.c.
References dt_calculator_solve(), dt_confgen_get(), dt_confgen_value_exists(), DT_MAX, DT_MIN, kind, name, and value.
Referenced by _sanitize_confgen(), dt_conf_get_and_sanitize_float(), dt_conf_get_float(), and dt_conf_is_default().
| int dt_confgen_get_int | ( | const char * | name, |
| dt_confgen_value_kind_t | kind ) |
Definition at line 770 of file common/conf.c.
References dt_calculator_solve(), dt_confgen_get(), dt_confgen_value_exists(), DT_MAX, DT_MIN, kind, name, and value.
Referenced by _dimensions_type_changed(), _sanitize_confgen(), dt_conf_get_and_sanitize_int(), dt_conf_get_int(), dt_conf_is_default(), dt_gui_preferences_int(), dt_gui_preferences_int_reset(), gui_init(), gui_reset(), gui_reset(), and gui_reset().
| int64_t dt_confgen_get_int64 | ( | const char * | name, |
| dt_confgen_value_kind_t | kind ) |
Definition at line 808 of file common/conf.c.
References dt_calculator_solve(), dt_confgen_get(), dt_confgen_value_exists(), DT_MAX, DT_MIN, kind, name, and value.
Referenced by _sanitize_confgen(), dt_conf_get_and_sanitize_int64(), dt_conf_get_int64(), and dt_conf_is_default().
| const char * dt_confgen_get_label | ( | const char * | name | ) |
Translated short description of name, borrowed and valid for the process lifetime. NULL when name is not declared.
Definition at line 746 of file common/conf.c.
References darktable, IS_NULL_PTR, name, and dt_confgen_value_t::shortdesc.
Referenced by dt_bauhaus_combobox_from_conf(), dt_gui_preferences_bool(), dt_gui_preferences_enum(), dt_gui_preferences_int(), dt_gui_preferences_string(), and gui_init().
| const char * dt_confgen_get_tooltip | ( | const char * | name | ) |
Translated long description of name, borrowed and valid for the process lifetime. NULL when name is not declared.
Definition at line 758 of file common/conf.c.
References darktable, IS_NULL_PTR, dt_confgen_value_t::longdesc, and name.
Referenced by dt_bauhaus_combobox_from_conf(), dt_gui_preferences_bool(), dt_gui_preferences_enum(), dt_gui_preferences_int(), dt_gui_preferences_string(), and gui_init().
| dt_confgen_type_t dt_confgen_type | ( | const char * | name | ) |
Definition at line 694 of file common/conf.c.
References darktable, DT_STRING, IS_NULL_PTR, name, and dt_confgen_value_t::type.
Referenced by dt_bauhaus_combobox_from_conf(), and dt_conf_is_default().
| gboolean dt_confgen_value_exists | ( | const char * | name, |
| dt_confgen_value_kind_t | kind ) |
Definition at line 704 of file common/conf.c.
References darktable, dt_confgen_value_t::def, DT_DEFAULT, DT_MAX, DT_MIN, DT_VALUES, dt_confgen_value_t::enum_values, FALSE, IS_NULL_PTR, kind, dt_confgen_value_t::max, dt_confgen_value_t::min, and name.
Referenced by dt_bauhaus_combobox_from_conf(), dt_conf_key_exists(), dt_confgen_get_float(), dt_confgen_get_int(), and dt_confgen_get_int64().
|
static |
Store str for name unless the command line pinned that key.
This is the ONLY writer that can replace an existing value while the application is running – the two inserts in _dt_conf_get_var_locked() only fire when the key is absent, and the two in dt_conf_init() run before any reader exists.
That makes it the one place where dt_conf_get_string_const()'s borrowed pointer could be pulled out from under a reader. It used to be: g_hash_table_insert() destroys the value it replaces, and the table's value_destroy_func is a free. A reader that had taken the pointer and released the lock – which dt_conf_get_var() does before returning – was then reading freed memory. Rather than free the old value here, we RETIRE it: it is moved to darktable.conf->retired_values and released only at dt_conf_cleanup(). A stale read is possible where a use-after-free was; the pointer itself stays valid for the process lifetime.
Retiring only happens when the value actually CHANGES. Writing a key back with the value it already holds – which GUI state saving does constantly – stores nothing and retires nothing, so the retired list grows with real edits and not with idle churn.
| name | key to write. |
| str | the value. Ownership TRANSFERS to this function only when it returns 0. |
str and must free it.** Definition at line 159 of file common/conf.c.
Referenced by dt_conf_generation(), and dt_conf_set_if_not_overridden().