ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV.xs
Revision: 1.37
Committed: Thu Nov 1 17:17:32 2007 UTC (16 years, 6 months ago) by root
Branch: MAIN
Changes since 1.36: +1 -1 lines
Log Message:
created new documentation

File Contents

# Content
1 #include "EXTERN.h"
2 #include "perl.h"
3 #include "XSUB.h"
4
5 /*#include <netinet/in.h>*/
6
7 #define TIMEOUT_NONE HUGE_VAL
8
9 #define EV_PROTOTYPES 1
10 #include "EV/EVAPI.h"
11
12 #include "libev/ev.c"
13 #include "libev/event.h"
14 #include "libev/event.c"
15
16 #define DNS_USE_GETTIMEOFDAY_FOR_ID 1
17 #define HAVE_STRUCT_IN6_ADDR 1
18 #define HAVE_STRTOK_R 1
19 #include "libev/evdns.c"
20
21 typedef int Signal;
22
23 static struct EVAPI evapi;
24
25 static HV
26 *stash_watcher,
27 *stash_io,
28 *stash_timer,
29 *stash_periodic,
30 *stash_signal,
31 *stash_idle,
32 *stash_prepare,
33 *stash_check,
34 *stash_child;
35
36 static int
37 sv_signum (SV *sig)
38 {
39 int signum;
40
41 SvGETMAGIC (sig);
42
43 for (signum = 1; signum < SIG_SIZE; ++signum)
44 if (strEQ (SvPV_nolen (sig), PL_sig_name [signum]))
45 return signum;
46
47 if (SvIV (sig) > 0)
48 return SvIV (sig);
49
50 return -1;
51 }
52
53 /////////////////////////////////////////////////////////////////////////////
54 // Event
55
56 static void e_cb (struct ev_watcher *w, int revents);
57
58 static int
59 sv_fileno (SV *fh)
60 {
61 SvGETMAGIC (fh);
62
63 if (SvROK (fh))
64 fh = SvRV (fh);
65
66 if (SvTYPE (fh) == SVt_PVGV)
67 return PerlIO_fileno (IoIFP (sv_2io (fh)));
68
69 if ((SvIV (fh) >= 0) && (SvIV (fh) < 0x7ffffff))
70 return SvIV (fh);
71
72 return -1;
73 }
74
75 static void *
76 e_new (int size, SV *cb_sv)
77 {
78 struct ev_watcher *w;
79 SV *self = NEWSV (0, size);
80 SvPOK_only (self);
81 SvCUR_set (self, size);
82
83 w = (struct ev_watcher *)SvPVX (self);
84
85 ev_watcher_init (w, e_cb);
86
87 w->fh = 0;
88 w->cb_sv = newSVsv (cb_sv);
89 w->self = self;
90
91 return (void *)w;
92 }
93
94 static void *
95 e_destroy (void *w_)
96 {
97 struct ev_watcher *w = w_;
98
99 SvREFCNT_dec (w->fh ); w->fh = 0;
100 SvREFCNT_dec (w->cb_sv); w->cb_sv = 0;
101 }
102
103 static SV *
104 e_bless (struct ev_watcher *w, HV *stash)
105 {
106 SV *rv;
107
108 if (SvOBJECT (w->self))
109 rv = newRV_inc (w->self);
110 else
111 {
112 rv = newRV_noinc (w->self);
113 sv_bless (rv, stash);
114 SvREADONLY_on (w->self);
115 }
116
117 return rv;
118 }
119
120 static void
121 e_cb (struct ev_watcher *w, int revents)
122 {
123 dSP;
124 I32 mark = SP - PL_stack_base;
125 SV *sv_self, *sv_events, *sv_status = 0;
126 static SV *sv_events_cache;
127
128 sv_self = newRV_inc (w->self); /* w->self MUST be blessed by now */
129
130 if (sv_events_cache)
131 {
132 sv_events = sv_events_cache; sv_events_cache = 0;
133 SvIV_set (sv_events, revents);
134 }
135 else
136 sv_events = newSViv (revents);
137
138 PUSHMARK (SP);
139 EXTEND (SP, 2);
140 PUSHs (sv_self);
141 PUSHs (sv_events);
142
143 if (revents & EV_CHILD)
144 XPUSHs (sv_status = newSViv (((struct ev_child *)w)->status));
145
146 PUTBACK;
147 call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL);
148 SP = PL_stack_base + mark; PUTBACK;
149
150 SvREFCNT_dec (sv_self);
151 SvREFCNT_dec (sv_status);
152
153 if (sv_events_cache)
154 SvREFCNT_dec (sv_events);
155 else
156 sv_events_cache = sv_events;
157
158 if (SvTRUE (ERRSV))
159 {
160 PUSHMARK (SP);
161 PUTBACK;
162 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR);
163 SP = PL_stack_base + mark; PUTBACK;
164 }
165 }
166
167 /////////////////////////////////////////////////////////////////////////////
168 // DNS
169
170 static void
171 dns_cb (int result, char type, int count, int ttl, void *addresses, void *arg)
172 {
173 dSP;
174 SV *cb = (SV *)arg;
175
176 ENTER;
177 SAVETMPS;
178 PUSHMARK (SP);
179 EXTEND (SP, count + 3);
180 PUSHs (sv_2mortal (newSViv (result)));
181
182 if (result == DNS_ERR_NONE && ttl >= 0)
183 {
184 int i;
185
186 PUSHs (sv_2mortal (newSViv (type)));
187 PUSHs (sv_2mortal (newSViv (ttl)));
188
189 for (i = 0; i < count; ++i)
190 switch (type)
191 {
192 case DNS_IPv6_AAAA:
193 PUSHs (sv_2mortal (newSVpvn (i * 16 + (char *)addresses, 16)));
194 break;
195 case DNS_IPv4_A:
196 PUSHs (sv_2mortal (newSVpvn (i * 4 + (char *)addresses, 4)));
197 break;
198 case DNS_PTR:
199 PUSHs (sv_2mortal (newSVpv (*(char **)addresses, 0)));
200 break;
201 }
202 }
203
204 PUTBACK;
205 call_sv (sv_2mortal (cb), G_DISCARD | G_VOID | G_EVAL);
206
207 FREETMPS;
208
209 if (SvTRUE (ERRSV))
210 {
211 PUSHMARK (SP);
212 PUTBACK;
213 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR);
214 }
215
216 LEAVE;
217 }
218
219 #define CHECK_REPEAT(repeat) if (repeat < 0.) \
220 croak (# repeat " value must be >= 0");
221
222 #define CHECK_FD(fh,fd) if ((fd) < 0) \
223 croak ("illegal file descriptor or filehandle (either no attached file descriptor or illegal value): %s", SvPV_nolen (fh));
224
225 /////////////////////////////////////////////////////////////////////////////
226 // XS interface functions
227
228 MODULE = EV PACKAGE = EV PREFIX = ev_
229
230 PROTOTYPES: ENABLE
231
232 BOOT:
233 {
234 int i;
235 HV *stash = gv_stashpv ("EV", 1);
236
237 static const struct {
238 const char *name;
239 IV iv;
240 } *civ, const_iv[] = {
241 # define const_iv(pfx, name) { # name, (IV) pfx ## name },
242 const_iv (EV_, UNDEF)
243 const_iv (EV_, NONE)
244 const_iv (EV_, TIMEOUT)
245 const_iv (EV_, READ)
246 const_iv (EV_, WRITE)
247 const_iv (EV_, SIGNAL)
248 const_iv (EV_, IDLE)
249 const_iv (EV_, CHECK)
250 const_iv (EV_, ERROR)
251
252 const_iv (EV, LOOP_ONESHOT)
253 const_iv (EV, LOOP_NONBLOCK)
254
255 const_iv (EV, METHOD_NONE)
256 const_iv (EV, METHOD_SELECT)
257 const_iv (EV, METHOD_EPOLL)
258 };
259
260 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
261 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
262
263 stash_watcher = gv_stashpv ("EV::Watcher" , 1);
264 stash_io = gv_stashpv ("EV::Io" , 1);
265 stash_timer = gv_stashpv ("EV::Timer" , 1);
266 stash_periodic = gv_stashpv ("EV::Periodic", 1);
267 stash_signal = gv_stashpv ("EV::Signal" , 1);
268 stash_idle = gv_stashpv ("EV::Idle" , 1);
269 stash_prepare = gv_stashpv ("EV::Prepare" , 1);
270 stash_check = gv_stashpv ("EV::Check" , 1);
271 stash_child = gv_stashpv ("EV::Child" , 1);
272
273 {
274 SV *sv = perl_get_sv ("EV::API", TRUE);
275 perl_get_sv ("EV::API", TRUE); /* silence 5.10 warning */
276
277 /* the poor man's shared library emulator */
278 evapi.ver = EV_API_VERSION;
279 evapi.rev = EV_API_REVISION;
280 evapi.sv_fileno = sv_fileno;
281 evapi.sv_signum = sv_signum;
282 evapi.now = &ev_now;
283 evapi.method = &ev_method;
284 evapi.loop_done = &ev_loop_done;
285 evapi.time = ev_time;
286 evapi.loop = ev_loop;
287 evapi.once = ev_once;
288 evapi.io_start = ev_io_start;
289 evapi.io_stop = ev_io_stop;
290 evapi.timer_start = ev_timer_start;
291 evapi.timer_stop = ev_timer_stop;
292 evapi.timer_again = ev_timer_again;
293 evapi.periodic_start = ev_periodic_start;
294 evapi.periodic_stop = ev_periodic_stop;
295 evapi.signal_start = ev_signal_start;
296 evapi.signal_stop = ev_signal_stop;
297 evapi.idle_start = ev_idle_start;
298 evapi.idle_stop = ev_idle_stop;
299 evapi.prepare_start = ev_prepare_start;
300 evapi.prepare_stop = ev_prepare_stop;
301 evapi.check_start = ev_check_start;
302 evapi.check_stop = ev_check_stop;
303 evapi.child_start = ev_child_start;
304 evapi.child_stop = ev_child_stop;
305
306 sv_setiv (sv, (IV)&evapi);
307 SvREADONLY_on (sv);
308 }
309
310 pthread_atfork (ev_fork_prepare, ev_fork_parent, ev_fork_child);
311 }
312
313 NV ev_now ()
314 CODE:
315 RETVAL = ev_now;
316 OUTPUT:
317 RETVAL
318
319 int ev_method ()
320 CODE:
321 RETVAL = ev_method;
322 OUTPUT:
323 RETVAL
324
325 NV ev_time ()
326
327 void ev_init (int flags = 0)
328
329 void ev_loop (int flags = 0)
330
331 void ev_loop_done (int value = 1)
332 CODE:
333 ev_loop_done = value;
334
335 struct ev_io *io (SV *fh, int events, SV *cb)
336 ALIAS:
337 io_ns = 1
338 CODE:
339 {
340 int fd = sv_fileno (fh);
341 CHECK_FD (fh, fd);
342
343 RETVAL = e_new (sizeof (struct ev_io), cb);
344 RETVAL->fh = newSVsv (fh);
345 ev_io_set (RETVAL, fd, events);
346 if (!ix) ev_io_start (RETVAL);
347 }
348 OUTPUT:
349 RETVAL
350
351 struct ev_timer *timer (NV after, NV repeat, SV *cb)
352 ALIAS:
353 timer_ns = 1
354 INIT:
355 CHECK_REPEAT (repeat);
356 CODE:
357 RETVAL = e_new (sizeof (struct ev_timer), cb);
358 ev_timer_set (RETVAL, after, repeat);
359 if (!ix) ev_timer_start (RETVAL);
360 OUTPUT:
361 RETVAL
362
363 struct ev_periodic *periodic (NV at, NV interval, SV *cb)
364 ALIAS:
365 periodic_ns = 1
366 INIT:
367 CHECK_REPEAT (interval);
368 CODE:
369 RETVAL = e_new (sizeof (struct ev_periodic), cb);
370 ev_periodic_set (RETVAL, at, interval);
371 if (!ix) ev_periodic_start (RETVAL);
372 OUTPUT:
373 RETVAL
374
375 struct ev_signal *signal (Signal signum, SV *cb)
376 ALIAS:
377 signal_ns = 1
378 CODE:
379 RETVAL = e_new (sizeof (struct ev_signal), cb);
380 ev_signal_set (RETVAL, signum);
381 if (!ix) ev_signal_start (RETVAL);
382 OUTPUT:
383 RETVAL
384
385 struct ev_idle *idle (SV *cb)
386 ALIAS:
387 idle_ns = 1
388 CODE:
389 RETVAL = e_new (sizeof (struct ev_idle), cb);
390 ev_idle_set (RETVAL);
391 if (!ix) ev_idle_start (RETVAL);
392 OUTPUT:
393 RETVAL
394
395 struct ev_prepare *prepare (SV *cb)
396 ALIAS:
397 prepare_ns = 1
398 CODE:
399 RETVAL = e_new (sizeof (struct ev_prepare), cb);
400 ev_prepare_set (RETVAL);
401 if (!ix) ev_prepare_start (RETVAL);
402 OUTPUT:
403 RETVAL
404
405 struct ev_check *check (SV *cb)
406 ALIAS:
407 check_ns = 1
408 CODE:
409 RETVAL = e_new (sizeof (struct ev_check), cb);
410 ev_check_set (RETVAL);
411 if (!ix) ev_check_start (RETVAL);
412 OUTPUT:
413 RETVAL
414
415 struct ev_child *child (int pid, SV *cb)
416 ALIAS:
417 check_ns = 1
418 CODE:
419 RETVAL = e_new (sizeof (struct ev_check), cb);
420 ev_child_set (RETVAL, pid);
421 if (!ix) ev_child_start (RETVAL);
422 OUTPUT:
423 RETVAL
424
425
426 PROTOTYPES: DISABLE
427
428 MODULE = EV PACKAGE = EV::Watcher PREFIX = ev_
429
430 int ev_is_active (struct ev_watcher *w)
431
432 SV *cb (struct ev_watcher *w, SV *new_cb = 0)
433 CODE:
434 {
435 RETVAL = newSVsv (w->cb_sv);
436
437 if (items > 1)
438 sv_setsv (w->cb_sv, new_cb);
439 }
440 OUTPUT:
441 RETVAL
442
443 void trigger (struct ev_watcher *w, int revents = EV_NONE)
444 CODE:
445 w->cb (w, revents);
446
447 MODULE = EV PACKAGE = EV::Io PREFIX = ev_io_
448
449 void ev_io_start (struct ev_io *w)
450
451 void ev_io_stop (struct ev_io *w)
452
453 void DESTROY (struct ev_io *w)
454 CODE:
455 ev_io_stop (w);
456 e_destroy (w);
457
458 void set (struct ev_io *w, SV *fh, int events)
459 CODE:
460 {
461 int active = w->active;
462 int fd = sv_fileno (fh);
463 CHECK_FD (fh, fd);
464
465 if (active) ev_io_stop (w);
466
467 sv_setsv (w->fh, fh);
468 ev_io_set (w, fd, events);
469
470 if (active) ev_io_start (w);
471 }
472
473 SV *fh (struct ev_io *w, SV *new_fh = 0)
474 CODE:
475 {
476 RETVAL = newSVsv (w->fh);
477
478 if (items > 1)
479 {
480 int active = w->active;
481 if (active) ev_io_stop (w);
482
483 sv_setsv (w->fh, new_fh);
484 ev_io_set (w, sv_fileno (w->fh), w->events);
485
486 if (active) ev_io_start (w);
487 }
488 }
489 OUTPUT:
490 RETVAL
491
492 int events (struct ev_io *w, int new_events = EV_UNDEF)
493 CODE:
494 {
495 RETVAL = w->events;
496
497 if (items > 1)
498 {
499 int active = w->active;
500 if (active) ev_io_stop (w);
501
502 ev_io_set (w, w->fd, new_events);
503
504 if (active) ev_io_start (w);
505 }
506 }
507 OUTPUT:
508 RETVAL
509
510 MODULE = EV PACKAGE = EV::Signal PREFIX = ev_signal_
511
512 void ev_signal_start (struct ev_signal *w)
513
514 void ev_signal_stop (struct ev_signal *w)
515
516 void DESTROY (struct ev_signal *w)
517 CODE:
518 ev_signal_stop (w);
519 e_destroy (w);
520
521 void set (struct ev_signal *w, SV *signal = 0)
522 CODE:
523 {
524 Signal signum = sv_signum (signal); /* may croak here */
525 int active = w->active;
526
527 if (active) ev_signal_stop (w);
528 ev_signal_set (w, signum);
529 if (active) ev_signal_start (w);
530 }
531
532 MODULE = EV PACKAGE = EV::Time
533
534 MODULE = EV PACKAGE = EV::Timer PREFIX = ev_timer_
535
536 void ev_timer_start (struct ev_timer *w)
537 INIT:
538 CHECK_REPEAT (w->repeat);
539
540 void ev_timer_stop (struct ev_timer *w)
541
542 void ev_timer_again (struct ev_timer *w)
543 INIT:
544 CHECK_REPEAT (w->repeat);
545
546 void DESTROY (struct ev_timer *w)
547 CODE:
548 ev_timer_stop (w);
549 e_destroy (w);
550
551 void set (struct ev_timer *w, NV after, NV repeat = 0.)
552 INIT:
553 CHECK_REPEAT (repeat);
554 CODE:
555 {
556 int active = w->active;
557 if (active) ev_timer_stop (w);
558 ev_timer_set (w, after, repeat);
559 if (active) ev_timer_start (w);
560 }
561
562 MODULE = EV PACKAGE = EV::Periodic PREFIX = ev_periodic_
563
564 void ev_periodic_start (struct ev_periodic *w)
565 INIT:
566 CHECK_REPEAT (w->interval);
567
568 void ev_periodic_stop (struct ev_periodic *w)
569
570 void DESTROY (struct ev_periodic *w)
571 CODE:
572 ev_periodic_stop (w);
573 e_destroy (w);
574
575 void set (struct ev_periodic *w, NV at, NV interval = 0.)
576 INIT:
577 CHECK_REPEAT (interval);
578 CODE:
579 {
580 int active = w->active;
581 if (active) ev_periodic_stop (w);
582 ev_periodic_set (w, at, interval);
583 if (active) ev_periodic_start (w);
584 }
585
586 MODULE = EV PACKAGE = EV::Idle PREFIX = ev_idle_
587
588 void ev_idle_start (struct ev_idle *w)
589
590 void ev_idle_stop (struct ev_idle *w)
591
592 void DESTROY (struct ev_idle *w)
593 CODE:
594 ev_idle_stop (w);
595 e_destroy (w);
596
597 MODULE = EV PACKAGE = EV::Prepare PREFIX = ev_check_
598
599 void ev_prepare_start (struct ev_prepare *w)
600
601 void ev_prepare_stop (struct ev_prepare *w)
602
603 void DESTROY (struct ev_prepare *w)
604 CODE:
605 ev_prepare_stop (w);
606 e_destroy (w);
607
608 MODULE = EV PACKAGE = EV::Check PREFIX = ev_check_
609
610 void ev_check_start (struct ev_check *w)
611
612 void ev_check_stop (struct ev_check *w)
613
614 void DESTROY (struct ev_check *w)
615 CODE:
616 ev_check_stop (w);
617 e_destroy (w);
618
619 MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_
620
621 void ev_child_start (struct ev_child *w)
622
623 void ev_child_stop (struct ev_child *w)
624
625 void DESTROY (struct ev_child *w)
626 CODE:
627 ev_child_stop (w);
628 e_destroy (w);
629
630 void set (struct ev_child *w, int pid)
631 CODE:
632 {
633 int active = w->active;
634 if (active) ev_child_stop (w);
635 ev_child_set (w, pid);
636 if (active) ev_child_start (w);
637 }
638
639 int status (struct ev_child *w)
640 CODE:
641 RETVAL = w->status;
642 OUTPUT:
643 RETVAL
644
645 MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_
646
647 BOOT:
648 {
649 HV *stash = gv_stashpv ("EV::DNS", 1);
650
651 static const struct {
652 const char *name;
653 IV iv;
654 } *civ, const_iv[] = {
655 # define const_iv(pfx, name) { # name, (IV) pfx ## name },
656 const_iv (DNS_, ERR_NONE)
657 const_iv (DNS_, ERR_FORMAT)
658 const_iv (DNS_, ERR_SERVERFAILED)
659 const_iv (DNS_, ERR_NOTEXIST)
660 const_iv (DNS_, ERR_NOTIMPL)
661 const_iv (DNS_, ERR_REFUSED)
662 const_iv (DNS_, ERR_TRUNCATED)
663 const_iv (DNS_, ERR_UNKNOWN)
664 const_iv (DNS_, ERR_TIMEOUT)
665 const_iv (DNS_, ERR_SHUTDOWN)
666 const_iv (DNS_, IPv4_A)
667 const_iv (DNS_, PTR)
668 const_iv (DNS_, IPv6_AAAA)
669 const_iv (DNS_, QUERY_NO_SEARCH)
670 const_iv (DNS_, OPTION_SEARCH)
671 const_iv (DNS_, OPTION_NAMESERVERS)
672 const_iv (DNS_, OPTION_MISC)
673 const_iv (DNS_, OPTIONS_ALL)
674 const_iv (DNS_, NO_SEARCH)
675 };
676
677 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
678 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
679 }
680
681 int evdns_init ()
682
683 void evdns_shutdown (int fail_requests = 1)
684
685 const char *evdns_err_to_string (int err)
686
687 int evdns_nameserver_add (U32 address)
688
689 int evdns_count_nameservers ()
690
691 int evdns_clear_nameservers_and_suspend ()
692
693 int evdns_resume ()
694
695 int evdns_nameserver_ip_add (char *ip_as_string)
696
697 int evdns_resolve_ipv4 (const char *name, int flags, SV *cb)
698 C_ARGS: name, flags, dns_cb, (void *)SvREFCNT_inc (cb)
699
700 int evdns_resolve_ipv6 (const char *name, int flags, SV *cb)
701 C_ARGS: name, flags, dns_cb, (void *)SvREFCNT_inc (cb)
702
703 int evdns_resolve_reverse (SV *addr, int flags, SV *cb)
704 ALIAS:
705 evdns_resolve_reverse_ipv6 = 1
706 CODE:
707 {
708 STRLEN len;
709 char *data = SvPVbyte (addr, len);
710 if (len != (ix ? 16 : 4))
711 croak ("ipv4/ipv6 address to be resolved must be given as 4/16 byte octet string");
712
713 RETVAL = ix
714 ? evdns_resolve_reverse_ipv6 ((struct in6_addr *)data, flags, dns_cb, (void *)SvREFCNT_inc (cb))
715 : evdns_resolve_reverse ((struct in_addr *)data, flags, dns_cb, (void *)SvREFCNT_inc (cb));
716 }
717 OUTPUT:
718 RETVAL
719
720 int evdns_set_option (char *option, char *val, int flags)
721
722 int evdns_resolv_conf_parse (int flags, const char *filename)
723
724 #ifdef MS_WINDOWS
725
726 int evdns_config_windows_nameservers ()
727
728 #endif
729
730 void evdns_search_clear ()
731
732 void evdns_search_add (char *domain)
733
734 void evdns_search_ndots_set (int ndots)
735
736 #if 0
737
738 MODULE = EV PACKAGE = EV::HTTP PREFIX = evhttp_
739
740 BOOT:
741 {
742 HV *stash = gv_stashpv ("EV::HTTP", 1);
743
744 static const struct {
745 const char *name;
746 IV iv;
747 } *civ, const_iv[] = {
748 # define const_iv(pfx, name) { # name, (IV) pfx ## name },
749 const_iv (HTTP_, OK)
750 const_iv (HTTP_, NOCONTENT)
751 const_iv (HTTP_, MOVEPERM)
752 const_iv (HTTP_, MOVETEMP)
753 const_iv (HTTP_, NOTMODIFIED)
754 const_iv (HTTP_, BADREQUEST)
755 const_iv (HTTP_, NOTFOUND)
756 const_iv (HTTP_, SERVUNAVAIL)
757 const_iv (EVHTTP_, REQ_OWN_CONNECTION)
758 const_iv (EVHTTP_, PROXY_REQUEST)
759 const_iv (EVHTTP_, REQ_GET)
760 const_iv (EVHTTP_, REQ_POST)
761 const_iv (EVHTTP_, REQ_HEAD)
762 const_iv (EVHTTP_, REQUEST)
763 const_iv (EVHTTP_, RESPONSE)
764 };
765
766 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
767 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
768 }
769
770 MODULE = EV PACKAGE = EV::HTTP::Request PREFIX = evhttp_request_
771
772 #HttpRequest new (SV *klass, SV *cb)
773
774 #void DESTROY (struct evhttp_request *req);
775
776 #endif
777
778
779
780
781
782
783
784