summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2019-11-20 12:50:20 -0800
committerVito Caputo <vcaputo@pengaru.com>2019-11-20 12:50:20 -0800
commit7a77cc1a7c6c05c6623d78b5a895f2f004ba6cf9 (patch)
treecc9f2aca03f8d7e72c3742cab8a1af6032a6ace5 /src/settings.h
parent2ab8f3c6a74f308a0909ff2963fe4216832e2f32 (diff)
settings: add setting_desc_t.random() method
To facilitate random setting of these flexible string-oriented settings, support a random helper supplied with the description. This helper would return a valid random string to be used with the respective setting being described. Immediate use case is the rtv module, which also gets fixed up to use it in this commit.
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/settings.h b/src/settings.h
index 198f8b6..af47326 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -11,6 +11,7 @@ typedef struct setting_desc_t {
const char *preferred; /* if there's a default, this is it */
const char **values; /* if a set of values is provided, listed here */
const char **annotations; /* if a set of values is provided, annotations for those values may be listed here */
+ char * (*random)(void);/* if set, returns a valid random value for this setting */
} setting_desc_t;
/* For conveniently representing setting description generators */
© All Rights Reserved