ConfigFile: add enum ConfigOption

Look up top-level config options by enum (= integer), not by name
string.
This commit is contained in:
Max Kellermann
2013-01-30 17:52:51 +01:00
parent daa4647712
commit 595b6a4f6c
16 changed files with 278 additions and 197 deletions

View File

@@ -57,7 +57,10 @@ int main(int argc, char **argv)
return 1;
}
const char *value = config_get_string(name, NULL);
ConfigOption option = ParseConfigOptionName(name);
const char *value = option != CONF_MAX
? config_get_string(option, nullptr)
: nullptr;
int ret;
if (value != NULL) {
g_print("%s\n", value);