summaryrefslogtreecommitdiff
path: root/src/eloop.h
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-06-24 17:57:38 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-06-24 17:57:38 +0200
commit43eb459cf6578c68794d9f1a1f3f9a1d1b57cbd9 (patch)
treee629fd7696b0707afd69d850e36b89f1ae599c1b /src/eloop.h
parent65482ff11c5555026fcc816f6c42945cc684c0e0 (diff)
eloop: require llog function in eloop-creation
When creating a new eloop object, we now require an lloop function so we can perform conditional logging. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/eloop.h')
-rw-r--r--src/eloop.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/eloop.h b/src/eloop.h
index d0c0922..cb55a08 100644
--- a/src/eloop.h
+++ b/src/eloop.h
@@ -35,6 +35,7 @@
#define EV_ELOOP_H
#include <inttypes.h>
+#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/signalfd.h>
@@ -45,6 +46,14 @@ struct ev_fd;
struct ev_timer;
struct ev_counter;
+typedef void (*ev_log_t) (const char *file,
+ int line,
+ const char *func,
+ const char *subs,
+ unsigned int sev,
+ const char *format,
+ va_list args);
+
typedef void (*ev_fd_cb) (struct ev_fd *fd, int mask, void *data);
typedef void (*ev_timer_cb)
(struct ev_timer *timer, uint64_t num, void *data);
@@ -61,7 +70,7 @@ enum ev_eloop_flags {
EV_ERR = 0x08,
};
-int ev_eloop_new(struct ev_eloop **out);
+int ev_eloop_new(struct ev_eloop **out, ev_log_t log);
void ev_eloop_ref(struct ev_eloop *loop);
void ev_eloop_unref(struct ev_eloop *loop);