… | |
… | |
5 | /*#include <netinet/in.h>*/ |
5 | /*#include <netinet/in.h>*/ |
6 | |
6 | |
7 | #define EV_PROTOTYPES 1 |
7 | #define EV_PROTOTYPES 1 |
8 | #include "EV/EVAPI.h" |
8 | #include "EV/EVAPI.h" |
9 | |
9 | |
10 | #include "libev/ev.c" |
10 | #include "ev.c" |
11 | #include "libev/event.h" |
|
|
12 | #include "libev/event.c" |
11 | #include "event.c" |
|
|
12 | #define DNS_USE_GETTIMEOFDAY_FOR_ID 1 |
|
|
13 | #define HAVE_STRUCT_IN6_ADDR 1 |
|
|
14 | #undef HAVE_STRTOK_R |
|
|
15 | #undef strtok_r |
|
|
16 | #define strtok_r fake_strtok_r |
13 | #include "libev/evdns.c" |
17 | #include "evdns.c" |
14 | |
18 | |
15 | typedef int Signal; |
19 | typedef int Signal; |
16 | |
20 | |
17 | static struct EVAPI evapi; |
21 | static struct EVAPI evapi; |
18 | |
22 | |
… | |
… | |
282 | /* the poor man's shared library emulator */ |
286 | /* the poor man's shared library emulator */ |
283 | evapi.ver = EV_API_VERSION; |
287 | evapi.ver = EV_API_VERSION; |
284 | evapi.rev = EV_API_REVISION; |
288 | evapi.rev = EV_API_REVISION; |
285 | evapi.sv_fileno = sv_fileno; |
289 | evapi.sv_fileno = sv_fileno; |
286 | evapi.sv_signum = sv_signum; |
290 | evapi.sv_signum = sv_signum; |
287 | evapi.now = &ev_now; |
291 | evapi.now = ev_now; |
288 | evapi.method = &ev_method; |
292 | evapi.method = ev_method; |
289 | evapi.loop_done = &ev_loop_done; |
293 | evapi.unloop = ev_unloop; |
290 | evapi.time = ev_time; |
294 | evapi.time = ev_time; |
291 | evapi.loop = ev_loop; |
295 | evapi.loop = ev_loop; |
292 | evapi.once = ev_once; |
296 | evapi.once = ev_once; |
293 | evapi.io_start = ev_io_start; |
297 | evapi.io_start = ev_io_start; |
294 | evapi.io_stop = ev_io_stop; |
298 | evapi.io_stop = ev_io_stop; |
… | |
… | |
310 | |
314 | |
311 | sv_setiv (sv, (IV)&evapi); |
315 | sv_setiv (sv, (IV)&evapi); |
312 | SvREADONLY_on (sv); |
316 | SvREADONLY_on (sv); |
313 | } |
317 | } |
314 | |
318 | |
315 | pthread_atfork (ev_fork_prepare, ev_fork_parent, ev_fork_child); |
319 | pthread_atfork (0, 0, ev_default_fork); |
316 | } |
320 | } |
317 | |
321 | |
318 | NV ev_now () |
322 | NV ev_now () |
319 | CODE: |
|
|
320 | RETVAL = ev_now; |
|
|
321 | OUTPUT: |
|
|
322 | RETVAL |
|
|
323 | |
323 | |
324 | int ev_method () |
324 | int ev_method () |
325 | CODE: |
|
|
326 | RETVAL = ev_method; |
|
|
327 | OUTPUT: |
|
|
328 | RETVAL |
|
|
329 | |
325 | |
330 | NV ev_time () |
326 | NV ev_time () |
331 | |
327 | |
332 | int ev_init (int methods = EVMETHOD_AUTO) |
328 | int ev_default_loop (int methods = EVMETHOD_AUTO) |
333 | |
329 | |
334 | void ev_loop (int flags = 0) |
330 | void ev_loop (int flags = 0) |
335 | |
331 | |
336 | void ev_loop_done (int value = 1) |
332 | void ev_unloop (int how = 1) |
337 | CODE: |
|
|
338 | ev_loop_done = value; |
|
|
339 | |
333 | |
340 | struct ev_io *io (SV *fh, int events, SV *cb) |
334 | struct ev_io *io (SV *fh, int events, SV *cb) |
341 | ALIAS: |
335 | ALIAS: |
342 | io_ns = 1 |
336 | io_ns = 1 |
343 | CODE: |
337 | CODE: |