Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Mon, 20 Oct 2014 15:55:32 UTC Commit: d4135c9842bb7fc0c8701fc47a1ab148bed5e992 https://github.com/geany/geany/commit/d4135c9842bb7fc0c8701fc47a1ab148bed5e9...
Log Message: ----------- Add prototypes for all plugin symbols
This allows the compilers to check that the plugin's symbols have the proper prototype. Doing so can avoid subtle and hard-to-find bugs in case a plugin's symbol has incorrect signature as dlsym() can't check if the signature is actually the one we expect.
As a bonus, it helps when using -Wmissing-prototypes as it provides the prototypes.
Modified Paths: -------------- src/plugindata.h
Modified: src/plugindata.h 26 lines changed, 17 insertions(+), 9 deletions(-) =================================================================== @@ -157,15 +157,6 @@ GeanyPlugin; }
-#ifndef GEANY_PRIVATE - -/* Prototypes for building plugins with -Wmissing-prototypes */ -gint plugin_version_check(gint abi_ver); -void plugin_set_info(PluginInfo *info); - -#endif - - /** @deprecated - use plugin_set_key_group() instead. * @see PLUGIN_KEY_GROUP() macro. */ typedef struct GeanyKeyGroupInfo @@ -258,6 +249,23 @@ GeanyData; #define geany geany_data /**< Simple macro for @c geany_data that reduces typing. */
+#ifndef GEANY_PRIVATE + +/* Prototypes for building plugins with -Wmissing-prototypes + * Also allows the compiler to check if the signature of the plugin's + * symbol properly matches what we expect. */ +gint plugin_version_check(gint abi_ver); +void plugin_set_info(PluginInfo *info); + +void plugin_init(GeanyData *data); +GtkWidget *plugin_configure(GtkDialog *dialog); +void plugin_configure_single(GtkWidget *parent); +void plugin_help(void); +void plugin_cleanup(void); + +#endif + + /** This contains pointers to functions owned by Geany for plugins to use. * Functions from the core can be appended when needed by plugin authors, but may * require some changes. */
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).