From 595b6a4f6c2a6f12fb2b3c83f4053942844ffa84 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Jan 2013 17:52:51 +0100 Subject: ConfigFile: add enum ConfigOption Look up top-level config options by enum (= integer), not by name string. --- test/read_conf.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/read_conf.cxx') diff --git a/test/read_conf.cxx b/test/read_conf.cxx index a9135d892..8759398da 100644 --- a/test/read_conf.cxx +++ b/test/read_conf.cxx @@ -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); -- cgit v1.2.3