diff --git a/src/util/configuration.c b/src/util/configuration.c index 25ec06150..cc94789f9 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -83,6 +83,17 @@ void ConfigurationSetFloatValue(struct Configuration* configuration, const char* ConfigurationSetValue(configuration, section, key, charValue); } +void ConfigurationClearValue(struct Configuration* configuration, const char* section, const char* key) { + struct Table* currentSection = &configuration->root; + if (section) { + currentSection = HashTableLookup(&configuration->sections, section); + if (!currentSection) { + return; + } + } + HashTableRemove(currentSection, key); +} + const char* ConfigurationGetValue(const struct Configuration* configuration, const char* section, const char* key) { const struct Table* currentSection = &configuration->root; if (section) { diff --git a/src/util/configuration.h b/src/util/configuration.h index e97c1c399..098b143a9 100644 --- a/src/util/configuration.h +++ b/src/util/configuration.h @@ -25,6 +25,8 @@ void ConfigurationSetFloatValue(struct Configuration*, const char* section, cons const char* ConfigurationGetValue(const struct Configuration*, const char* section, const char* key); +void ConfigurationClearValue(struct Configuration*, const char* section, const char* key); + bool ConfigurationRead(struct Configuration*, const char* path); bool ConfigurationWrite(const struct Configuration*, const char* path); bool ConfigurationWriteSection(const struct Configuration*, const char* path, const char* section);