summaryrefslogtreecommitdiff
path: root/src/til_settings.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-05-09 17:15:19 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-05-11 15:19:25 -0700
commit80905545cdd85536191486b8fe2095686d197f58 (patch)
tree586212fbbdceea65aa471b50dd7dc3fd48ad1346 /src/til_settings.h
parent40feb616242c4e29395659ff1873c9fa35b31dcd (diff)
til_settings: helper for labeling positional instances
When there's a bare-value setting turned into a nested settings instance, there's no key onhand for labeling the instance. But such nameless settings are basically array elements only positionally accessed. This helper produces labels in that style for such settings by taking the container settings label and adding [$idx] to the end. These labels aren't really used as more than a debugging aid at the moment. But module contexts already have paths in main, and it seems like these settings instance labels will likely become the name components in constructing those paths.
Diffstat (limited to 'src/til_settings.h')
-rw-r--r--src/til_settings.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/til_settings.h b/src/til_settings.h
index a2dacb8..0998f93 100644
--- a/src/til_settings.h
+++ b/src/til_settings.h
@@ -55,6 +55,7 @@ int til_settings_apply_desc_generators(const til_settings_t *settings, const til
int til_setting_desc_new(const til_settings_t *settings, const til_setting_spec_t *spec, const til_setting_desc_t **res_desc);
til_setting_desc_t * til_setting_desc_free(const til_setting_desc_t *desc);
int til_setting_spec_check(const til_setting_spec_t *spec, const char *value);
+int til_settings_label_setting(const til_settings_t *settings, const til_setting_t *setting, char **res_label);
#ifndef TIL_SETTINGS_STR
#define _TIL_SETTINGS_STR(s) #s
© All Rights Reserved