From: Andreas Tonnesen Date: Sat, 6 Nov 2004 12:18:51 +0000 (+0000) Subject: Changed the way the plugin interface version is fetched by the plugin loader. This... X-Git-Tag: OLSRD_0_4_8~232 X-Git-Url: http://olsr.org/git/?p=olsrd.git;a=commitdiff_plain;h=e4d6ed76b8d85e5d636af4e7eca86d4bbaeba0a2 Changed the way the plugin interface version is fetched by the plugin loader. This used to be via a variable that the plugin exported. Now it is done via a function exported by the plugin: int plugin_interface_version(). ALL plugins must implement this --- diff --git a/src/plugin_loader.c b/src/plugin_loader.c index e4db5b96..41e4a7a7 100644 --- a/src/plugin_loader.c +++ b/src/plugin_loader.c @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * - * $Id: plugin_loader.c,v 1.10 2004/11/06 09:20:09 kattemat Exp $ + * $Id: plugin_loader.c,v 1.11 2004/11/06 12:18:51 kattemat Exp $ * */ @@ -79,7 +79,7 @@ int olsr_load_dl(char *libname, struct plugin_param *params) { struct olsr_plugin new_entry, *entry; - int *interface_version; + int (*interface_version)(void); olsr_printf(1, "---------- Plugin loader ----------\nLibrary: %s\n", libname); @@ -90,9 +90,8 @@ olsr_load_dl(char *libname, struct plugin_param *params) return -1; } - /* Fetch the multipurpose function */ + /* Fetch the interface version function */ olsr_printf(1, "Checking plugin interface version...."); - /* Register mp function */ if((interface_version = dlsym(new_entry.dlhandle, "plugin_interface_version")) == NULL) { olsr_printf(1, "FAILED: \"%s\"\n", dlerror()); @@ -101,8 +100,8 @@ olsr_load_dl(char *libname, struct plugin_param *params) } else { - olsr_printf(1, " %d - ", *interface_version); - if(*interface_version != PLUGIN_INTERFACE_VERSION) + olsr_printf(1, " %d - ", interface_version()); + if(interface_version() != PLUGIN_INTERFACE_VERSION) olsr_printf(1, "WARNING: VERSION MISSMATCH!\n"); else olsr_printf(1, "OK\n");