- graph_create_from_file (file);
-
- return (0);
-} /* }}} int register_file */
-
-static int FIXME_graph_create_from_file (const char *host, /* {{{ */
- const char *plugin, const char *plugin_instance,
- const char *type, const char *type_instance,
- const char *title)
-{
- graph_config_t *cfg;
-
- cfg = malloc (sizeof (*cfg));
- if (cfg == NULL)
- return (ENOMEM);
- memset (cfg, 0, sizeof (*cfg));
-
- cfg->select = ident_create (host, plugin, plugin_instance, type, type_instance);
-
- cfg->title = NULL;
- if (title != NULL)
- cfg->title = strdup (title);
- cfg->vertical_label = NULL;
- cfg->instances = NULL;
- cfg->next = NULL;
-
- graph_append (cfg);
-
- return (0);
-} /* }}} int FIXME_graph_create_from_file */
-
-/* FIXME: Actually read the config file here. */
-static int read_graph_config (void) /* {{{ */
-{
- if (graph_config_head != NULL)
- return (0);
-
- FIXME_graph_create_from_file (ANY_TOKEN, "cpu", ANY_TOKEN, "cpu", ALL_TOKEN,
- "CPU {instance} usage");
- FIXME_graph_create_from_file (ANY_TOKEN, "memory", "", "memory", ALL_TOKEN,
- "Memory usage");
- FIXME_graph_create_from_file (ANY_TOKEN, "swap", "", "swap", ALL_TOKEN,
- "Swap");
- FIXME_graph_create_from_file (ANY_TOKEN, ANY_TOKEN, ANY_TOKEN, "ps_state", ALL_TOKEN,
- "Processes");
- FIXME_graph_create_from_file (ANY_TOKEN, "cpu", ALL_TOKEN, "cpu", "idle",
- "CPU idle overview");
-
- return (0);
-} /* }}} int read_graph_config */
-
-static void gl_clear (void) /* {{{ */
-{
- graph_config_t *cfg;
-
- cfg = graph_config_head;
- graph_config_head = NULL;
- graph_destroy (cfg);
-
- gl_last_update = 0;
-} /* }}} void gl_clear */
-
-static int callback_type (const char *type, void *user_data) /* {{{ */
-{
- gl_ident_stage_t *gl;
- graph_ident_t *ident;
- int status;
-
- if ((type == NULL) || (user_data == NULL))
- return (EINVAL);
-
- gl = user_data;
- if ((gl->type != NULL) || (gl->type_instance != NULL))
- return (EINVAL);
-
- gl->type = strdup (type);
- if (gl->type == NULL)
- return (ENOMEM);
-
- gl->type_instance = strchr (gl->type, '-');
- if (gl->type_instance != NULL)
- {
- *gl->type_instance = 0;
- gl->type_instance++;
- }
- else
- {
- gl->type_instance = gl->type + strlen (gl->type);
- }
-
- ident = ident_create (gl->host,
- gl->plugin, gl->plugin_instance,
- gl->type, gl->type_instance);
- if (ident == 0)