#include <stdio.h>
#include <syslog.h>
+#include <urcu/wfcqueue.h>
+
+#include <isc/loop.h>
#include <isc/mem.h>
typedef struct ctx {
// Memory Context
isc_mem_t* memctx;
+
+ // Loop Manager
+ isc_loopmgr_t* loopmgr;
} ctx_t;
static void logger(ctx_t* ctx, int priority, const char* format, ...) {
// Allocate a new memory context
isc_mem_create(&ctx.memctx);
+ // Initialize the loop manager
+ isc_loopmgr_create(ctx.memctx, 1, &ctx.loopmgr);
+
+ // Register a callback to be called when the loop starts
+ isc_loopmgr_setup(ctx.loopmgr, run_loop, &ctx);
+
+ // Run the event loop
+ isc_loopmgr_run(ctx.loopmgr);
+
+ERROR:
+ isc_loopmgr_destroy(&ctx.loopmgr);
+
return 0;
}