… | |
… | |
9 | |
9 | |
10 | /* fix perl api breakage */ |
10 | /* fix perl api breakage */ |
11 | #undef signal |
11 | #undef signal |
12 | #undef sigaction |
12 | #undef sigaction |
13 | |
13 | |
|
|
14 | #define EV_USE_MONOTONIC 1 |
|
|
15 | #define EV_USE_REALTIME 1 |
14 | #define EV_SELECT_IS_WINSOCKET 0 |
16 | #define EV_SELECT_IS_WINSOCKET 0 |
15 | #ifdef _WIN32 |
17 | #ifdef _WIN32 |
16 | # define EV_SELECT_USE_FD_SET 0 |
18 | # define EV_SELECT_USE_FD_SET 0 |
17 | # define NFDBITS PERL_NFDBITS |
19 | # define NFDBITS PERL_NFDBITS |
18 | # define fd_mask Perl_fd_mask |
20 | # define fd_mask Perl_fd_mask |
… | |
… | |
167 | PUSHs (sv_self); |
169 | PUSHs (sv_self); |
168 | PUSHs (sv_events); |
170 | PUSHs (sv_events); |
169 | |
171 | |
170 | PUTBACK; |
172 | PUTBACK; |
171 | call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL); |
173 | call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL); |
172 | SP = PL_stack_base + mark; PUTBACK; |
|
|
173 | |
174 | |
174 | SvREFCNT_dec (sv_self); |
175 | SvREFCNT_dec (sv_self); |
175 | SvREFCNT_dec (sv_status); |
176 | SvREFCNT_dec (sv_status); |
176 | |
177 | |
177 | if (sv_events_cache) |
178 | if (sv_events_cache) |
… | |
… | |
182 | if (SvTRUE (ERRSV)) |
183 | if (SvTRUE (ERRSV)) |
183 | { |
184 | { |
184 | PUSHMARK (SP); |
185 | PUSHMARK (SP); |
185 | PUTBACK; |
186 | PUTBACK; |
186 | call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); |
187 | call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); |
187 | SP = PL_stack_base + mark; PUTBACK; |
|
|
188 | } |
188 | } |
|
|
189 | |
|
|
190 | SP = PL_stack_base + mark; |
|
|
191 | PUTBACK; |
189 | } |
192 | } |
190 | |
193 | |
191 | static ev_tstamp |
194 | static ev_tstamp |
192 | e_periodic_cb (struct ev_periodic *w, ev_tstamp now) |
195 | e_periodic_cb (struct ev_periodic *w, ev_tstamp now) |
193 | { |
196 | { |
… | |
… | |
320 | const_iv (EV_, CHECK) |
323 | const_iv (EV_, CHECK) |
321 | const_iv (EV_, ERROR) |
324 | const_iv (EV_, ERROR) |
322 | |
325 | |
323 | const_iv (EV, LOOP_ONESHOT) |
326 | const_iv (EV, LOOP_ONESHOT) |
324 | const_iv (EV, LOOP_NONBLOCK) |
327 | const_iv (EV, LOOP_NONBLOCK) |
|
|
328 | const_iv (EV, UNLOOP_ONE) |
|
|
329 | const_iv (EV, UNLOOP_ALL) |
325 | |
330 | |
326 | const_iv (EV, METHOD_AUTO) |
|
|
327 | const_iv (EV, METHOD_SELECT) |
331 | const_iv (EV, METHOD_SELECT) |
328 | const_iv (EV, METHOD_POLL) |
332 | const_iv (EV, METHOD_POLL) |
329 | const_iv (EV, METHOD_EPOLL) |
333 | const_iv (EV, METHOD_EPOLL) |
330 | const_iv (EV, METHOD_KQUEUE) |
334 | const_iv (EV, METHOD_KQUEUE) |
331 | const_iv (EV, METHOD_DEVPOLL) |
335 | const_iv (EV, METHOD_DEVPOLL) |
332 | const_iv (EV, METHOD_PORT) |
336 | const_iv (EV, METHOD_PORT) |
|
|
337 | const_iv (EV, FLAG_AUTO) |
333 | const_iv (EV, METHOD_NOENV) |
338 | const_iv (EV, FLAG_NOENV) |
334 | }; |
339 | }; |
335 | |
340 | |
336 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
341 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
337 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
342 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
338 | |
343 | |
… | |
… | |
391 | |
396 | |
392 | int ev_method () |
397 | int ev_method () |
393 | |
398 | |
394 | NV ev_time () |
399 | NV ev_time () |
395 | |
400 | |
396 | int ev_default_loop (int methods = EVMETHOD_AUTO) |
401 | int ev_default_loop (int methods = EVFLAG_AUTO) |
397 | |
402 | |
398 | void ev_loop (int flags = 0) |
403 | void ev_loop (int flags = 0) |
399 | |
404 | |
400 | void ev_unloop (int how = 1) |
405 | void ev_unloop (int how = 1) |
401 | |
406 | |
… | |
… | |
484 | OUTPUT: |
489 | OUTPUT: |
485 | RETVAL |
490 | RETVAL |
486 | |
491 | |
487 | struct ev_child *child (int pid, SV *cb) |
492 | struct ev_child *child (int pid, SV *cb) |
488 | ALIAS: |
493 | ALIAS: |
489 | check_ns = 1 |
494 | child_ns = 1 |
490 | CODE: |
495 | CODE: |
491 | RETVAL = e_new (sizeof (struct ev_child), cb); |
496 | RETVAL = e_new (sizeof (struct ev_child), cb); |
492 | ev_child_set (RETVAL, pid); |
497 | ev_child_set (RETVAL, pid); |
493 | if (!ix) ev_child_start (RETVAL); |
498 | if (!ix) ev_child_start (RETVAL); |
494 | OUTPUT: |
499 | OUTPUT: |