summaryrefslogtreecommitdiff
path: root/src/til.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/til.c')
-rw-r--r--src/til.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/til.c b/src/til.c
index 0989a6d..e69cade 100644
--- a/src/til.c
+++ b/src/til.c
@@ -165,12 +165,13 @@ int til_module_create_context(const til_module_t *module, unsigned ticks, void *
/* select module if not yet selected, then setup the module. */
-int til_module_setup(til_settings_t *settings, til_setting_desc_t **next_setting)
+int til_module_setup(til_settings_t *settings, const til_setting_t **res_setting, const til_setting_desc_t **res_desc)
{
+ const til_setting_t *setting;
const til_module_t *module;
const char *name;
- name = til_settings_get_key(settings, 0);
+ name = til_settings_get_key(settings, 0, &setting);
if (!name) {
const char *values[nelems(modules) + 1] = {};
const char *annotations[nelems(modules) + 1] = {};
@@ -189,10 +190,12 @@ int til_module_setup(til_settings_t *settings, til_setting_desc_t **next_setting
.preferred = DEFAULT_MODULE,
.values = values,
.annotations = annotations
- }, next_setting);
+ }, res_desc);
if (r < 0)
return r;
+ *res_setting = name ? setting : NULL;
+
return 1;
}
@@ -201,7 +204,7 @@ int til_module_setup(til_settings_t *settings, til_setting_desc_t **next_setting
return -EINVAL;
if (module->setup)
- return module->setup(settings, next_setting);
+ return module->setup(settings, res_setting, res_desc);
return 0;
}
© All Rights Reserved