/* * This file was generated automatically by ExtUtils::ParseXS version 2.21 from the * contents of URI.xs. Do not edit this file, edit URI.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "URI.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/URI/Apache2__URI.h" #line 38 "URI.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 "URI.c" XS(XS_Apache2__RequestRec_construct_server); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_construct_server) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 4) croak_xs_usage(cv, "r, hostname=ap_get_server_name(r), port=ap_get_server_port(r), p=r->pool"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); const char * hostname; apr_port_t port; APR__Pool p; char * RETVAL; dXSTARG; if (items < 2) hostname = ap_get_server_name(r); else { hostname = (const char *)SvPV_nolen(ST(1)); } if (items < 3) port = ap_get_server_port(r); else { port = (apr_port_t)SvIV(ST(2)); } if (items < 4) p = r->pool; else { if (SvROK(ST(3)) && sv_derived_from(ST(3), "APR::Pool")) { IV tmp = SvIV((SV*)SvRV(ST(3))); if (tmp == 0) { Perl_croak(aTHX_ "invalid pool object (already destroyed?)"); } p = INT2PTR(APR__Pool, tmp); } else { Perl_croak(aTHX_ SvROK(ST(3)) ? "p is not of type APR::Pool" : "p is not a blessed reference"); }; } #line 39 "URI.xs" RETVAL = ap_construct_server(p, hostname, port, r); #line 141 "URI.c" sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; } XSRETURN(1); } XS(XS_Apache2__RequestRec_construct_url); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_construct_url) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 3) croak_xs_usage(cv, "r, uri=r->uri, p=r->pool"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); const char * uri; APR__Pool p; char * RETVAL; dXSTARG; if (items < 2) uri = r->uri; else { uri = (const char *)SvPV_nolen(ST(1)); } if (items < 3) p = r->pool; else { if (SvROK(ST(2)) && sv_derived_from(ST(2), "APR::Pool")) { IV tmp = SvIV((SV*)SvRV(ST(2))); if (tmp == 0) { Perl_croak(aTHX_ "invalid pool object (already destroyed?)"); } p = INT2PTR(APR__Pool, tmp); } else { Perl_croak(aTHX_ SvROK(ST(2)) ? "p is not of type APR::Pool" : "p is not a blessed reference"); }; } #line 54 "URI.xs" RETVAL = ap_construct_url(p, uri, r); #line 190 "URI.c" sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; } XSRETURN(1); } XS(XS_Apache2__RequestRec_parse_uri); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_parse_uri) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "r, uri"); { Apache2__RequestRec r = modperl_xs_sv2request_rec(aTHX_ ST(0), "Apache2::RequestRec", cv); const char * uri = (const char *)SvPV_nolen(ST(1)); ap_parse_uri(r, uri); } XSRETURN_EMPTY; } XS(XS_Apache2__URI_unescape_url); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__URI_unescape_url) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "url"); { SV * url = ST(0); char * RETVAL; dXSTARG; #line 75 "URI.xs" RETVAL = mpxs_ap_unescape_url(aTHX_ url); #line 234 "URI.c" sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; } XSRETURN(1); } XS(XS_Apache2__RequestRec_parsed_uri); /* prototype to pass -Wmissing-prototypes */ XS(XS_Apache2__RequestRec_parsed_uri) { #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); APR__URI RETVAL; RETVAL = mpxs_Apache2__RequestRec_parsed_uri(r); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "APR::URI", (void*)RETVAL); } XSRETURN(1); } #ifdef __cplusplus extern "C" #endif XS(boot_Apache2__URI); /* prototype to pass -Wmissing-prototypes */ XS(boot_Apache2__URI) { #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::construct_server", XS_Apache2__RequestRec_construct_server, file); (void)newXS("Apache2::RequestRec::construct_url", XS_Apache2__RequestRec_construct_url, file); (void)newXS("Apache2::RequestRec::parse_uri", XS_Apache2__RequestRec_parse_uri, file); (void)newXS("Apache2::URI::unescape_url", XS_Apache2__URI_unescape_url, file); (void)newXS("Apache2::RequestRec::parsed_uri", XS_Apache2__RequestRec_parsed_uri, file); /* Initialisation Section */ #line 91 "URI.xs" items = items; /* -Wall */ #line 294 "URI.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; }