diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2019-11-10 18:49:28 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2019-11-10 18:49:28 -0800 |
commit | 44ec797349713f28314bd329bee940cd55fad411 (patch) | |
tree | 2128c6ba385d4969b30b54259791811df315daf4 /src/settings.h | |
parent | 4b82076cb381f91c1225eb39efa924e935043d8b (diff) |
settings: s/setting_desc_new/setting_desc_clone/
Slight refactor to make call sites less annoying.
Now takes a (setting_desc_t *) instead of the members as discrete
parameters, and returns an errno on error so callers can simply
propagate error codes out rather than having to get access to errno
defines, check for NULL and return -ENOMEM etc.
It also makes the call sites self documenting by employing designated
initializers in compound literals for the supplied setting_desc_t.
This is in prep for runtime-configurable module settings.
Diffstat (limited to 'src/settings.h')
-rw-r--r-- | src/settings.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/settings.h b/src/settings.h index fe35b19..6803d09 100644 --- a/src/settings.h +++ b/src/settings.h @@ -30,7 +30,7 @@ int settings_add_value(settings_t *settings, const char *key, const char *value) char * settings_as_arg(const settings_t *settings); int settings_apply_desc_generators(const settings_t *settings, const setting_desc_generator_t generators[], unsigned n_generators, void *setup_context, setting_desc_t **next_setting); -setting_desc_t * setting_desc_new(const char *name, const char *key, const char *regex, const char *preferred, const char *values[], const char *annotations[]); +int setting_desc_clone(const setting_desc_t *desc, setting_desc_t **res_desc); void setting_desc_free(setting_desc_t *desc); #endif |