/* * This file was generated automatically by ExtUtils::ParseXS version 2.21 from the * contents of Response.xs. Do not edit this file, edit Response.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "Response.xs" /* * *********** WARNING ************** * This file generated by ModPerl::WrapXS/0.01 * Any changes made here will be lost * *********************************** * 01: lib/ModPerl/WrapXS.pm:540 * 02: lib/ModPerl/WrapXS.pm:1174 * 03: Makefile.PL:423 * 04: Makefile.PL:325 * 05: Makefile.PL:56 */ #define MP_IN_XS #include "mod_perl.h" #include "modperl_xs_sv_convert.h" #include "modperl_xs_util.h" #include "modperl_xs_typedefs.h" #include "Apache2/Response/Apache2__Response.h" #line 38 "Response.c" #ifndef PERL_UNUSED_VAR # define PERL_UNUSED_VAR(var) if (0) var = var #endif #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params) /* prototype to pass -Wmissing-prototypes */ STATIC void S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params); STATIC void S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params) { const GV *const gv = CvGV(cv); PERL_ARGS_ASSERT_CROAK_XS_USAGE; if (gv) { const char *const gvname = GvNAME(gv); const HV *const stash = GvSTASH(gv); const char *const hvname = stash ? HvNAME(stash) : NULL; if (hvname) Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params); else Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params); } else { /* Pants. I don't think that it should be possible to get here. */ Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params); } } #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE #ifdef PERL_IMPLICIT_CONTEXT #define croak_xs_usage(a,b) S_croak_xs_usage(aTHX_ a,b) #else #define croak_xs_usage S_croak_xs_usage #endif #endif /* NOTE: the prototype of newXSproto() is different in versions of perls, * so we define a portable version of newXSproto() */ #ifdef newXS_flags #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0) #else #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv) #endif /* !defined(newXS_flags) */ #line 90 "Response.c" XS(XS_Apache2__RequestRec_custom_response); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_custom_response) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) croak_xs_usage(cv, "r, status, string"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); int status = (int)SvIV(ST(1)); const char * string = (const char *)SvPV_nolen(ST(2)); ap_custom_response(r, status, string); } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_make_etag); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_make_etag) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 2) croak_xs_usage(cv, "r, force_weak=0"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); int force_weak; char * RETVAL; dXSTARG; if (items < 2) force_weak = 0; else { force_weak = (int)SvIV(ST(1)); } #line 46 "Response.xs" RETVAL = ap_make_etag(r, force_weak); #line 137 "Response.c" sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; } XSRETURN(1); } XS(XS_Apache2__RequestRec_meets_conditions); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_meets_conditions) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "r"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); int RETVAL; dXSTARG; RETVAL = ap_meets_conditions(r); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Apache2__RequestRec_rationalize_mtime); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_rationalize_mtime) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "r, mtime"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); apr_time_t mtime = (apr_time_t)(apr_time_from_sec(SvNV(ST(1)))); apr_time_t RETVAL; dXSTARG; RETVAL = ap_rationalize_mtime(r, mtime); XSprePUSH; PUSHn((NV)(apr_time_sec(RETVAL))); } XSRETURN(1); } XS(XS_Apache2__RequestRec_send_error_response); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_send_error_response) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "r, recursive_error"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); int recursive_error = (int)SvIV(ST(1)); ap_send_error_response(r, recursive_error); } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_send_mmap); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_send_mmap) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 4) croak_xs_usage(cv, "r, mm, offset, length"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); APR__Mmap mm; size_t offset = (size_t)SvIV(ST(2)); size_t length = (size_t)SvIV(ST(3)); size_t RETVAL; dXSTARG; if (sv_derived_from(ST(1), "APR::Mmap")) { IV tmp = SvIV((SV*)SvRV(ST(1))); mm = INT2PTR(APR__Mmap,tmp); } else Perl_croak(aTHX_ "%s: %s is not of type %s", "Apache2::RequestRec::send_mmap", "mm", "APR::Mmap"); #line 85 "Response.xs" RETVAL = ap_send_mmap(mm, r, offset, length); #line 238 "Response.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Apache2__RequestRec_set_content_length); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_set_content_length) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 2) croak_xs_usage(cv, "r, length=r->finfo.csize"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); apr_off_t length; if (items < 2) length = r->finfo.csize; else { length = (apr_off_t)SvIV(ST(1)); } #line 99 "Response.xs" ap_set_content_length(r, length); #line 266 "Response.c" } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_set_etag); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_set_etag) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "r"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); ap_set_etag(r); } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_set_keepalive); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_set_keepalive) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "r"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); int RETVAL; dXSTARG; RETVAL = ap_set_keepalive(r); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Apache2__RequestRec_update_mtime); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_update_mtime) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 2) croak_xs_usage(cv, "r, dependency_mtime=0"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); apr_time_t dependency_mtime; if (items < 2) dependency_mtime = 0; else { dependency_mtime = (apr_time_t)(apr_time_from_sec(SvNV(ST(1)))); } #line 125 "Response.xs" ap_update_mtime(r, dependency_mtime); #line 334 "Response.c" } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_set_last_modified); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_set_last_modified) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 2) croak_xs_usage(cv, "r, mtime=0"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); apr_time_t mtime; if (items < 2) mtime = 0; else { mtime = (apr_time_t)(apr_time_from_sec(SvNV(ST(1)))); } #line 137 "Response.xs" mpxs_Apache2__RequestRec_set_last_modified(r, mtime); #line 361 "Response.c" } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_send_cgi_header); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_send_cgi_header) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "r, buffer"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); SV * buffer = ST(1); #line 149 "Response.xs" mpxs_Apache2__RequestRec_send_cgi_header(r, buffer); #line 382 "Response.c" } XSRETURN_EMPTY; } #ifdef __cplusplus extern "C" #endif XS(boot_Apache2__Response); /* prototype to pass -Wmissing-prototypes */ XS(boot_Apache2__Response) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif #if (PERL_REVISION == 5 && PERL_VERSION < 9) char* file = __FILE__; #else const char* file = __FILE__; #endif PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(items); /* -W */ XS_VERSION_BOOTCHECK ; (void)newXS("Apache2::RequestRec::custom_response", XS_Apache2__RequestRec_custom_response, file); (void)newXS("Apache2::RequestRec::make_etag", XS_Apache2__RequestRec_make_etag, file); (void)newXS("Apache2::RequestRec::meets_conditions", XS_Apache2__RequestRec_meets_conditions, file); (void)newXS("Apache2::RequestRec::rationalize_mtime", XS_Apache2__RequestRec_rationalize_mtime, file); (void)newXS("Apache2::RequestRec::send_error_response", XS_Apache2__RequestRec_send_error_response, file); (void)newXS("Apache2::RequestRec::send_mmap", XS_Apache2__RequestRec_send_mmap, file); (void)newXS("Apache2::RequestRec::set_content_length", XS_Apache2__RequestRec_set_content_length, file); (void)newXS("Apache2::RequestRec::set_etag", XS_Apache2__RequestRec_set_etag, file); (void)newXS("Apache2::RequestRec::set_keepalive", XS_Apache2__RequestRec_set_keepalive, file); (void)newXS("Apache2::RequestRec::update_mtime", XS_Apache2__RequestRec_update_mtime, file); (void)newXS("Apache2::RequestRec::set_last_modified", XS_Apache2__RequestRec_set_last_modified, file); (void)newXS("Apache2::RequestRec::send_cgi_header", XS_Apache2__RequestRec_send_cgi_header, file); /* Initialisation Section */ #line 156 "Response.xs" items = items; /* -Wall */ #line 426 "Response.c" /* End of Initialisation Section */ #if (PERL_REVISION == 5 && PERL_VERSION >= 9) if (PL_unitcheckav) call_list(PL_scopestack_ix, PL_unitcheckav); #endif XSRETURN_YES; }