SF.net SVN: geany:[5051] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Jun 18 15:04:07 UTC 2010


Revision: 5051
          http://geany.svn.sourceforge.net/geany/?rev=5051&view=rev
Author:   ntrel
Date:     2010-06-18 15:04:07 +0000 (Fri, 18 Jun 2010)

Log Message:
-----------
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().

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/plugins.dox
    trunk/src/plugindata.h
    trunk/src/plugins.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-06-18 14:20:10 UTC (rev 5050)
+++ trunk/ChangeLog	2010-06-18 15:04:07 UTC (rev 5051)
@@ -5,6 +5,10 @@
    Add ui_combo_box_add_to_history() to API.
  * plugins/filebrowser.c:
    Add history to path entry.
+ * 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-17  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/doc/plugins.dox
===================================================================
--- trunk/doc/plugins.dox	2010-06-18 14:20:10 UTC (rev 5050)
+++ trunk/doc/plugins.dox	2010-06-18 15:04:07 UTC (rev 5051)
@@ -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: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2010-06-18 14:20:10 UTC (rev 5050)
+++ trunk/src/plugindata.h	2010-06-18 15:04:07 UTC (rev 5051)
@@ -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: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c	2010-06-18 14:20:10 UTC (rev 5050)
+++ trunk/src/plugins.c	2010-06-18 15:04:07 UTC (rev 5051)
@@ -468,7 +468,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.



More information about the Commits mailing list