# HG changeset patch # User William Pitcock # Date 1192349292 18000 # Node ID e2f8feddbb1918ba9433d31f0c96be981a1cee39 # Parent 587eec3cee14f392f40cbc705dad2e04878360e4 export hook API diff -r 587eec3cee14 -r e2f8feddbb19 src/audacious/plugin.h --- a/src/audacious/plugin.h Sun Oct 14 02:47:41 2007 -0500 +++ b/src/audacious/plugin.h Sun Oct 14 03:08:12 2007 -0500 @@ -93,6 +93,7 @@ #include "audacious/input.h" #include "audacious/mime.h" #include "audacious/custom_uri.h" +#include "audacious/hook.h" #define PLUGIN_COMMON_FIELDS \ gpointer handle; \ @@ -438,6 +439,12 @@ /* state vars */ InputPluginData *ip_state; BmpConfig *_cfg; + + /* hook API */ + void (*hook_register)(const gchar *name); + gint (*hook_associate)(const gchar *name, HookFunction func, gpointer user_data); + gint (*hook_dissociate)(const gchar *name, HookFunction func); + void (*hook_call)(const gchar *name, gpointer hook_data); }; /* Convenience macros for accessing the public API. */ @@ -656,6 +663,11 @@ #define aud_ip_state _audvt->ip_state #define aud_cfg _audvt->_cfg +#define aud_hook_associate _audvt->hook_associate +#define aud_hook_dissociate _audvt->hook_dissociate +#define aud_hook_register _audvt->hook_register +#define aud_hook_call _audvt->hook_call + /* for multi-file plugins :( */ extern struct _AudaciousFuncTableV1 *_audvt; diff -r 587eec3cee14 -r e2f8feddbb19 src/audacious/pluginenum.c --- a/src/audacious/pluginenum.c Sun Oct 14 02:47:41 2007 -0500 +++ b/src/audacious/pluginenum.c Sun Oct 14 03:08:12 2007 -0500 @@ -262,6 +262,11 @@ .ip_state = &ip_data, ._cfg = &cfg, + + .hook_associate = hook_associate, + .hook_dissociate = hook_dissociate, + .hook_register = hook_register, + .hook_call = hook_call, }; /*****************************************************************/