add a config_set_int convenience function.

This commit is contained in:
Enno Rehling 2017-05-07 13:26:54 +02:00
parent 9d5369ff1e
commit 2e3f68ed87
2 changed files with 9 additions and 1 deletions

View File

@ -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);
}

View File

@ -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);