Audacious $Id:Doxyfile42802007-03-2104:39:00Znenolod$

hook.h

Go to the documentation of this file.
00001 /*  Audacious
00002  *  Copyright (c) 2006-2007 William Pitcock
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; under version 3 of the License.
00007  *
00008  *  This program is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *  GNU General Public License for more details.
00012  *
00013  *  You should have received a copy of the GNU General Public License
00014  *  along with this program.  If not, see <http://www.gnu.org/licenses>.
00015  *
00016  *  The Audacious team does not consider modular code linking to
00017  *  Audacious or using our public API to be a derived work.
00018  */
00019 
00020 #ifndef AUDACIOUS_HOOK_H
00021 #define AUDACIOUS_HOOK_H
00022 
00023 #include <glib.h>
00024 
00025 typedef void (*HookFunction)(gpointer hook_data, gpointer user_data);
00026 
00027 typedef struct {
00028     HookFunction func;
00029     gpointer user_data;
00030 } HookItem;
00031 
00032 typedef struct {
00033     const gchar *name;
00034     GSList *items;
00035 } Hook;
00036 
00037 void hook_init (void);
00038 void hook_register(const gchar *name);
00039 gint hook_associate(const gchar *name, HookFunction func, gpointer user_data);
00040 gint hook_dissociate(const gchar *name, HookFunction func);
00041 gint hook_dissociate_full(const gchar *name, HookFunction func, gpointer user_data);
00042 void hook_call(const gchar *name, gpointer hook_data);
00043 
00044 #endif /* AUDACIOUS_HOOK_H */