- char *host = NULL;
- char *plugin = NULL;
- char *plugin_instance = NULL;
- char *type = NULL;
- char *type_instance = NULL;
- graph_ident_t *ret;
- int i;
-
- for (i = 0; i < ci->children_num; i++)
- {
- oconfig_item_t *child;
-
- child = ci->children + i;
-
- if (strcasecmp ("Host", child->key) == 0)
- graph_config_get_string (child, &host);
- else if (strcasecmp ("Plugin", child->key) == 0)
- graph_config_get_string (child, &plugin);
- else if (strcasecmp ("PluginInstance", child->key) == 0)
- graph_config_get_string (child, &plugin_instance);
- else if (strcasecmp ("Type", child->key) == 0)
- graph_config_get_string (child, &type);
- else if (strcasecmp ("TypeInstance", child->key) == 0)
- graph_config_get_string (child, &type_instance);
- /* else: ignore all other directives here. */
- } /* for */
-
- ret = ident_create (host, plugin, plugin_instance, type, type_instance);
-
- free (host);
- free (plugin);
- free (plugin_instance);
- free (type);
- free (type_instance);
-
- return (ret);
-} /* }}} int graph_config_get_selector */