comparison src/audacious/hook.h @ 2457:b7f77224ea03 trunk

[svn] - now it's possible to pass user_data along with the hook function in hook_associate
author giacomo
date Wed, 31 Jan 2007 18:21:35 -0800
parents 60f1bc20c19c
children d226b83fa329
comparison
equal deleted inserted replaced
2456:63115d6e8ba8 2457:b7f77224ea03
16 */ 16 */
17 17
18 #ifndef __AUDACIOUS_HOOK_H__ 18 #ifndef __AUDACIOUS_HOOK_H__
19 #define __AUDACIOUS_HOOK_H__ 19 #define __AUDACIOUS_HOOK_H__
20 20
21 typedef void (*HookFunction)(gpointer user_data); 21 #include <glib.h>
22
23 typedef void (*HookFunction)(gpointer hook_data, gpointer user_data);
24
25 typedef struct {
26 HookFunction func;
27 gpointer user_data;
28 } HookItem;
22 29
23 typedef struct { 30 typedef struct {
24 const gchar *name; 31 const gchar *name;
25 GSList *funcs; 32 GSList *items;
26 } Hook; 33 } Hook;
27 34
28 void hook_register(const gchar *name); 35 void hook_register(const gchar *name);
29 void hook_associate(const gchar *name, HookFunction func); 36 gint hook_associate(const gchar *name, HookFunction func, gpointer user_data);
30 void hook_dissociate(const gchar *name, HookFunction func); 37 gint hook_dissociate(const gchar *name, HookFunction func);
31 void hook_call(const gchar *name, gpointer user_data); 38 void hook_call(const gchar *name, gpointer hook_data);
32 39
33 #endif 40 #endif