summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1177068)
raw | patch | inline | side by side (parent: 1177068)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 27 Feb 2007 21:02:51 +0000 (22:02 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 27 Feb 2007 21:02:51 +0000 (22:02 +0100) |
src/configfile.c | patch | blob | history |
diff --git a/src/configfile.c b/src/configfile.c
index 6aafc56946879ee1aa04a31fd4c867f0cbf44ddd..a8f902fd20823f80283375b739e3563915b9a3c5 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
/*
* Prototypes of callback functions
*/
-static int dispatch_value_pidfile (const oconfig_item_t *ci);
static int dispatch_value_plugindir (const oconfig_item_t *ci);
static int dispatch_value_loadplugin (const oconfig_item_t *ci);
static cf_value_map_t cf_value_map[] =
{
- {"PIDFile", dispatch_value_pidfile},
{"PluginDir", dispatch_value_plugindir},
{"LoadPlugin", dispatch_value_loadplugin}
};
DBG ("return (%i)", ret);
return (ret);
-}
+} /* int cf_dispatch */
-static int dispatch_value_pidfile (const oconfig_item_t *ci)
+static int dispatch_global_option (const oconfig_item_t *ci)
{
- assert (strcasecmp (ci->key, "PIDFile") == 0);
-
if (ci->values_num != 1)
return (-1);
if (ci->values[0].type != OCONFIG_TYPE_STRING)
return (-1);
- return (global_option_set ("PIDFile", ci->values[0].value.string));
+ return (global_option_set (ci->key, ci->values[0].value.string));
}
static int dispatch_value_plugindir (const oconfig_item_t *ci)
break;
}
+ for (i = 0; i < cf_global_options_num; i++)
+ if (strcasecmp (cf_global_options[i].key, ci->key) == 0)
+ {
+ ret = dispatch_global_option (ci);
+ break;
+ }
+
return (ret);
} /* int dispatch_value */