# HG changeset patch # User nenolod # Date 1179997397 25200 # Node ID e9af66a1be7457c164b5819c8d6e5ca120ac6e25 # Parent fa6c339cce386236cdd063c676358d959543f50e [svn] - add functions for defining the v2 plugin header diff -r fa6c339cce38 -r e9af66a1be74 ChangeLog --- a/ChangeLog Thu May 24 01:48:28 2007 -0700 +++ b/ChangeLog Thu May 24 02:03:17 2007 -0700 @@ -1,3 +1,11 @@ +2007-05-24 08:48:28 +0000 William Pitcock + revision [4616] + - chase r4614. + + trunk/src/audacious/pluginenum.c | 2 -- + 1 file changed, 2 deletions(-) + + 2007-05-24 08:47:50 +0000 William Pitcock revision [4614] - begin work on the host side of plugin API v2. diff -r fa6c339cce38 -r e9af66a1be74 src/audacious/build_stamp.c --- a/src/audacious/build_stamp.c Thu May 24 01:48:28 2007 -0700 +++ b/src/audacious/build_stamp.c Thu May 24 02:03:17 2007 -0700 @@ -1,2 +1,2 @@ #include -const gchar *svn_stamp = "20070524-4614"; +const gchar *svn_stamp = "20070524-4616"; diff -r fa6c339cce38 -r e9af66a1be74 src/audacious/plugin.h --- a/src/audacious/plugin.h Thu May 24 01:48:28 2007 -0700 +++ b/src/audacious/plugin.h Thu May 24 02:03:17 2007 -0700 @@ -32,12 +32,9 @@ * SUCH DAMAGE. */ -/* Please see the BMP Wiki for information about the plugin interface */ - #ifndef BMP_PLUGIN_H #define BMP_PLUGIN_H - #include #include "audacious/vfs.h" #include "audacious/titlestring.h" @@ -84,6 +81,37 @@ typedef struct _InputPlayback InputPlayback; +/* + * The v2 Module header. + * + * _list fields contain a null-terminated list of "plugins" to register. + * A single library can provide multiple plugins. + * --nenolod + */ +typedef struct { + gint magic; + gint api_version; + gchar *name; + GCallback init; + GCallback fini; + Plugin *priv_assoc; + InputPlugin **ip_list; + OutputPlugin **op_list; + EffectPlugin **ep_list; + GeneralPlugin **gp_list; + VisPlugin **vp_list; +} PluginHeader; + +#define PLUGIN_MAGIC 0x8EAC8DE2 + +#define DECLARE_PLUGIN(name, init, fini, ip_list, op_list, ep_list, gp_list, vp_list) \ + static PluginHeader _pluginInfo = { PLUGIN_MAGIC, __AUDACIOUS_PLUGIN_API__, \ + #name, init, fini, NULL, ip_list, op_list, ep_list, gp_list, \ + vp_list }; \ + PluginHeader *get_plugin_info(void) { \ + return &_pluginInfo; \ + } + /* Sadly, this is the most we can generalize out of the disparate plugin structs usable with typecasts - descender */ struct _Plugin {