mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 10:26:22 +00:00
WIP - Unload plugin commands
This commit is contained in:
@@ -172,6 +172,33 @@ plugins_load(const char *const name)
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
plugins_unload(const char *const name)
|
||||
{
|
||||
GSList *found = g_slist_find_custom(plugins, name, (GCompareFunc)_find_by_name);
|
||||
if (!found) {
|
||||
log_info("Failed to unload plugin: %s, plugin not currently loaded", name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
plugins = g_slist_remove_link(plugins, found);
|
||||
|
||||
#ifdef HAVE_PYTHON
|
||||
if (g_str_has_suffix(name, ".py")) {
|
||||
python_plugin_destroy(found->data);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_C
|
||||
if (g_str_has_suffix(name, ".so")) {
|
||||
c_plugin_destroy(found->data);
|
||||
}
|
||||
#endif
|
||||
|
||||
g_slist_free(found);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GSList *
|
||||
plugins_get_list(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user