1 /** \file lib/hook.h
2 * \brief Header: hooks
3 */
4
5 #ifndef MC_HOOK_H
6 #define MC_HOOK_H
7
8 #include "lib/global.h"
9
10 /*** typedefs(not structures) and defined constants **********************************************/
11
12 /*** enums ***************************************************************************************/
13
14 /*** structures declarations (and typedefs of structures)*****************************************/
15
16 typedef struct hook_t
17 {
18 void (*hook_fn) (void *);
19 void *hook_data;
20 struct hook_t *next;
21 } hook_t;
22
23 /*** global variables defined in .c file *********************************************************/
24
25 /*** declarations of public functions ************************************************************/
26
27 void add_hook (hook_t **hook_list, void (*hook_fn) (void *), void *data);
28 void execute_hooks (hook_t *hook_list);
29 void delete_hook (hook_t **hook_list, void (*hook_fn) (void *));
30 gboolean hook_present (hook_t *hook_list, void (*hook_fn) (void *));
31
32 /*** inline functions **************************************************/
33
34 #endif