X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=graph.c;h=154af77915f198f3525d788317fabdde6f6462bb;hb=af2ed61b280e1ec169aba2bcb9df30ac76b006d2;hp=c09248297c3bfbbad7ae381590a256287133e37f;hpb=beb1cb55ddc89ad2e8bfd31ecf1e5cf39e73204a;p=collection4.git diff --git a/graph.c b/graph.c index c092482..154af77 100644 --- a/graph.c +++ b/graph.c @@ -183,7 +183,7 @@ int graph_add_file (graph_config_t *cfg, const graph_ident_t *file) /* {{{ */ return (inst_add_file (inst, file)); } /* }}} int graph_add_file */ -int gl_graph_get_title (graph_config_t *cfg, /* {{{ */ +int graph_get_title (graph_config_t *cfg, /* {{{ */ char *buffer, size_t buffer_size) { if ((cfg == NULL) || (buffer == NULL) || (buffer_size < 1)) @@ -199,7 +199,7 @@ int gl_graph_get_title (graph_config_t *cfg, /* {{{ */ buffer[buffer_size - 1] = 0; return (0); -} /* }}} int gl_graph_get_title */ +} /* }}} int graph_get_title */ graph_ident_t *graph_get_selector (graph_config_t *cfg) /* {{{ */ { @@ -266,4 +266,25 @@ int graph_clear_instances (graph_config_t *cfg) /* {{{ */ return (0); } /* }}} int graph_clear_instances */ +int graph_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst, /* {{{ */ + str_array_t *args) +{ + if ((cfg == NULL) || (inst == NULL) || (args == NULL)) + return (EINVAL); + + if (cfg->title != NULL) + { + array_append (args, "-t"); + array_append (args, cfg->title); + } + + if (cfg->vertical_label != NULL) + { + array_append (args, "-v"); + array_append (args, cfg->vertical_label); + } + + return (0); +} /* }}} int graph_get_rrdargs */ + /* vim: set sw=2 sts=2 et fdm=marker : */