summaryrefslogtreecommitdiff
path: root/ev.h
diff options
context:
space:
mode:
authorroot <root>2008-05-02 08:36:20 +0000
committerroot <root>2008-05-02 08:36:20 +0000
commit205a9b102b22f2dc1c711d8a8a5cb98488d22c9b (patch)
treeb8cda164341181a080cbb33f24ea0a9f5851ef8c /ev.h
parent1b5bdfc28c14e180f3369f1bd995af92c20f15e9 (diff)
*** empty log message ***
Diffstat (limited to 'ev.h')
-rw-r--r--ev.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/ev.h b/ev.h
index f406e89..fef82e9 100644
--- a/ev.h
+++ b/ev.h
@@ -515,7 +515,7 @@ void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revent
} while (0)
#define ev_io_set(ev,fd_,events_) do { (ev)->fd = (fd_); (ev)->events = (events_) | EV_IOFDSET; } while (0)
-#define ev_timer_set(ev,after_,repeat_) do { (ev)->at = (after_); (ev)->repeat = (repeat_); } while (0)
+#define ev_timer_set(ev,after_,repeat_) do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0)
#define ev_periodic_set(ev,ofs_,ival_,res_) do { (ev)->offset = (ofs_); (ev)->interval = (ival_); (ev)->reschedule_cb= (res_); } while (0)
#define ev_signal_set(ev,signum_) do { (ev)->signum = (signum_); } while (0)
#define ev_child_set(ev,pid_,trace_) do { (ev)->pid = (pid_); (ev)->flags = !!(trace_); } while (0)
@@ -547,6 +547,8 @@ void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revent
#define ev_cb(ev) (ev)->cb /* rw */
#define ev_set_priority(ev,pri) ((ev_watcher *)(void *)(ev))->priority = (pri)
+#define ev_periodic_at(ev) (((ev_watcher_time *)(ev))->at + 0.)
+
#ifndef ev_set_cb
# define ev_set_cb(ev,cb_) ev_cb (ev) = (cb_)
#endif