HTTP-XSHeaders
view release on metacpan or search on metacpan
XSHeaders.xs view on Meta::CPAN
CODE:
GLOG(("=X= @@@ clear(%p|%d)", hl, hlist_size(hl)));
hlist_clear(hl);
#
# Get all the keys in an existing HList.
#
void
header_field_names(HList* hl)
PPCODE:
GLOG(("=X= @@@ header_field_names(%p|%d), want %d",
hl, hlist_size(hl), GIMME_V));
hlist_sort(hl);
PUTBACK;
return_hlist(aTHX_ hl, "header_field_names", GIMME_V);
SPAGAIN;
#
# init_header
XSHeaders.xs view on Meta::CPAN
PREINIT:
int argc = 0;
int j;
SV* pkey = 0;
SV* pval = 0;
STRLEN len;
char* ckey = 0;
HNode* n = 0;
HList* seen = 0; /* TODO: make this more efficient; use Perl hash? */
PPCODE:
GLOG(("=X= @@@ header(%p|%d), %d params, want %d",
hl, hlist_size(hl), argc, GIMME_V));
argc = items - 1;
do {
if (argc == 0) {
croak("header called with no arguments");
}
if (argc == 1) {
XSHeaders.xs view on Meta::CPAN
#
void
_header(HList* hl, ...)
PREINIT:
int argc = 0;
SV* pkey = 0;
STRLEN len;
char* ckey = 0;
HNode* n = 0;
PPCODE:
GLOG(("=X= @@@ header(%p|%d), %d params, want %d",
hl, hlist_size(hl), argc, GIMME_V));
argc = items - 1;
if (argc != 1) {
croak("_header not called with one argument");
}
pkey = ST(1);
if (!SvOK(pkey) || !SvPOK(pkey)) {
XSHeaders.xs view on Meta::CPAN
remove_header(HList* hl, ...)
PREINIT:
int argc = 0;
int j;
SV* pkey;
STRLEN len;
char* ckey;
int size = 0;
int total = 0;
PPCODE:
GLOG(("=X= @@@ remove_header(%p|%d), %d params, want %d",
hl, hlist_size(hl), argc, GIMME_V));
argc = items - 1;
for (j = 1; j <= argc; ++j) {
pkey = ST(j);
ckey = SvPV(pkey, len);
HNode* n = hlist_get(hl, ckey);
if (!n) {
( run in 1.420 second using v1.01-cache-2.11-cpan-5511b514fd6 )