X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fparser-conf.c;h=88e96b7bee9e149d8e0cc58f93a156b9779c7193;hp=14f847d7b31ec8ba00ebdef89b0727c53de81a38;hb=ae0ba68f475ae5b057aad6538765bc8702134b9a;hpb=fa6b8cb1d5e9e586370631b879a36cdf49110504 diff --git a/discover/parser-conf.c b/discover/parser-conf.c index 14f847d..88e96b7 100644 --- a/discover/parser-conf.c +++ b/discover/parser-conf.c @@ -120,6 +120,18 @@ int conf_param_in_list(const char *const *list, const char *param) return 0; } +/** + * conf_init_global_options - Zero the global option table. + */ + +void conf_init_global_options(struct conf_context *conf) +{ + int i; + + for (i = 0; conf->global_options[i].name; i++) + conf->global_options[i].value = NULL; +} + /** * conf_set_global_option - Set a value in the global option table. * @@ -136,7 +148,7 @@ int conf_set_global_option(struct conf_context *conf, const char *name, if (streq(name, conf->global_options[i].name)) { conf->global_options[i].value = talloc_strdup(conf, value); - pb_log("%s: %s:%s\n", __func__, name, value); + pb_log("%s: @%s@%s@\n", __func__, name, value); return 1; } } @@ -158,8 +170,11 @@ const char *conf_get_global_option(struct conf_context *conf, int i; for (i = 0; conf->global_options[i].name ;i++) - if (streq(name, conf->global_options[i].name)) + if (streq(name, conf->global_options[i].name)) { + pb_log("%s: @%s@%s@\n", __func__, name, + conf->global_options[i].value); return conf->global_options[i].value; + } assert(0 && "unknown global name"); return NULL;