ANN m_bool plug_ini(const struct Gwion_ *, const Vector);
ANN m_bool driver_ini(const struct Gwion_ *);
-ANN void plug_run(const struct Gwion_ *, const Map);
+ANN m_bool plug_run(const struct Gwion_ *, const Map);
ANN void free_plug(const Gwion);
ANN void * get_module(const struct Gwion_ *, const m_str);
ANN void set_module(const struct Gwion_ *gwion, const m_str name,
CHECK_BB(plug_ini(gwion, &arg->lib));
shreduler_set_loop(gwion->vm->shreduler, arg->loop);
if (gwion_audio(gwion) > 0) {
- plug_run(gwion, &arg->mod);
+ CHECK_BB(plug_run(gwion, &arg->mod));
if (type_engine_init(gwion)) {
vector_add(&gwion->data->plugs->vec, (m_uint)gwion->env->global_nspc);
gwion->vm->cleaner_shred = gwion_cleaner(gwion);
map_set(map, (m_uint)name, (m_uint)plug);
}
-ANN void plug_run(const struct Gwion_ *gwion, const Map mod) {
+ANN m_bool plug_run(const struct Gwion_ *gwion, const Map mod) {
const Map map = &gwion->data->plugs->map;
for (m_uint i = 0; i < map_size(mod); ++i) {
const m_str name = (m_str)VKEY(mod, i);
const m_str opt = (m_str)VVAL(mod, i);
- for (m_uint j = 0; j < map_size(map); ++j) {
+ m_uint j;
+ for (j = 0; j < map_size(map); ++j) {
if (!strcmp(name, (m_str)VKEY(map, j))) {
Plug plug = (Plug)VVAL(map, j);
const Vector arg = opt ? split_args(gwion->mp, opt) : NULL;
const modini ini = DLSYM(plug->dl, modini, GWMODINI_NAME);
plug->self = ini(gwion, arg);
if (arg) plug_free_arg(gwion->mp, arg);
+ break;
}
}
+ if(j == map_size(map)) {
+ gw_err("{+R}[module]{0} {C}%s{0} not found\n", name);
+ return GW_ERROR;
+ }
}
+ return GW_OK;
}
ANN static m_bool dependencies(struct Gwion_ *gwion, const Plug plug, const loc_t loc) {