diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-10-01 15:55:23 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-10-01 15:55:23 +0200 |
commit | 961671c0f51693aff34bf3adf5319b35275a86d3 (patch) | |
tree | 1eae258f41d0dc67abdc45da6bc16f253a4f23dc /lib/event.h | |
parent | 0db7a1d69c80b1089f10a268ceacb059db41ced8 (diff) |
Lib: Add and use ev_new_init()
Diffstat (limited to 'lib/event.h')
-rw-r--r-- | lib/event.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/event.h b/lib/event.h index d5975222..03735c3f 100644 --- a/lib/event.h +++ b/lib/event.h @@ -36,5 +36,14 @@ ev_active(event *e) return e->n.next != NULL; } +static inline event* +ev_new_init(pool *p, void (*hook)(void *), void *data) +{ + event *e = ev_new(p); + e->hook = hook; + e->data = data; + return e; +} + #endif |