--- EV/EV.xs 2007/10/31 11:59:54 1.19 +++ EV/EV.xs 2007/10/31 13:57:34 1.20 @@ -2,15 +2,11 @@ #include "perl.h" #include "XSUB.h" -#include -#include +/*#include */ #define TIMEOUT_NONE HUGE_VAL -#define EV_COMMON \ - SV *self; /* contains this struct */ \ - SV *cb_sv, *fh; - +#define EV_PROTOTYPES 1 #include "EV/EVAPI.h" #include "libev/ev.c" @@ -44,21 +40,6 @@ return -1; } -static void -api_once (int fd, short events, double timeout, void (*cb)(int, short, void *), void *arg) -{ -#if 0 - if (timeout >= 0.) - { - struct timeval tv; - tv_set (&tv, timeout); - event_once (fd, events, cb, arg, &tv); - } - else - event_once (fd, events, cb, arg, 0); -#endif -} - ///////////////////////////////////////////////////////////////////////////// // Event @@ -231,6 +212,7 @@ IV iv; } *civ, const_iv[] = { # define const_iv(pfx, name) { # name, (IV) pfx ## name }, + const_iv (EV_, UNDEF) const_iv (EV_, NONE) const_iv (EV_, TIMEOUT) const_iv (EV_, READ) @@ -238,6 +220,7 @@ const_iv (EV_, SIGNAL) const_iv (EV_, IDLE) const_iv (EV_, CHECK) + const_iv (EV_, ERROR) const_iv (EV, LOOP_ONESHOT) const_iv (EV, LOOP_NONBLOCK) @@ -266,7 +249,6 @@ /* the poor man's shared library emulator */ evapi.ver = EV_API_VERSION; evapi.rev = EV_API_REVISION; - evapi.once = api_once; evapi.sv_fileno = sv_fileno; evapi.sv_signum = sv_signum; evapi.now = &ev_now; @@ -274,6 +256,7 @@ evapi.loop_done = &ev_loop_done; evapi.time = ev_time; evapi.loop = ev_loop; + evapi.once = ev_once; evapi.io_start = evio_start; evapi.io_stop = evio_stop; evapi.timer_start = evtimer_start;