rename mana_plugin_t -> mana_sink_plugin_t
This commit is contained in:
parent
714e0c4f3a
commit
ee10c7ce70
6 changed files with 13 additions and 13 deletions
|
@ -63,11 +63,11 @@ extern "C"
|
||||||
mana_end_run_t *end_run;
|
mana_end_run_t *end_run;
|
||||||
mana_process_event_t *process_event;
|
mana_process_event_t *process_event;
|
||||||
mana_process_system_event_t *process_system_event;
|
mana_process_system_event_t *process_system_event;
|
||||||
} mana_plugin_t;
|
} mana_sink_plugin_t;
|
||||||
|
|
||||||
// plugins need to define this function with the name 'mana_get_plugin'
|
// plugins need to define this function with the name 'mana_get_sink_plugin'
|
||||||
#define MANA_DEFINE_GET_PLUGIN(name) mana_plugin_t name()
|
#define MANA_DEFINE_GET_PLUGIN(name) mana_sink_plugin_t name()
|
||||||
typedef MANA_DEFINE_GET_PLUGIN(mana_get_plugin_t);
|
typedef MANA_DEFINE_GET_PLUGIN(mana_get_sink_plugin_t);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,13 +148,13 @@ class IManaSink
|
||||||
IManaSink &operator=(const IManaSink &) = delete;
|
IManaSink &operator=(const IManaSink &) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
// wraps a mana_api.h mana_plugin_t instance
|
// wraps a mana_api.h mana_sink_plugin_t instance
|
||||||
struct ManaCSink: public IManaSink
|
struct ManaCSink: public IManaSink
|
||||||
{
|
{
|
||||||
mana_plugin_t plugin_;
|
mana_sink_plugin_t plugin_;
|
||||||
void *context_ = nullptr;
|
void *context_ = nullptr;
|
||||||
|
|
||||||
explicit ManaCSink(mana_plugin_t plugin)
|
explicit ManaCSink(mana_sink_plugin_t plugin)
|
||||||
: plugin_(plugin)
|
: plugin_(plugin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,9 @@ MANA_DEFINE_PLUGIN_SYSTEM_EVENT(process_system_event)
|
||||||
log_debug("system_event: ctx=%p, size=%zu", context, size);
|
log_debug("system_event: ctx=%p, size=%zu", context, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
MANA_DEFINE_GET_PLUGIN(mana_get_plugin)
|
MANA_DEFINE_GET_PLUGIN(mana_get_sink_plugin)
|
||||||
{
|
{
|
||||||
mana_plugin_t plugin;
|
mana_sink_plugin_t plugin;
|
||||||
plugin.init = init;
|
plugin.init = init;
|
||||||
plugin.shutdown = shutdown;
|
plugin.shutdown = shutdown;
|
||||||
plugin.begin_run = begin_run;
|
plugin.begin_run = begin_run;
|
||||||
|
|
|
@ -97,7 +97,7 @@ MANA_DEFINE_PLUGIN_SYSTEM_EVENT(process_system_event)
|
||||||
|
|
||||||
extern "C" MANA_DEFINE_GET_PLUGIN(mana_get_plugin)
|
extern "C" MANA_DEFINE_GET_PLUGIN(mana_get_plugin)
|
||||||
{
|
{
|
||||||
mana_plugin_t plugin;
|
mana_sink_plugin_t plugin;
|
||||||
plugin.init = init;
|
plugin.init = init;
|
||||||
plugin.shutdown = shutdown;
|
plugin.shutdown = shutdown;
|
||||||
plugin.begin_run = begin_run;
|
plugin.begin_run = begin_run;
|
||||||
|
|
|
@ -215,9 +215,9 @@ MANA_DEFINE_PLUGIN_SYSTEM_EVENT(process_system_event)
|
||||||
log_trace("system_event: ctx=%p, size=%zu", context, size);
|
log_trace("system_event: ctx=%p, size=%zu", context, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" MANA_DEFINE_GET_PLUGIN(mana_get_plugin)
|
extern "C" MANA_DEFINE_GET_PLUGIN(mana_get_sink_plugin)
|
||||||
{
|
{
|
||||||
mana_plugin_t plugin;
|
mana_sink_plugin_t plugin;
|
||||||
plugin.init = init;
|
plugin.init = init;
|
||||||
plugin.shutdown = shutdown;
|
plugin.shutdown = shutdown;
|
||||||
plugin.begin_run = begin_run;
|
plugin.begin_run = begin_run;
|
||||||
|
|
|
@ -423,7 +423,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
pluginHandle = boost::dll::shared_library(pluginFile);
|
pluginHandle = boost::dll::shared_library(pluginFile);
|
||||||
manaPlugin = std::make_unique<mana::ManaCSink>(
|
manaPlugin = std::make_unique<mana::ManaCSink>(
|
||||||
pluginHandle.get<mana_plugin_t()>("mana_get_plugin")());
|
pluginHandle.get<mana_sink_plugin_t()>("mana_get_sink_plugin")());
|
||||||
}
|
}
|
||||||
catch (const std::exception &e)
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue