| 1 |
/* |
| 2 |
* Copyright (c) 2005 William Pitcock, et al. |
| 3 |
* Rights to this code are as documented in doc/LICENSE. |
| 4 |
* |
| 5 |
* A hook system. |
| 6 |
* |
| 7 |
*/ |
| 8 |
#ifndef HOOK_H |
| 9 |
#define HOOK_H |
| 10 |
|
| 11 |
typedef struct hook_ hook_t; |
| 12 |
typedef void (*hookfn_t)(void *data); |
| 13 |
|
| 14 |
struct hook_ { |
| 15 |
stringref name; |
| 16 |
mowgli_list_t hooks; |
| 17 |
}; |
| 18 |
|
| 19 |
E hook_t *hook_add_event(const char *); |
| 20 |
E void hook_del_event(const char *); |
| 21 |
E void hook_del_hook(const char *, hookfn_t); |
| 22 |
E void hook_add_hook(const char *, hookfn_t); |
| 23 |
E void hook_add_hook_first(const char *, hookfn_t); |
| 24 |
E void hook_call_event(const char *, void *); |
| 25 |
|
| 26 |
E void hook_stop(void); |
| 27 |
E void hook_continue(void *newptr); |
| 28 |
|
| 29 |
#endif |
| 30 |
|
| 31 |
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
| 32 |
* vim:ts=8 |
| 33 |
* vim:sw=8 |
| 34 |
* vim:noexpandtab |
| 35 |
*/ |