1 | #include "EXTERN.h" |
1 | #include "EXTERN.h" |
2 | #include "perl.h" |
2 | #include "perl.h" |
3 | #include "XSUB.h" |
3 | #include "XSUB.h" |
4 | |
4 | |
5 | /*#include <netinet/in.h>*/ |
5 | /*#include <netinet/in.h>*/ |
|
|
6 | |
|
|
7 | /* fix perl api breakage */ |
|
|
8 | #undef signal |
|
|
9 | #undef sigaction |
6 | |
10 | |
7 | #define EV_PROTOTYPES 1 |
11 | #define EV_PROTOTYPES 1 |
8 | #define EV_USE_NANOSLEEP EV_USE_MONOTONIC |
12 | #define EV_USE_NANOSLEEP EV_USE_MONOTONIC |
9 | #define EV_H <ev.h> |
13 | #define EV_H <ev.h> |
10 | #include "EV/EVAPI.h" |
14 | #include "EV/EVAPI.h" |
11 | |
|
|
12 | /* fix perl api breakage */ |
|
|
13 | #undef signal |
|
|
14 | #undef sigaction |
|
|
15 | |
15 | |
16 | #define EV_SELECT_IS_WINSOCKET 0 |
16 | #define EV_SELECT_IS_WINSOCKET 0 |
17 | #ifdef _WIN32 |
17 | #ifdef _WIN32 |
18 | # define EV_SELECT_USE_FD_SET 0 |
18 | # define EV_SELECT_USE_FD_SET 0 |
19 | # define NFDBITS PERL_NFDBITS |
19 | # define NFDBITS PERL_NFDBITS |
… | |
… | |
390 | evapi.sv_fileno = sv_fileno; |
390 | evapi.sv_fileno = sv_fileno; |
391 | evapi.sv_signum = sv_signum; |
391 | evapi.sv_signum = sv_signum; |
392 | evapi.supported_backends = ev_supported_backends (); |
392 | evapi.supported_backends = ev_supported_backends (); |
393 | evapi.recommended_backends = ev_recommended_backends (); |
393 | evapi.recommended_backends = ev_recommended_backends (); |
394 | evapi.embeddable_backends = ev_embeddable_backends (); |
394 | evapi.embeddable_backends = ev_embeddable_backends (); |
395 | evapi.time = ev_time; |
395 | evapi.time_ = ev_time; |
396 | evapi.sleep = ev_sleep; |
396 | evapi.sleep_ = ev_sleep; |
397 | evapi.loop_new = ev_loop_new; |
397 | evapi.loop_new = ev_loop_new; |
398 | evapi.loop_destroy = ev_loop_destroy; |
398 | evapi.loop_destroy = ev_loop_destroy; |
399 | evapi.loop_fork = ev_loop_fork; |
399 | evapi.loop_fork = ev_loop_fork; |
400 | evapi.loop_count = ev_loop_count; |
400 | evapi.loop_count = ev_loop_count; |
401 | evapi.now = ev_now; |
401 | evapi.now = ev_now; |
… | |
… | |
889 | INIT: |
889 | INIT: |
890 | CHECK_REPEAT (repeat); |
890 | CHECK_REPEAT (repeat); |
891 | CODE: |
891 | CODE: |
892 | RESET (timer, w, (w, after, repeat)); |
892 | RESET (timer, w, (w, after, repeat)); |
893 | |
893 | |
894 | NV at (ev_timer *w) |
|
|
895 | CODE: |
|
|
896 | RETVAL = w->at; |
|
|
897 | OUTPUT: |
|
|
898 | RETVAL |
|
|
899 | |
|
|
900 | MODULE = EV PACKAGE = EV::Periodic PREFIX = ev_periodic_ |
894 | MODULE = EV PACKAGE = EV::Periodic PREFIX = ev_periodic_ |
901 | |
895 | |
902 | void ev_periodic_start (ev_periodic *w) |
896 | void ev_periodic_start (ev_periodic *w) |
903 | INIT: |
897 | INIT: |
904 | CHECK_REPEAT (w->interval); |
898 | CHECK_REPEAT (w->interval); |
… | |
… | |
931 | RESET (periodic, w, (w, at, interval, w->fh ? e_periodic_cb : 0)); |
925 | RESET (periodic, w, (w, at, interval, w->fh ? e_periodic_cb : 0)); |
932 | } |
926 | } |
933 | |
927 | |
934 | NV at (ev_periodic *w) |
928 | NV at (ev_periodic *w) |
935 | CODE: |
929 | CODE: |
936 | RETVAL = w->at; |
930 | RETVAL = ev_periodic_at (w); |
937 | OUTPUT: |
931 | OUTPUT: |
938 | RETVAL |
932 | RETVAL |
939 | |
933 | |
940 | MODULE = EV PACKAGE = EV::Idle PREFIX = ev_idle_ |
934 | MODULE = EV PACKAGE = EV::Idle PREFIX = ev_idle_ |
941 | |
935 | |
… | |
… | |
1147 | CODE: |
1141 | CODE: |
1148 | RETVAL = newSVsv (w->fh); |
1142 | RETVAL = newSVsv (w->fh); |
1149 | OUTPUT: |
1143 | OUTPUT: |
1150 | RETVAL |
1144 | RETVAL |
1151 | |
1145 | |
|
|
1146 | void ev_embed_sweep (ev_embed *w) |
|
|
1147 | C_ARGS: e_loop (w), w |
|
|
1148 | |
1152 | MODULE = EV PACKAGE = EV::Async PREFIX = ev_async_ |
1149 | MODULE = EV PACKAGE = EV::Async PREFIX = ev_async_ |
1153 | |
1150 | |
1154 | void ev_async_start (ev_async *w) |
1151 | void ev_async_start (ev_async *w) |
1155 | CODE: |
1152 | CODE: |
1156 | START (async, w); |
1153 | START (async, w); |
… | |
… | |
1161 | |
1158 | |
1162 | void DESTROY (ev_async *w) |
1159 | void DESTROY (ev_async *w) |
1163 | CODE: |
1160 | CODE: |
1164 | STOP (async, w); |
1161 | STOP (async, w); |
1165 | e_destroy (w); |
1162 | e_destroy (w); |
|
|
1163 | |
|
|
1164 | void ev_async_send (ev_async *w) |
|
|
1165 | C_ARGS: e_loop (w), w |
|
|
1166 | |
|
|
1167 | SV *ev_async_async_pending (ev_async *w) |
|
|
1168 | CODE: |
|
|
1169 | RETVAL = boolSV (ev_async_pending (w)); |
|
|
1170 | OUTPUT: |
|
|
1171 | RETVAL |
1166 | |
1172 | |
1167 | MODULE = EV PACKAGE = EV::Loop PREFIX = ev_ |
1173 | MODULE = EV PACKAGE = EV::Loop PREFIX = ev_ |
1168 | |
1174 | |
1169 | SV *new (SV *klass, unsigned int flags = 0) |
1175 | SV *new (SV *klass, unsigned int flags = 0) |
1170 | CODE: |
1176 | CODE: |