From 2e3f68ed879724e2ba980fd6d4cc9ec5fa222501 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 7 May 2017 13:26:54 +0200 Subject: [PATCH] add a config_set_int convenience function. --- src/kernel/config.c | 9 ++++++++- src/kernel/config.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kernel/config.c b/src/kernel/config.c index 02ed9894d..1076e9432 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -782,11 +782,18 @@ void config_set_from(const dictionary *d, const char *valid_keys[]) } } -void config_set(const char *key, const char *value) { +void config_set(const char *key, const char *value) +{ ++config_cache_key; set_param(&configuration, key, value); } +void config_set_int(const char *key, int value) +{ + ++config_cache_key; + set_param(&configuration, key, itoa10(value)); +} + const char *config_get(const char *key) { return get_param(configuration, key); } diff --git a/src/kernel/config.h b/src/kernel/config.h index f80214fde..4cf0650ff 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -121,6 +121,7 @@ extern "C" { void free_params(struct param **pp); void config_set(const char *key, const char *value); + void config_set_int(const char *key, int value); void config_set_from(const struct _dictionary_ *d, const char *keys[]); const char *config_get(const char *key); int config_get_int(const char *key, int def);