… | |
… | |
98 | SV *data; |
98 | SV *data; |
99 | |
99 | |
100 | if (items < 2 || items > 3) |
100 | if (items < 2 || items > 3) |
101 | croak ("Coro::EV::timed_io_once requires exactly two or three parameters, not %d.\n", items); |
101 | croak ("Coro::EV::timed_io_once requires exactly two or three parameters, not %d.\n", items); |
102 | |
102 | |
|
|
103 | SvGETMAGIC (arg [0]); |
|
|
104 | SvGETMAGIC (arg [1]); |
|
|
105 | |
|
|
106 | if (items >= 3) |
|
|
107 | SvGETMAGIC (arg [2]); |
|
|
108 | |
103 | data = sv_2mortal (newRV_inc (CORO_CURRENT)); |
109 | data = sv_2mortal (newRV_inc (CORO_CURRENT)); |
104 | frame->data = (void *)data; |
110 | frame->data = (void *)data; |
105 | frame->prepare = GCoroAPI->prepare_schedule; |
111 | frame->prepare = GCoroAPI->prepare_schedule; |
106 | frame->check = slf_check_once; |
112 | frame->check = slf_check_once; |
107 | |
|
|
108 | if (items >= 3) |
|
|
109 | SvGETMAGIC (arg [2]); |
|
|
110 | |
113 | |
111 | ev_once ( |
114 | ev_once ( |
112 | EV_DEFAULT_UC, |
115 | EV_DEFAULT_UC, |
113 | sv_fileno (arg [0]), |
116 | sv_fileno (arg [0]), |
114 | SvIV (arg [1]), |
117 | SvIV (arg [1]), |