From 961671c0f51693aff34bf3adf5319b35275a86d3 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Mon, 1 Oct 2018 15:55:23 +0200 Subject: Lib: Add and use ev_new_init() --- lib/event.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/event.h') 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 -- cgit v1.2.3