diff options
Diffstat (limited to 'sys/sys/eventhandler.h')
-rw-r--r-- | sys/sys/eventhandler.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/sys/eventhandler.h b/sys/sys/eventhandler.h index f4f1b8c..d18b635 100644 --- a/sys/sys/eventhandler.h +++ b/sys/sys/eventhandler.h @@ -104,6 +104,17 @@ struct eventhandler_entry_ ## name \ }; \ struct __hack +#define EVENTHANDLER_DEFINE(name, func, arg, priority) \ + static eventhandler_tag name ## _tag; \ + static void name ## _evh_init(void *ctx) \ + { \ + name ## _tag = EVENTHANDLER_REGISTER(name, func, ctx, \ + priority); \ + } \ + SYSINIT(name ## _evh_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, \ + name ## _evh_init, arg) \ + struct __hack + #define EVENTHANDLER_INVOKE(name, ...) \ do { \ struct eventhandler_list *_el; \ |