SF.net SVN: geany:[2888] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Aug 14 15:50:41 UTC 2008


Revision: 2888
          http://geany.svn.sourceforge.net/geany/?rev=2888&view=rev
Author:   ntrel
Date:     2008-08-14 15:50:40 +0000 (Thu, 14 Aug 2008)

Log Message:
-----------
Rename api_version GEANY_API_VERSION.
Rename abi_version GEANY_ABI_VERSION.
Use enums for each of these so they can be used to initialize a
global variable, and add dox.

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-14 15:48:11 UTC (rev 2887)
+++ trunk/ChangeLog	2008-08-14 15:50:40 UTC (rev 2888)
@@ -1,3 +1,15 @@
+2008-08-14  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/notebook.c:
+   Don't look up "scroll_arrow_hlength" and "scroll_arrow_vlength"
+   GtkWidget properties on GTK < 2.10.
+ * src/prefs.h, src/plugindata.h, src/plugins.c:
+   Rename api_version GEANY_API_VERSION.
+   Rename abi_version GEANY_ABI_VERSION.
+   Use enums for each of these so they can be used to initialize a
+   global variable, and add dox.
+
+
 2008-08-13  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * doc/geany.txt, doc/geany.html:

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2008-08-14 15:48:11 UTC (rev 2887)
+++ trunk/src/plugindata.h	2008-08-14 15:50:40 UTC (rev 2888)
@@ -28,20 +28,27 @@
  * For detailed documentation of the plugin system please read the plugin
  * API documentation.
  **/
-/* Note: Remember to increment api_version (and abi_version if necessary) when making changes. */
+/* Note: Remember to increment GEANY_API_VERSION (and GEANY_ABI_VERSION if necessary)
+ * when making changes (see 'Keeping the plugin ABI stable' in the HACKING file). */
 
 
 #ifndef PLUGINDATA_H
 #define PLUGINDATA_H
 
-/* The API version should be incremented whenever any plugin data types below are
- * modified or appended to. */
-static const gint api_version = 87;
+/* Note: We use enum instead of 'static const gint' to allow its use in global variable
+ * initializing, otherwise we get errors like:
+ * error: initializer element is not constant */
+enum {
+	/** The Application Programming Interface (API) version, incremented
+	 * whenever any plugin data types are modified or appended to. */
+	GEANY_API_VERSION = 88,
 
-/* The ABI version should be incremented whenever existing fields in the plugin
- * data types below have to be changed or reordered. It should stay the same if fields
- * are only appended, as this doesn't affect existing fields. */
-static const gint abi_version = 44;
+	/** The Application Binary Interface (ABI) version, incremented whenever
+	 * existing fields in the plugin data types have to be changed or reordered. */
+	/* This should usually stay the same if fields are only appended, assuming only pointers to
+	 * structs and not structs themselves are declared by plugins. */
+	GEANY_ABI_VERSION = 44
+};
 
 /** Check the plugin can be loaded by Geany.
  * This performs runtime checks that try to ensure:
@@ -50,9 +57,9 @@
 #define PLUGIN_VERSION_CHECK(api_required) \
 	gint plugin_version_check(gint abi_ver) \
 	{ \
-		if (abi_ver != abi_version) \
+		if (abi_ver != GEANY_ABI_VERSION) \
 			return -1; \
-		if (api_version < (api_required)) \
+		if (GEANY_API_VERSION < (api_required)) \
 			return (api_required); \
 		else return 0; \
 	}
@@ -376,14 +383,15 @@
 
 
 struct GeanyKeyGroup;
-typedef void (*_KeyCallback) (guint key_id);
+/* avoid including keybindings.h */
+typedef void (*_GeanyKeyCallback) (guint key_id);
 
 /* See keybindings.h */
 typedef struct KeybindingFuncs
 {
 	void		(*send_command) (guint group_id, guint key_id);
 	void		(*set_item) (struct GeanyKeyGroup *group, gsize key_id,
-					_KeyCallback callback, guint key, GdkModifierType mod,
+					_GeanyKeyCallback callback, guint key, GdkModifierType mod,
 					gchar *name, gchar *label, GtkWidget *menu_item);
 }
 KeybindingFuncs;

Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c	2008-08-14 15:48:11 UTC (rev 2887)
+++ trunk/src/plugins.c	2008-08-14 15:50:40 UTC (rev 2888)
@@ -365,7 +365,7 @@
 	}
 	else
 	{
-		gint result = version_check(abi_version);
+		gint result = version_check(GEANY_ABI_VERSION);
 
 		if (result < 0)
 		{

Modified: trunk/src/prefs.h
===================================================================
--- trunk/src/prefs.h	2008-08-14 15:48:11 UTC (rev 2887)
+++ trunk/src/prefs.h	2008-08-14 15:50:40 UTC (rev 2888)
@@ -24,8 +24,7 @@
 #ifndef GEANY_PREFS_H
 #define GEANY_PREFS_H 1
 
-/* General Preferences dialog settings.
- * Remember to increment abi_version in plugindata.h if you have to change an item. */
+/* General Preferences dialog settings. */
 typedef struct GeanyPrefs
 {
 	gboolean		load_session;


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