/*
* 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 */