Revision: 2411 http://geany.svn.sourceforge.net/geany/?rev=2411&view=rev Author: ntrel Date: 2008-03-26 10:10:18 -0700 (Wed, 26 Mar 2008)
Log Message: ----------- Rename VERSION_CHECK PLUGIN_VERSION_CHECK, but keep a deprecated alias so outside plugins still compile. Update our plugins to use this.
Modified Paths: -------------- trunk/ChangeLog trunk/doc/plugin-symbols.c trunk/doc/plugins.dox trunk/plugins/autosave.c trunk/plugins/classbuilder.c trunk/plugins/demoplugin.c trunk/plugins/export.c trunk/plugins/filebrowser.c trunk/plugins/htmlchars.c trunk/plugins/vcdiff.c trunk/src/plugindata.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/ChangeLog 2008-03-26 17:10:18 UTC (rev 2411) @@ -9,6 +9,13 @@ * plugins/pluginmacros.h: Rename p_filetype p_filetypes to keep the symmetry with filetypes_*, and define it also when GEANY_DISABLE_DEPRECATED is not set. + * HACKING: + Add note about not appending to structs like KeyBindingGroup and + GeanyCallback. + * src/plugindata.h, doc/plugin-symbols.c, doc/plugins.dox, plugins/*.c: + Rename VERSION_CHECK PLUGIN_VERSION_CHECK, but keep a deprecated + alias so outside plugins still compile. + Update our plugins to use this.
2008-03-24 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/doc/plugin-symbols.c =================================================================== --- trunk/doc/plugin-symbols.c 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/doc/plugin-symbols.c 2008-03-26 17:10:18 UTC (rev 2411) @@ -34,7 +34,7 @@ * @link plugindata.h @endlink. */
-/** Use the VERSION_CHECK() macro instead. Required by Geany. */ +/** Use the PLUGIN_VERSION_CHECK() macro instead. Required by Geany. */ gint version_check(gint);
/** Use the PLUGIN_INFO() macro to define it. Required by Geany. */
Modified: trunk/doc/plugins.dox =================================================================== --- trunk/doc/plugins.dox 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/doc/plugins.dox 2008-03-26 17:10:18 UTC (rev 2411) @@ -41,8 +41,8 @@ * To get started, see the @link howto Plugin Howto @endlink. * * Other pages: - * - @link signals Plugin Signals @endlink. - * - @link plugin-symbols.c Plugin Symbols @endlink. + * - @link signals Plugin Signals @endlink + * - @link plugin-symbols.c Plugin Symbols @endlink * * @note Some of these pages are also listed in Related Pages. */ @@ -178,14 +178,14 @@ * Every plugin should include "geany.h" and "plugindata.h" which provide necessary * preprocessor macros and other basic information. * There are two important preprocessor macros which need to be used at the beginning: - * PLUGIN_INFO() and VERSION_CHECK(). + * PLUGIN_INFO() and PLUGIN_VERSION_CHECK(). * * PLUGIN_INFO() tells Geany about basic plugin information like name, description, * version and author of the plugin. * - * VERSION_CHECK() checks for compatibility of the API version which the plugin uses with - * the used Geany sources. Furthermore, it also checks the binary compatiblity of the plugin - * with Geany. + * PLUGIN_VERSION_CHECK() checks for compatibility of the API version which + * the plugin uses with the used Geany sources. Furthermore, it also checks + * the binary compatiblity of the plugin with Geany. * * A few functions are necessary to let Geany work with the plugin, at least init() must * exist in the plugin. cleanup() should also be used to free allocated memory or destroy
Modified: trunk/plugins/autosave.c =================================================================== --- trunk/plugins/autosave.c 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/plugins/autosave.c 2008-03-26 17:10:18 UTC (rev 2411) @@ -35,7 +35,7 @@ GeanyData *geany_data;
-VERSION_CHECK(32) +PLUGIN_VERSION_CHECK(32)
PLUGIN_INFO(_("Auto Save"), _("Save automatically all open files in a given time interval."), VERSION, _("The Geany developer team"))
Modified: trunk/plugins/classbuilder.c =================================================================== --- trunk/plugins/classbuilder.c 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/plugins/classbuilder.c 2008-03-26 17:10:18 UTC (rev 2411) @@ -37,7 +37,7 @@ GeanyData *geany_data;
-VERSION_CHECK(7) +PLUGIN_VERSION_CHECK(7)
PLUGIN_INFO(_("Class Builder"), _("Creates source files for new class types."), VERSION, "Alexander Rodin")
Modified: trunk/plugins/demoplugin.c =================================================================== --- trunk/plugins/demoplugin.c 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/plugins/demoplugin.c 2008-03-26 17:10:18 UTC (rev 2411) @@ -49,7 +49,7 @@
/* Check that Geany supports plugin API version 7 or later, and check * for binary compatibility. */ -VERSION_CHECK(7) +PLUGIN_VERSION_CHECK(7)
/* All plugins must set name, description, version and author. */ PLUGIN_INFO(_("Demo"), _("Example plugin."), VERSION, _("The Geany developer team"))
Modified: trunk/plugins/export.c =================================================================== --- trunk/plugins/export.c 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/plugins/export.c 2008-03-26 17:10:18 UTC (rev 2411) @@ -40,7 +40,7 @@ PluginFields *plugin_fields; GeanyData *geany_data;
-VERSION_CHECK(20) +PLUGIN_VERSION_CHECK(20) PLUGIN_INFO(_("Export"), _("Exports the current file into different formats."), VERSION, _("The Geany developer team"))
Modified: trunk/plugins/filebrowser.c =================================================================== --- trunk/plugins/filebrowser.c 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/plugins/filebrowser.c 2008-03-26 17:10:18 UTC (rev 2411) @@ -43,7 +43,7 @@ GeanyData *geany_data;
-VERSION_CHECK(26) +PLUGIN_VERSION_CHECK(26)
PLUGIN_INFO(_("File Browser"), _("Adds a file browser tab to the sidebar."), VERSION, _("The Geany developer team"))
Modified: trunk/plugins/htmlchars.c =================================================================== --- trunk/plugins/htmlchars.c 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/plugins/htmlchars.c 2008-03-26 17:10:18 UTC (rev 2411) @@ -36,7 +36,7 @@ GeanyData *geany_data;
-VERSION_CHECK(48) +PLUGIN_VERSION_CHECK(48)
PLUGIN_INFO(_("HTML Characters"), _("Inserts HTML character entities like '&'."), VERSION, _("The Geany developer team"))
Modified: trunk/plugins/vcdiff.c =================================================================== --- trunk/plugins/vcdiff.c 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/plugins/vcdiff.c 2008-03-26 17:10:18 UTC (rev 2411) @@ -41,7 +41,7 @@ GeanyData *geany_data;
-VERSION_CHECK(27) +PLUGIN_VERSION_CHECK(27)
PLUGIN_INFO(_("VC Diff"), _("Creates a patch of a file against version control."), VERSION, _("The Geany developer team"))
Modified: trunk/src/plugindata.h =================================================================== --- trunk/src/plugindata.h 2008-03-26 16:42:50 UTC (rev 2410) +++ trunk/src/plugindata.h 2008-03-26 17:10:18 UTC (rev 2411) @@ -35,18 +35,18 @@
/* The API version should be incremented whenever any plugin data types below are * modified or appended to. */ -static const gint api_version = 51; +static const gint api_version = 52;
/* 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 = 23;
-/** This performs runtime checks that try to ensure: - * 1. Geany ABI data types are compatible with this plugin. - * 2. Geany sources provide the required API for this plugin. */ -/* TODO: if possible, the API version should be checked at compile time, not runtime. */ -#define VERSION_CHECK(api_required) \ +/** Check the plugin can be loaded by Geany. + * 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. */ +#define PLUGIN_VERSION_CHECK(api_required) \ gint version_check(gint abi_ver) \ { \ if (abi_ver != abi_version) \ @@ -374,4 +374,11 @@ } TagManagerFuncs;
+ +/* Deprecated aliases */ +#ifndef GEANY_DISABLE_DEPRECATED +#define VERSION_CHECK(api_required) \ + PLUGIN_VERSION_CHECK(api_required) #endif + +#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.