// Log action
DEBUG(self->ctx, "Rendering %s...\n", collecty_graph_get_name(self));
+ // Fail if we don't have a render function
+ if (!self->impl->render)
+ return -ENOTSUP;
+
// Open a file handle to the output buffer
f = open_memstream(buffer, length);
if (!f) {
if (r < 0)
goto ERROR;
- // XXX TODO Fill this with content
+ // Call the implementation to add some arguments
+ r = self->impl->render(self->ctx, self, args);
+ if (r < 0)
+ goto ERROR;
// Dump the command
r = collecty_args_dump(args);
typedef struct collecty_graph collecty_graph;
+#include "args.h"
#include "ctx.h"
#include "daemon.h"
+#include "graph.h"
typedef struct collecty_graph_impl {
const char* name;
// Available
int (*available)(collecty_ctx* ctx, collecty_daemon* daemon);
+
+ // Render!
+ int (*render)(collecty_ctx* ctx, collecty_graph* graph, collecty_args* args);
} collecty_graph_impl;
int collecty_graph_create(collecty_graph** graph,