/* * This file was generated automatically by ExtUtils::ParseXS version 2.21 from the * contents of SubRequest.xs. Do not edit this file, edit SubRequest.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "SubRequest.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/SubRequest/Apache2__SubRequest.h" #line 38 "SubRequest.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 "SubRequest.c" XS(XS_Apache2__SubRequest_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__SubRequest_DESTROY) { #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); #line 36 "SubRequest.xs" ap_destroy_sub_req(r); #line 106 "SubRequest.c" } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_internal_fast_redirect); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_internal_fast_redirect) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "r, sub_req"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); Apache2__RequestRec sub_req = modperl_xs_sv2request_rec(aTHX_ ST(1), "Apache2::RequestRec", cv); #line 48 "SubRequest.xs" ap_internal_fast_redirect(sub_req, r); #line 127 "SubRequest.c" } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_internal_redirect); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_internal_redirect) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "r, new_uri"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); const char * new_uri = (const char *)SvPV_nolen(ST(1)); #line 60 "SubRequest.xs" ap_internal_redirect(new_uri, r); #line 148 "SubRequest.c" } XSRETURN_EMPTY; } XS(XS_Apache2__RequestRec_internal_redirect_handler); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_internal_redirect_handler) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "r, new_uri"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); const char * new_uri = (const char *)SvPV_nolen(ST(1)); #line 72 "SubRequest.xs" ap_internal_redirect_handler(new_uri, r); #line 169 "SubRequest.c" } XSRETURN_EMPTY; } XS(XS_Apache2__SubRequest_run); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__SubRequest_run) { #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; #line 83 "SubRequest.xs" RETVAL = mpxs_ap_run_sub_req(aTHX_ r); #line 192 "SubRequest.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Apache2__RequestRec_lookup_dirent); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_lookup_dirent) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 2 || items > 4) croak_xs_usage(cv, "r, finfo, subtype=AP_SUBREQ_NO_ARGS, next_filter=NULL"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); APR__Finfo finfo; int subtype; Apache2__Filter next_filter; Apache2__RequestRec RETVAL; if (sv_derived_from(ST(1), "APR::Finfo")) { IV tmp = SvIV((SV*)SvRV(ST(1))); finfo = INT2PTR(APR__Finfo,tmp); } else Perl_croak(aTHX_ "%s: %s is not of type %s", "Apache2::RequestRec::lookup_dirent", "finfo", "APR::Finfo"); if (items < 3) subtype = AP_SUBREQ_NO_ARGS; else { subtype = (int)SvIV(ST(2)); } if (items < 4) next_filter = NULL; else { if (sv_derived_from(ST(3), "Apache2::Filter")) { IV tmp = SvIV((SV*)SvRV(ST(3))); next_filter = INT2PTR(Apache2__Filter,tmp); } else Perl_croak(aTHX_ "%s: %s is not of type %s", "Apache2::RequestRec::lookup_dirent", "next_filter", "Apache2::Filter"); } #line 99 "SubRequest.xs" RETVAL = ap_sub_req_lookup_dirent(finfo, r, subtype, next_filter); #line 246 "SubRequest.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Apache2::RequestRec", (void*)RETVAL); } XSRETURN(1); } XS(XS_Apache2__RequestRec_lookup_file); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_lookup_file) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 2 || items > 3) croak_xs_usage(cv, "r, new_file, next_filter=r->proto_output_filters"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); const char * new_file = (const char *)SvPV_nolen(ST(1)); Apache2__Filter next_filter; Apache2__SubRequest RETVAL; if (items < 3) next_filter = r->proto_output_filters; else { if (sv_derived_from(ST(2), "Apache2::Filter")) { IV tmp = SvIV((SV*)SvRV(ST(2))); next_filter = INT2PTR(Apache2__Filter,tmp); } else Perl_croak(aTHX_ "%s: %s is not of type %s", "Apache2::RequestRec::lookup_file", "next_filter", "Apache2::Filter"); } #line 114 "SubRequest.xs" RETVAL = ap_sub_req_lookup_file(new_file, r, next_filter); #line 286 "SubRequest.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Apache2::SubRequest", (void*)RETVAL); } XSRETURN(1); } XS(XS_Apache2__RequestRec_lookup_uri); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_lookup_uri) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 2 || items > 3) croak_xs_usage(cv, "r, new_uri, next_filter=r->proto_output_filters"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); const char * new_uri = (const char *)SvPV_nolen(ST(1)); Apache2__Filter next_filter; Apache2__SubRequest RETVAL; if (items < 3) next_filter = r->proto_output_filters; else { if (sv_derived_from(ST(2), "Apache2::Filter")) { IV tmp = SvIV((SV*)SvRV(ST(2))); next_filter = INT2PTR(Apache2__Filter,tmp); } else Perl_croak(aTHX_ "%s: %s is not of type %s", "Apache2::RequestRec::lookup_uri", "next_filter", "Apache2::Filter"); } #line 129 "SubRequest.xs" RETVAL = ap_sub_req_lookup_uri(new_uri, r, next_filter); #line 325 "SubRequest.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Apache2::SubRequest", (void*)RETVAL); } XSRETURN(1); } XS(XS_Apache2__RequestRec_lookup_method_uri); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_lookup_method_uri) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 3 || items > 4) croak_xs_usage(cv, "r, method, new_uri, next_filter=r->proto_output_filters"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); const char * method = (const char *)SvPV_nolen(ST(1)); const char * new_uri = (const char *)SvPV_nolen(ST(2)); Apache2__Filter next_filter; Apache2__SubRequest RETVAL; if (items < 4) next_filter = r->proto_output_filters; else { if (sv_derived_from(ST(3), "Apache2::Filter")) { IV tmp = SvIV((SV*)SvRV(ST(3))); next_filter = INT2PTR(Apache2__Filter,tmp); } else Perl_croak(aTHX_ "%s: %s is not of type %s", "Apache2::RequestRec::lookup_method_uri", "next_filter", "Apache2::Filter"); } #line 145 "SubRequest.xs" RETVAL = ap_sub_req_method_uri(method, new_uri, r, next_filter); #line 365 "SubRequest.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Apache2::SubRequest", (void*)RETVAL); } XSRETURN(1); } #ifdef __cplusplus extern "C" #endif XS(boot_Apache2__SubRequest); /* prototype to pass -Wmissing-prototypes */ XS(boot_Apache2__SubRequest) { #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::SubRequest::DESTROY", XS_Apache2__SubRequest_DESTROY, file); (void)newXS("Apache2::RequestRec::internal_fast_redirect", XS_Apache2__RequestRec_internal_fast_redirect, file); (void)newXS("Apache2::RequestRec::internal_redirect", XS_Apache2__RequestRec_internal_redirect, file); (void)newXS("Apache2::RequestRec::internal_redirect_handler", XS_Apache2__RequestRec_internal_redirect_handler, file); (void)newXS("Apache2::SubRequest::run", XS_Apache2__SubRequest_run, file); (void)newXS("Apache2::RequestRec::lookup_dirent", XS_Apache2__RequestRec_lookup_dirent, file); (void)newXS("Apache2::RequestRec::lookup_file", XS_Apache2__RequestRec_lookup_file, file); (void)newXS("Apache2::RequestRec::lookup_uri", XS_Apache2__RequestRec_lookup_uri, file); (void)newXS("Apache2::RequestRec::lookup_method_uri", XS_Apache2__RequestRec_lookup_method_uri, file); /* Initialisation Section */ #line 154 "SubRequest.xs" items = items; /* -Wall */ #line 408 "SubRequest.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; }