ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV.xs
(Generate patch)

Comparing EV/EV.xs (file contents):
Revision 1.3 by root, Fri Oct 26 17:24:18 2007 UTC vs.
Revision 1.5 by root, Fri Oct 26 19:11:35 2007 UTC

7 7
8#include <sys/time.h> 8#include <sys/time.h>
9#include <time.h> 9#include <time.h>
10#include <event.h> 10#include <event.h>
11#include <evdns.h> 11#include <evdns.h>
12/*include <evhttp.h>*/ /* does not compile */ 12
13/* workaround for evhttp.h requiring obscure bsd headers */
14#ifndef TAILQ_ENTRY
15#define TAILQ_ENTRY(type) \
16struct { \
17 struct type *tqe_next; /* next element */ \
18 struct type **tqe_prev; /* address of previous next element */ \
19}
20#endif /* !TAILQ_ENTRY */
21#include <evhttp.h>
13 22
14#define EV_NONE 0 23#define EV_NONE 0
15#define EV_UNDEF -1 24#define EV_UNDEF -1
16 25
17#define TIMEOUT_NONE HUGE_VAL 26#define TIMEOUT_NONE HUGE_VAL
471 static const struct { 480 static const struct {
472 const char *name; 481 const char *name;
473 IV iv; 482 IV iv;
474 } *civ, const_iv[] = { 483 } *civ, const_iv[] = {
475# define const_iv(pfx, name) { # name, (IV) pfx ## name }, 484# define const_iv(pfx, name) { # name, (IV) pfx ## name },
476
477 const_iv (DNS_, ERR_NONE) 485 const_iv (DNS_, ERR_NONE)
478 const_iv (DNS_, ERR_FORMAT) 486 const_iv (DNS_, ERR_FORMAT)
479 const_iv (DNS_, ERR_SERVERFAILED) 487 const_iv (DNS_, ERR_SERVERFAILED)
480 const_iv (DNS_, ERR_NOTEXIST) 488 const_iv (DNS_, ERR_NOTEXIST)
481 const_iv (DNS_, ERR_NOTIMPL) 489 const_iv (DNS_, ERR_NOTIMPL)
552 560
553void evdns_search_add (char *domain) 561void evdns_search_add (char *domain)
554 562
555void evdns_search_ndots_set (int ndots) 563void evdns_search_ndots_set (int ndots)
556 564
565
566MODULE = EV PACKAGE = EV::HTTP PREFIX = evhttp_
567
568BOOT:
569{
570 HV *stash = gv_stashpv ("EV::HTTP", 1);
571
572 static const struct {
573 const char *name;
574 IV iv;
575 } *civ, const_iv[] = {
576# define const_iv(pfx, name) { # name, (IV) pfx ## name },
577 const_iv (HTTP_, OK)
578 const_iv (HTTP_, NOCONTENT)
579 const_iv (HTTP_, MOVEPERM)
580 const_iv (HTTP_, MOVETEMP)
581 const_iv (HTTP_, NOTMODIFIED)
582 const_iv (HTTP_, BADREQUEST)
583 const_iv (HTTP_, NOTFOUND)
584 const_iv (HTTP_, SERVUNAVAIL)
585 const_iv (EVHTTP_, REQ_OWN_CONNECTION)
586 const_iv (EVHTTP_, PROXY_REQUEST)
587 const_iv (EVHTTP_, REQ_GET)
588 const_iv (EVHTTP_, REQ_POST)
589 const_iv (EVHTTP_, REQ_HEAD)
590 const_iv (EVHTTP_, REQUEST)
591 const_iv (EVHTTP_, RESPONSE)
592 };
593
594 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
595 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
596}
597
598MODULE = EV PACKAGE = EV::HTTP::Request PREFIX = evhttp_request_
599
600#HttpRequest new (SV *klass, SV *cb)
601
602#void DESTROY (struct evhttp_request *req);
603
604
605
606
607
608
609
610

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines