#include "internal/mana_c_api.h" #include "internal/rxi/log.h" #include #include struct Context { }; MANA_DEFINE_PLUGIN_INIT(init) { log_set_level(LOG_INFO); struct Context *ctx = calloc(1, sizeof(*ctx)); log_info("init: ctx=%p", ctx); return ctx; } MANA_DEFINE_PLUGIN_SHUTDOWN(shutdown) { log_info("shutdown: ctx=%p", context); free(context); } MANA_DEFINE_PLUGIN_BEGIN_RUN(begin_run) { (void)descriptor_json; log_info("begin_run: ctx=%p", context); /* pretty useless as the json needs to be parsed back into some c structure describing the input */ } MANA_DEFINE_PLUGIN_END_RUN(end_run) { (void)descriptor_json; log_info("end: ctx=%p", context); } MANA_DEFINE_PLUGIN_EVENT_DATA(process_event) { log_trace("event: ctx=%p, eventIndex=%d, arrayCount=%zu, totalBytes=%zu", context, eventIndex, arrayCount, totalBytes); } MANA_DEFINE_PLUGIN_SYSTEM_EVENT(process_system_event) { log_debug("system_event: ctx=%p, size=%zu", context, size); } MANA_C_SINK_PLUGIN() { mana_sink_plugin_t plugin; plugin.init = init; plugin.shutdown = shutdown; plugin.begin_run = begin_run; plugin.end_run = end_run; plugin.process_event = process_event; plugin.process_system_event = process_system_event; return plugin; }