X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/6724cd5b6ffe05187a5520b0cd3771c7dbe83896..4f1dc6c0e6bd6e6e6edab0e55fc6b96824a12f38:/ev.h?ds=inline diff --git a/ev.h b/ev.h index 589e8ea..fec2ca4 100644 --- a/ev.h +++ b/ev.h @@ -48,6 +48,10 @@ typedef double ev_tstamp; # define EV_MULTIPLICITY 1 #endif +#ifndef EV_PERIODICS +# define EV_PERIODICS 1 +#endif + /* support multiple event loops? */ #if EV_MULTIPLICITY struct ev_loop; @@ -55,11 +59,15 @@ struct ev_loop; # define EV_P_ EV_P, # define EV_A loop # define EV_A_ EV_A, +# define EV_DEFAULT_A ev_default_loop (0) +# define EV_DEFAULT_A_ EV_DEFAULT_A, #else # define EV_P void # define EV_P_ # define EV_A # define EV_A_ +# define EV_DEFAULT_A +# define EV_DEFAULT_A_ #endif /* eventmask, revents, events... */ @@ -272,7 +280,7 @@ int ev_default_loop (int methods); /* returns true when successful */ static ev_tstamp ev_now () { - extern ev_rt_now; + extern ev_tstamp ev_rt_now; return ev_rt_now; } @@ -366,9 +374,11 @@ void ev_timer_stop (EV_P_ struct ev_timer *w); /* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */ void ev_timer_again (EV_P_ struct ev_timer *w); +#if EV_PERIODICS void ev_periodic_start (EV_P_ struct ev_periodic *w); void ev_periodic_stop (EV_P_ struct ev_periodic *w); void ev_periodic_again (EV_P_ struct ev_periodic *w); +#endif void ev_idle_start (EV_P_ struct ev_idle *w); void ev_idle_stop (EV_P_ struct ev_idle *w);