--- EV/EV.xs 2010/10/24 17:58:41 1.144 +++ EV/EV.xs 2010/10/24 19:01:01 1.145 @@ -122,6 +122,7 @@ *stash_check, *stash_embed, *stash_fork, + *stash_cleanup, *stash_async; ///////////////////////////////////////////////////////////////////////////// @@ -376,6 +377,7 @@ const_iv (EV_, CHECK) const_iv (EV_, EMBED) const_iv (EV_, FORK) + const_iv (EV_, CLEANUP) const_iv (EV_, ASYNC) const_iv (EV_, CUSTOM) const_iv (EV_, ERROR) @@ -430,6 +432,7 @@ stash_embed = gv_stashpv ("EV::Embed" , 1); stash_stat = gv_stashpv ("EV::Stat" , 1); stash_fork = gv_stashpv ("EV::Fork" , 1); + stash_cleanup = gv_stashpv ("EV::Cleanup" , 1); stash_async = gv_stashpv ("EV::Async" , 1); { @@ -496,6 +499,8 @@ evapi.embed_sweep = ev_embed_sweep; evapi.fork_start = ev_fork_start; evapi.fork_stop = ev_fork_stop; + evapi.cleanup_start = ev_cleanup_start; + evapi.cleanup_stop = ev_cleanup_stop; evapi.async_start = ev_async_start; evapi.async_stop = ev_async_stop; evapi.async_send = ev_async_send; @@ -715,6 +720,15 @@ OUTPUT: RETVAL +ev_cleanup *cleanup (SV *cb) + ALIAS: + cleanup_ns = 1 + CODE: + RETVAL = e_new (sizeof (ev_cleanup), cb, default_loop_sv); + ev_cleanup_set (RETVAL); + if (!ix) START (cleanup, RETVAL); + OUTPUT: + RETVAL ev_child *child (int pid, int trace, SV *cb) ALIAS: @@ -1105,6 +1119,21 @@ STOP (fork, w); e_destroy (w); +MODULE = EV PACKAGE = EV::Cleanup PREFIX = ev_cleanup_ + +void ev_cleanup_start (ev_cleanup *w) + CODE: + START (cleanup, w); + +void ev_cleanup_stop (ev_cleanup *w) + CODE: + STOP (cleanup, w); + +void DESTROY (ev_cleanup *w) + CODE: + STOP (cleanup, w); + e_destroy (w); + MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_ #if EV_CHILD_ENABLE @@ -1465,6 +1494,15 @@ OUTPUT: RETVAL +ev_cleanup *cleanup (struct ev_loop *loop, SV *cb) + ALIAS: + cleanup_ns = 1 + CODE: + RETVAL = e_new (sizeof (ev_cleanup), cb, ST (0)); + ev_cleanup_set (RETVAL); + if (!ix) START (cleanup, RETVAL); + OUTPUT: + RETVAL ev_child *child (struct ev_loop *loop, int pid, int trace, SV *cb) ALIAS: