changeset 2796:e9af66a1be74 trunk

[svn] - add functions for defining the v2 plugin header
author nenolod
date Thu, 24 May 2007 02:03:17 -0700
parents fa6c339cce38
children f0c1c8b22c88
files ChangeLog src/audacious/build_stamp.c src/audacious/plugin.h
diffstat 3 files changed, 40 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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 <nenolod@sacredspiral.co.uk>
+  revision [4616]
+  - chase r4614.
+  
+  trunk/src/audacious/pluginenum.c |    2 --
+  1 file changed, 2 deletions(-)
+
+
 2007-05-24 08:47:50 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [4614]
   - begin work on the host side of plugin API v2.
--- 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 <glib.h>
-const gchar *svn_stamp = "20070524-4614";
+const gchar *svn_stamp = "20070524-4616";
--- 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 <glib.h>
 #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 {