From a1d50122035b30e5735ca5db70593fe51028e628 Mon Sep 17 00:00:00 2001 From: waker Date: Mon, 5 Nov 2012 19:46:15 +0100 Subject: fixes necessary to support plugins with actions using API <=1.4 --- plugins.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plugins.c') diff --git a/plugins.c b/plugins.c index 044019f0..3bee6b27 100644 --- a/plugins.c +++ b/plugins.c @@ -514,6 +514,18 @@ plug_init_plugin (DB_plugin_t* (*loadfunc)(DB_functions_t *), void *handle) { trace ("\033[0;31mWARNING: plugin \"%s\" has disabled version check. please don't distribute it!\033[0;m\n", plugin_api->name); } #endif + + // deprecated 1.4 DB_plugin_action_t hack + // this allows to check if the action is coming from pre-1.5 plugin without + // having a plugin pointer + if (plugin_api->get_actions && plugin_api->api_vmajor == 1 && plugin_api->api_vminor <= 4) { + DB_plugin_action_t *actions = plugin_api->get_actions (NULL); + while (actions) { + actions->flags |= DB_ACTION_USING_API_14; + actions = actions->next; + } + } + plugin_t *plug = malloc (sizeof (plugin_t)); memset (plug, 0, sizeof (plugin_t)); plug->plugin = plugin_api; -- cgit v1.2.3