From: Michael Tremer Date: Thu, 2 Oct 2025 08:56:14 +0000 (+0000) Subject: daemon: Add function to fetch all modules X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=039f0c9b239ed5ed15a4d3c0c5c4bc5027ad0f2d;p=collecty.git daemon: Add function to fetch all modules Signed-off-by: Michael Tremer --- diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index c3eabe4..43adb4d 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c @@ -261,6 +261,13 @@ sd_event* collecty_daemon_loop(collecty_daemon* self) { return sd_event_ref(self->loop); } +collecty_modules* collecty_daemon_get_modules(collecty_daemon* self) { + if (self->modules) + return collecty_modules_ref(self->modules); + + return NULL; +} + collecty_graphs* collecty_daemon_get_graphs(collecty_daemon* self) { if (self->graphs) return collecty_graphs_ref(self->graphs); diff --git a/src/daemon/daemon.h b/src/daemon/daemon.h index ffb4217..6505c62 100644 --- a/src/daemon/daemon.h +++ b/src/daemon/daemon.h @@ -29,6 +29,7 @@ typedef struct collecty_daemon collecty_daemon; #include "ctx.h" #include "graphs.h" #include "module.h" +#include "modules.h" int collecty_daemon_create(collecty_daemon** daemon, collecty_ctx* ctx); @@ -36,6 +37,7 @@ collecty_daemon* collecty_daemon_ref(collecty_daemon* daemon); collecty_daemon* collecty_daemon_unref(collecty_daemon* daemon); sd_event* collecty_daemon_loop(collecty_daemon* self); +collecty_modules* collecty_daemon_get_modules(collecty_daemon* self); collecty_graphs* collecty_daemon_get_graphs(collecty_daemon* self); int collecty_daemon_run(collecty_daemon* self);