From 205a9b102b22f2dc1c711d8a8a5cb98488d22c9b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 2 May 2008 08:36:20 +0000 Subject: *** empty log message *** --- Changes | 1 + ev.h | 4 +++- ev.pod | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 54c9c3f..9f2e296 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ Revision history for libev, a high-performance and full-featured event loop. for better cache-efficiency and increases memory requirements by up to two pointers/loop. - fix a potential aliasing issue in ev_timer_again. + - add/document ev_periodic_at, retract diretc access to ->at. 3.31 Wed Apr 16 20:45:04 CEST 2008 - added last minute fix for ev_poll.c by Brandon Black. 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 diff --git a/ev.pod b/ev.pod index 77029fa..6ae53b1 100644 --- a/ev.pod +++ b/ev.pod @@ -1375,6 +1375,11 @@ when you changed some parameters or the reschedule callback would return a different time than the last time it was called (e.g. in a crond like program when the crontabs have changed). +=item ev_tstamp ev_periodic_at (ev_periodic *) + +When active, returns the absolute time that the watcher is supposed to +trigger next. + =item ev_tstamp offset [read-write] When repeating, this contains the offset value, otherwise this is the @@ -1395,11 +1400,6 @@ The current reschedule callback, or C<0>, if this functionality is switched off. Can be changed any time, but changes only take effect when the periodic timer fires or C is being called. -=item ev_tstamp at [read-only] - -When active, contains the absolute time that the watcher is supposed to -trigger next. - =back =head3 Examples -- cgit v1.2.3