diff --git a/src/backend/plugin.c b/src/backend/plugin.c index 23d9aeed1..f66c73456 100644 --- a/src/backend/plugin.c +++ b/src/backend/plugin.c @@ -154,7 +154,8 @@ lumiera_plugin_error (LumieraPlugin self) return self->error; } -void * + +void* lumiera_plugin_handle (LumieraPlugin self) { REQUIRE (self); @@ -162,6 +163,27 @@ lumiera_plugin_handle (LumieraPlugin self) } +const char* +lumiera_plugin_name (LumieraPlugin self) +{ + return self?self->name:NULL; +} + + +void +lumiera_plugin_refinc (LumieraPlugin self) +{ + ++self->refcnt; +} + + +void +lumiera_plugin_refdec (LumieraPlugin self) +{ + --self->refcnt; +} + + int lumiera_plugin_discover (LumieraPlugin (*callback_load)(const char* plugin), int (*callback_register) (LumieraPlugin)) @@ -370,7 +392,6 @@ lumiera_plugin_delete_fn (PSplaynode node) ENSURE (!self->refcnt, "plugin %s still in use at shutdown", self->name); - const char* ext = strrchr (self->name, '.'); LumieraPlugintype itr = lumiera_plugin_types; diff --git a/src/backend/plugin.h b/src/backend/plugin.h index b7ccd5326..26451edac 100644 --- a/src/backend/plugin.h +++ b/src/backend/plugin.h @@ -137,6 +137,34 @@ void* lumiera_plugin_handle (LumieraPlugin self); +/** + * Query the plugin name + * The name is the path and filname under which it was loaded + * @param self plugin to query + * @return pointer to the name string + */ +const char* +lumiera_plugin_name (LumieraPlugin self); + + +/** + * Increment refcount + * @internal + * @param self plugin which refcount to increment + */ +void +lumiera_plugin_refinc (LumieraPlugin self); + + +/** + * Decrement refcount + * @internal + * @param self plugin which refcount to decrement + */ +void +lumiera_plugin_refdec (LumieraPlugin self); + + /** * Tries to unload a plugin. * When the Plugin is unused, then all resources associated with it are freed and it will be removed from memory