summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d03bbb3)
raw | patch | inline | side by side (parent: d03bbb3)
author | Florian Forster <ff@octo.it> | |
Wed, 7 Jul 2010 13:54:01 +0000 (15:54 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 7 Jul 2010 13:54:01 +0000 (15:54 +0200) |
src/graph.c | patch | blob | history | |
src/graph.h | patch | blob | history |
diff --git a/src/graph.c b/src/graph.c
index 49bd765f0ad7a25a0cfcc6c4b6901a2b037842f1..9d435c2385d3096921abeee8be92be5a9bf95f71 100644 (file)
--- a/src/graph.c
+++ b/src/graph.c
return (ident_compare (cfg->select, ident));
} /* }}} int graph_compare */
+int graph_sort_instances (graph_config_t *cfg) /* {{{ */
+{
+ if (cfg == NULL)
+ return (EINVAL);
+
+ if (cfg->instances_num < 2)
+ return (0);
+
+ qsort (cfg->instances, cfg->instances_num, sizeof (*cfg->instances),
+ (void *) ident_compare);
+
+ return (0);
+} /* }}} int graph_sort_instances */
+
int graph_clear_instances (graph_config_t *cfg) /* {{{ */
{
size_t i;
diff --git a/src/graph.h b/src/graph.h
index 2be1a967da77726a55fa2bd3f8b532c378b073bb..26b4ac619bf5975074bbec6721e0629ee2de1b43 100644 (file)
--- a/src/graph.h
+++ b/src/graph.h
int graph_compare (graph_config_t *cfg, const graph_ident_t *ident);
+int graph_sort_instances (graph_config_t *cfg);
+
int graph_clear_instances (graph_config_t *cfg);
int graph_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,