ANN PlugInfo* new_plug(MemPool, Vector);
ANN void plug_run(const Gwion gwion, const Vector);
ANN void free_plug(const Gwion gwion);
-
+ANN void* get_module(const Gwion, const m_str);
#define GWIMPORT_NAME import
#define GWMODSTR_NAME gwmodstr
#define GWMODINI_NAME gwmodini
}
}
}
+
+ANN void* get_module(const Gwion gwion, const m_str name) {
+ const Vector v = &gwion->plug->vec[GWPLUG_MODULE];
+ for(m_uint i = 0; i < vector_size(v); ++i) {
+ struct Plug_ *plug = (struct Plug_*)vector_at(v, i);
+ if(!strcmp(name, plug->name))
+ return plug->self;
+ }
+ return NULL;
+}