56#include <glib/gstdio.h>
57#include <glib/gprintf.h>
445 const int val = (
str[0] ==
'T') || (
str[0] ==
't');
577#define LINE_SIZE 1023
596 char *end = line +
strlen(line);
598 while(*c !=
'=' && c < end) c++;
625 const char *
name = (
const char *)
key;
842 return (int64_t)
value;
925#define CONFIG_DIR "$(config)"
926#define HOME_DIR "$(home)"
964 const gchar *
key = (
const gchar *)
iter->data;
982 cf->retired_values =
NULL;
uint64_t dt_atomic_get_uint64(const dt_atomic_uint64 *var)
void dt_atomic_set_uint64(dt_atomic_uint64 *var, uint64_t value)
float dt_calculator_solve(const float x, const char *formula)
static const dt_adaptation_t kind
static const float const float const float min
void dt_conf_cleanup(dt_conf_t *cf)
Free everything cf owns. No dt_conf_*() call is valid afterwards.
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(...
void dt_conf_set_bool(const char *name, int val)
int dt_conf_get_bool(const char *name)
int dt_conf_key_exists(const char *key)
Does key have a value?
float dt_confgen_get_float(const char *name, dt_confgen_value_kind_t kind)
int64_t dt_conf_get_int64_fast(const char *name)
Stored 64-bit integer for name, NOT clamped.
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.
void dt_conf_set_float(const char *name, float val)
float dt_conf_get_float(const char *name)
Float for name, clamped to its declared bounds.
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 n...
uint64_t dt_conf_generation(void)
A counter that advances whenever a conf value actually changes.
static void _conf_add(char *key, char *val, dt_conf_dreggn_t *d)
static int dt_conf_set_if_not_overridden(const char *name, char *str)
gchar * dt_conf_get_string(const char *name)
Read the stored string for name as a private copy.
int dt_conf_get_int_fast(const char *name)
Stored integer for name, NOT clamped to its declared bounds.
int dt_conf_get_and_sanitize_int(const char *name, int min, int max)
static void _free_confgen_value(void *value)
void dt_conf_set_int(const char *name, int val)
gboolean dt_confgen_get_bool(const char *name, dt_confgen_value_kind_t kind)
void dt_conf_set_int64(const char *name, int64_t val)
gchar * dt_conf_expand_default_dir(const char *dir)
Expand the placeholders in a default directory string.
GSList * dt_conf_all_string_entries(const char *dir)
Every key under dir, as a list of copies.
gboolean dt_conf_is_default(const char *name)
Is name still at the value declared in the XML? FALSE for an undeclared key.
static char * _dt_conf_get_var_locked(const char *name)
static dt_atomic_uint64 _conf_generation
Store str for name unless the command line pinned that key.
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(const char *name)
64-bit integer for name, clamped to its declared bounds.
gboolean dt_confgen_value_exists(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_exists(const char *name)
int dt_confgen_get_int(const char *name, dt_confgen_value_kind_t kind)
void dt_conf_set_string(const char *name, const char *val)
float dt_conf_get_float_fast(const char *name)
Stored float for name, NOT clamped.
const char * dt_conf_get_string_const(const char *name)
Borrow the stored string for name without copying it.
static char * dt_conf_get_var(const char *name)
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.
void dt_conf_save(dt_conf_t *cf)
Write cf back to its file. Overridden keys keep their stored value.
int64_t dt_conf_get_and_sanitize_int64(const char *name, int64_t min, int64_t max)
void dt_conf_set_folder_from_file_chooser(const char *name, GtkFileChooser *chooser)
dt_confgen_type_t dt_confgen_type(const char *name)
static void dt_conf_print(const gchar *key, const gchar *val, FILE *f)
gboolean dt_conf_is_equal(const char *name, const char *value)
const char * dt_confgen_get_label(const char *name)
Translated short description of name, borrowed and valid for the process lifetime....
gboolean dt_conf_get_folder_to_file_chooser(const char *name, GtkFileChooser *chooser)
float dt_conf_get_and_sanitize_float(const char *name, float min, float max)
gboolean dt_conf_key_not_empty(const char *name)
GtkWidget * folder
destination folder chooser
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
Initialise a mutex. With mutexattr NULL – which is how 54 of the 56 call sites in this tree spell it ...
static int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex)
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
gchar * dt_loc_get_home_dir(const gchar *user)
void dt_loc_get_user_config_dir(char *configdir, size_t bufsize)
#define STR(x)
Stringify x after macro-expanding it, e.g. STR(LINE) gives "42".
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static void dt_free_gpointer(gpointer ptr)
g_free() one pointer, with the signature GDestroyNotify wants.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define DT_PATH_MAX
Buffer size for a filesystem path anywhere in Ansel.
static const dt_aligned_pixel_simd_t value
unsigned __int64 uint64_t
One key/value pair handed back by dt_conf_all_string_entries().
The whole configuration state. One instance lives at darktable.conf.
GHashTable * override_entries
GPtrArray * retired_values
char filename[DT_PATH_MAX]
gchar * dt_util_normalize_path(const gchar *_input)