Revision: 5132 http://geany.svn.sourceforge.net/geany/?rev=5132&view=rev Author: ntrel Date: 2010-08-11 12:50:38 +0000 (Wed, 11 Aug 2010)
Log Message: ----------- r5051
Modified Paths: -------------- branches/Geany-0_19_1/ChangeLog branches/Geany-0_19_1/doc/plugins.dox branches/Geany-0_19_1/src/plugindata.h branches/Geany-0_19_1/src/plugins.c
Modified: branches/Geany-0_19_1/ChangeLog =================================================================== --- branches/Geany-0_19_1/ChangeLog 2010-08-11 12:45:22 UTC (rev 5131) +++ branches/Geany-0_19_1/ChangeLog 2010-08-11 12:50:38 UTC (rev 5132) @@ -1,3 +1,11 @@ +2010-06-18 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/plugindata.h, src/plugins.c, doc/plugins.dox: + Fix not loading plugins built against a newer API when Geany doesn't + provide the required version given in PLUGIN_VERSION_CHECK(). + Improve documentation for PLUGIN_VERSION_CHECK(). + + 2010-06-16 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/notebook.c:
Modified: branches/Geany-0_19_1/doc/plugins.dox =================================================================== --- branches/Geany-0_19_1/doc/plugins.dox 2010-08-11 12:45:22 UTC (rev 5131) +++ branches/Geany-0_19_1/doc/plugins.dox 2010-08-11 12:50:38 UTC (rev 5132) @@ -43,7 +43,7 @@ * @section pluginsupport Plugin Support * - @link howto Plugin HowTo @endlink - get started * - @link pluginsymbols.c Plugin Symbols @endlink - * - @link plugindata.h Main Datatypes and Macros @endlink + * - @link plugindata.h Plugin Datatypes and Macros @endlink * - @link signals Plugin Signals @endlink * - @link pluginutils.h Plugin Utility Functions @endlink * - @link guidelines Plugin Writing Guidelines @endlink
Modified: branches/Geany-0_19_1/src/plugindata.h =================================================================== --- branches/Geany-0_19_1/src/plugindata.h 2010-08-11 12:45:22 UTC (rev 5131) +++ branches/Geany-0_19_1/src/plugindata.h 2010-08-11 12:50:38 UTC (rev 5132) @@ -59,18 +59,20 @@ GEANY_ABI_VERSION = 66 };
-/** Checks the plugin can be loaded by Geany. +/** Defines a function to check the plugin is safe to load. * This performs runtime checks that try to ensure: * - Geany ABI data types are compatible with this plugin. - * - Geany sources provide the required API for this plugin. */ + * - Geany sources provide the required API for this plugin. + * @param api_required The minimum API number your plugin requires. + * Look at the source for the value of @c GEANY_API_VERSION to use if you + * want your plugin to require the current Geany version on your machine. + * You should update this value when using any new API features. */ #define PLUGIN_VERSION_CHECK(api_required) \ gint plugin_version_check(gint abi_ver) \ { \ if (abi_ver != GEANY_ABI_VERSION) \ return -1; \ - if (GEANY_API_VERSION < (api_required)) \ - return (api_required); \ - else return 0; \ + return (api_required); \ }
Modified: branches/Geany-0_19_1/src/plugins.c =================================================================== --- branches/Geany-0_19_1/src/plugins.c 2010-08-11 12:45:22 UTC (rev 5131) +++ branches/Geany-0_19_1/src/plugins.c 2010-08-11 12:50:38 UTC (rev 5132) @@ -467,7 +467,7 @@ "release of Geany - recompile it.", g_module_name(module)); return FALSE; } - if (result > 0) + if (result > GEANY_API_VERSION) { geany_debug("Plugin "%s" requires a newer version of Geany (API >= v%d).", g_module_name(module), result);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.