forked from github/server
add a config_set_int convenience function.
This commit is contained in:
parent
9d5369ff1e
commit
2e3f68ed87
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue