]> git.ipfire.org Git - collecty.git/commitdiff
daemon: Add function to fetch all modules
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Oct 2025 08:56:14 +0000 (08:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Oct 2025 08:56:14 +0000 (08:56 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/daemon.c
src/daemon/daemon.h

index c3eabe42b5ecf81ab3f1edd79271c38a941b5ba6..43adb4db480a814e631976acc32177e83deefe05 100644 (file)
@@ -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);
index ffb42172e7615f0a03a5c50b30c90e688307dae3..6505c62e0f9eb468746e922e2d40b6d17d603893 100644 (file)
@@ -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);