summaryrefslogtreecommitdiff
path: root/ev.h
diff options
context:
space:
mode:
authorroot <root>2007-10-31 00:32:33 +0000
committerroot <root>2007-10-31 00:32:33 +0000
commiteec85cf766fbaa1ee090c8daaf5b4a501f890f63 (patch)
tree6cd956df2aaef68a8b044a0ff16ac9d344cb9d58 /ev.h
parentefb07571c1a235448b70212dc46467214da4bb92 (diff)
implement primitive hook management
Diffstat (limited to 'ev.h')
-rw-r--r--ev.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ev.h b/ev.h
index 3467060..9290378 100644
--- a/ev.h
+++ b/ev.h
@@ -64,6 +64,13 @@ ev_tstamp ev_time (void);
void ev_loop (int flags);
extern int ev_loop_done; /* set to 1 to break out of event loop */
+#define EVHOOK_PREPOLL 0 /* called before updating fds, timers and blocking */
+#define EVHOOK_POSTPOLL 1 /* called after blocking */
+#define EVHOOK_NUM 2 /* just the # of hooks */
+typedef void (*ev_hook)(void);
+void ev_hook_register (int type, ev_hook hook);
+void ev_hook_unregister (int type, ev_hook hook);
+
/* these may evaluate ev multiple times, and the other arguments at most once */
#define evw_init(ev,cb_,data_) do { (ev)->active = 0; (ev)->cb = (cb_); (ev)->data = (void *)data_; } while (0)