From: Michael Tremer Date: Thu, 2 Oct 2025 19:24:20 +0000 (+0000) Subject: graphs: Add a struct with further rendering options X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=081d2af07cef2279ee4c0aa800af6dd23309c57f;p=telemetry.git graphs: Add a struct with further rendering options Signed-off-by: Michael Tremer --- diff --git a/src/daemon/graph-bus.c b/src/daemon/graph-bus.c index f610fe3..c5f51b3 100644 --- a/src/daemon/graph-bus.c +++ b/src/daemon/graph-bus.c @@ -96,6 +96,7 @@ ERROR: } static int collecty_graph_bus_render(sd_bus_message* m, void* data, sd_bus_error* error) { + collecty_graph_render_options options = {}; collecty_graph* graph = data; sd_bus_message* reply = NULL; const char* object = NULL; @@ -113,7 +114,7 @@ static int collecty_graph_bus_render(sd_bus_message* m, void* data, sd_bus_error object = NULL; // Render the graph - r = collecty_graph_render(graph, object, &buffer, &length); + r = collecty_graph_render(graph, object, &options, &buffer, &length); if (r < 0) goto ERROR; diff --git a/src/daemon/graph.c b/src/daemon/graph.c index d227d1e..5da89e2 100644 --- a/src/daemon/graph.c +++ b/src/daemon/graph.c @@ -167,8 +167,8 @@ ERROR: return r; } -int collecty_graph_render(collecty_graph* self, - const char* object, char** buffer, size_t* length) { +int collecty_graph_render(collecty_graph* self, const char* object, + const collecty_graph_render_options* options, char** buffer, size_t* length) { collecty_args* args = NULL; char** data = NULL; FILE* f = NULL; diff --git a/src/daemon/graph.h b/src/daemon/graph.h index 37a7f49..968e48c 100644 --- a/src/daemon/graph.h +++ b/src/daemon/graph.h @@ -51,7 +51,11 @@ char* collecty_graph_get_bus_path(collecty_graph* self); int collecty_graph_require_module(collecty_graph* self, collecty_args* args, const char* name, const char* object); -int collecty_graph_render(collecty_graph* self, - const char* object, char** buffer, size_t* length); +typedef struct collecty_graph_render_options { + // XXX TODO +} collecty_graph_render_options; + +int collecty_graph_render(collecty_graph* self, const char* object, + const collecty_graph_render_options* options, char** buffer, size_t* length); #endif /* COLLECTY_GRAPH_H */