summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c3
-rw-r--r--src/modules/checkers/checkers.c1
-rw-r--r--src/modules/compose/compose.c3
-rw-r--r--src/til.c3
-rw-r--r--src/til_settings.c1
-rw-r--r--src/til_settings.h1
6 files changed, 10 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index f291221..f87a29b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -105,7 +105,8 @@ static int setup_video(const til_settings_t *settings, til_setting_t **res_setti
.regex = "[a-z]+",
.preferred = DEFAULT_VIDEO,
.values = values,
- .annotations = NULL
+ .annotations = NULL,
+ .as_label = 1,
}, res_desc);
if (r < 0)
diff --git a/src/modules/checkers/checkers.c b/src/modules/checkers/checkers.c
index 6371665..f13727e 100644
--- a/src/modules/checkers/checkers.c
+++ b/src/modules/checkers/checkers.c
@@ -544,6 +544,7 @@ static int checkers_setup(const til_settings_t *settings, til_setting_t **res_se
&(til_setting_spec_t){
.name = "Filled cell module name",
.preferred = "none",
+ .as_label = 1,
},
res_desc);
if (r < 0)
diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c
index 3e9ab2c..19f5867 100644
--- a/src/modules/compose/compose.c
+++ b/src/modules/compose/compose.c
@@ -375,6 +375,7 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set
&(til_setting_spec_t){
.name = "Layer module name",
.preferred = "none",
+ .as_label = 1,
}, res_desc);
if (r < 0)
return r;
@@ -402,6 +403,7 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set
.annotations = NULL,
.values = texture_values,
.as_nested_settings = 1,
+ .as_label = 1,
},
&texture,
res_setting,
@@ -421,6 +423,7 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set
/* this is basically just to get the .as_label */
.name = "Texture module name",
.preferred = "none",
+ .as_label = 1,
},
res_desc);
if (r < 0)
diff --git a/src/til.c b/src/til.c
index 3b51e24..d006c08 100644
--- a/src/til.c
+++ b/src/til.c
@@ -294,7 +294,8 @@ int til_module_setup(const til_settings_t *settings, til_setting_t **res_setting
.regex = "[a-zA-Z0-9]+",
.preferred = DEFAULT_MODULE,
.values = values,
- .annotations = annotations
+ .annotations = annotations,
+ .as_label = 1
}, res_desc);
if (r < 0)
return r;
diff --git a/src/til_settings.c b/src/til_settings.c
index 0a1a3d5..e42aae8 100644
--- a/src/til_settings.c
+++ b/src/til_settings.c
@@ -405,6 +405,7 @@ int til_setting_desc_new(const til_settings_t *settings, const til_setting_spec_
d->spec.random = spec->random;
d->spec.as_nested_settings = spec->as_nested_settings;
+ d->spec.as_label = spec->as_label;
/* TODO: handle allocation errors above... */
*res_desc = d;
diff --git a/src/til_settings.h b/src/til_settings.h
index e86f06e..2e2afe9 100644
--- a/src/til_settings.h
+++ b/src/til_settings.h
@@ -17,6 +17,7 @@ typedef struct til_setting_spec_t {
const char **annotations; /* if a set of values is provided, annotations for those values may be listed here */
char * (*random)(unsigned seed);/* if set, returns a valid random value for this setting */
unsigned as_nested_settings:1; /* if set, this setting expects a settings string for its value and wants a til_setting_t.value_as_nested_settings instance created for it */
+ unsigned as_label:1; /* if set, this setting's value is to be used as a label component in path construction - only applies to the first setting entry in an instance (til_settings_t.entries[0]) */
} til_setting_spec_t;
/* a setting_desc is a setting_spec that's been described to a specific containing settings instance via desc_new(), though desc_new() takes a const settings it's cast away when placed into the allocated desc. */
© All Rights Reserved