+int gl_instance_get_ident (graph_instance_t *inst, /* {{{ */
+ char *buffer, size_t buffer_size)
+{
+ if ((inst == NULL) || (buffer == NULL) || (buffer_size < 1))
+ return (EINVAL);
+
+ snprintf (buffer, buffer_size, "%s/%s-%s/%s-%s",
+ inst->select.host,
+ inst->select.plugin, inst->select.plugin_instance,
+ inst->select.type, inst->select.type_instance);
+ buffer[buffer_size - 1] = 0;
+
+ return (0);
+} /* }}} int gl_instance_get_ident */
+
+int gl_graph_get_all (gl_cfg_callback callback, /* {{{ */
+ void *user_data)
+{
+ graph_config_t *cfg;
+
+ if (callback == NULL)
+ return (EINVAL);
+
+ for (cfg = graph_config_head; cfg != NULL; cfg = cfg->next)
+ {
+ int status;
+
+ status = (*callback) (cfg, user_data);
+ if (status != 0)
+ return (status);
+ }
+
+ return (0);
+} /* }}} int gl_graph_get_all */
+
+int gl_graph_instance_get_all (graph_config_t *cfg,
+ gl_inst_callback callback, void *user_data)
+{
+ graph_instance_t *inst;
+
+ if ((cfg == NULL) || (callback == NULL))
+ return (EINVAL);
+
+ for (inst = cfg->instances; inst != NULL; inst = inst->next)
+ {
+ int status;
+
+ status = (*callback) (cfg, inst, user_data);
+ if (status != 0)
+ return (status);
+ }
+
+ return (0);
+} /* }}} int gl_graph_instance_get_all */
+
+int gl_instance_get_all (gl_inst_callback callback, /* {{{ */
+ void *user_data)
+{
+ graph_config_t *cfg;
+
+ for (cfg = graph_config_head; cfg != NULL; cfg = cfg->next)
+ {
+ graph_instance_t *inst;
+
+ for (inst = cfg->instances; inst != NULL; inst = inst->next)
+ {
+ int status;
+
+ status = (*callback) (cfg, inst, user_data);
+ if (status != 0)
+ return (status);
+ }
+ }
+
+ return (0);
+} /* }}} int gl_instance_get_all */
+