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.
This commit is contained in:
Colomban Wendling 2014-10-20 17:55:32 +02:00
parent c35dedf35f
commit d4135c9842

View File

@ -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. */