/* * This file was generated automatically by ExtUtils::ParseXS version 2.21 from the * contents of Pool.xs. Do not edit this file, edit Pool.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "Pool.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 "APR/Pool/APR__Pool.h" #line 38 "Pool.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 "Pool.c" XS(XS_APR__Pool_cleanup_for_exec); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_cleanup_for_exec) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) croak_xs_usage(cv, ""); { apr_pool_cleanup_for_exec(); } XSRETURN_EMPTY; } XS(XS_APR__Pool_cleanup_register); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_cleanup_register) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 2 || items > 3) croak_xs_usage(cv, "p, cv, arg=Nullsv"); { APR__Pool p; SV * cv = ST(1); SV * arg; if (SvROK(ST(0)) && sv_derived_from(ST(0), "APR::Pool")) { IV tmp = SvIV((SV*)SvRV(ST(0))); if (tmp == 0) { Perl_croak(aTHX_ "invalid pool object (already destroyed?)"); } p = INT2PTR(APR__Pool, tmp); } else { Perl_croak(aTHX_ SvROK(ST(0)) ? "p is not of type APR::Pool" : "p is not a blessed reference"); }; if (items < 3) arg = Nullsv; else { arg = ST(2); } #line 44 "Pool.xs" mpxs_apr_pool_cleanup_register(aTHX_ p, cv, arg); #line 145 "Pool.c" } XSRETURN_EMPTY; } XS(XS_APR__Pool_is_ancestor); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_is_ancestor) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "a, b"); { APR__Pool a; APR__Pool b; int RETVAL; dXSTARG; if (SvROK(ST(0)) && sv_derived_from(ST(0), "APR::Pool")) { IV tmp = SvIV((SV*)SvRV(ST(0))); if (tmp == 0) { Perl_croak(aTHX_ "invalid pool object (already destroyed?)"); } a = INT2PTR(APR__Pool, tmp); } else { Perl_croak(aTHX_ SvROK(ST(0)) ? "a is not of type APR::Pool" : "a is not a blessed reference"); }; if (SvROK(ST(1)) && sv_derived_from(ST(1), "APR::Pool")) { IV tmp = SvIV((SV*)SvRV(ST(1))); if (tmp == 0) { Perl_croak(aTHX_ "invalid pool object (already destroyed?)"); } b = INT2PTR(APR__Pool, tmp); } else { Perl_croak(aTHX_ SvROK(ST(1)) ? "b is not of type APR::Pool" : "b is not a blessed reference"); }; RETVAL = apr_pool_is_ancestor(a, b); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_APR__Pool_parent_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_parent_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "pool"); { APR__Pool pool; SV * RETVAL; if (SvROK(ST(0)) && sv_derived_from(ST(0), "APR::Pool")) { IV tmp = SvIV((SV*)SvRV(ST(0))); if (tmp == 0) { Perl_croak(aTHX_ "invalid pool object (already destroyed?)"); } pool = INT2PTR(APR__Pool, tmp); } else { Perl_croak(aTHX_ SvROK(ST(0)) ? "pool is not of type APR::Pool" : "pool is not a blessed reference"); }; #line 63 "Pool.xs" RETVAL = mpxs_apr_pool_parent_get(aTHX_ pool); #line 229 "Pool.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_APR__Pool_tag); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_tag) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "pool, tag"); { APR__Pool pool; const char * tag = (const char *)SvPV_nolen(ST(1)); if (SvROK(ST(0)) && sv_derived_from(ST(0), "APR::Pool")) { IV tmp = SvIV((SV*)SvRV(ST(0))); if (tmp == 0) { Perl_croak(aTHX_ "invalid pool object (already destroyed?)"); } pool = INT2PTR(APR__Pool, tmp); } else { Perl_croak(aTHX_ SvROK(ST(0)) ? "pool is not of type APR::Pool" : "pool is not a blessed reference"); }; apr_pool_tag(pool, tag); } XSRETURN_EMPTY; } XS(XS_APR__Pool_clear); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_clear) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "obj"); { SV * obj = ST(0); #line 84 "Pool.xs" mpxs_APR__Pool_clear(aTHX_ obj); #line 284 "Pool.c" } XSRETURN_EMPTY; } XS(XS_APR__Pool_destroy); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_destroy) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "obj"); { SV * obj = ST(0); #line 95 "Pool.xs" mpxs_apr_pool_DESTROY(aTHX_ obj); #line 304 "Pool.c" } XSRETURN_EMPTY; } XS(XS_APR__Pool_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "parent_pool_obj"); { SV * parent_pool_obj = ST(0); SV * RETVAL; #line 106 "Pool.xs" RETVAL = mpxs_apr_pool_create(aTHX_ parent_pool_obj); #line 326 "Pool.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_APR__Pool_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Pool_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "obj"); { SV * obj = ST(0); #line 119 "Pool.xs" mpxs_apr_pool_DESTROY(aTHX_ obj); #line 348 "Pool.c" } XSRETURN_EMPTY; } #ifdef __cplusplus extern "C" #endif XS(boot_APR__Pool); /* prototype to pass -Wmissing-prototypes */ XS(boot_APR__Pool) { #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("APR::Pool::cleanup_for_exec", XS_APR__Pool_cleanup_for_exec, file); (void)newXS("APR::Pool::cleanup_register", XS_APR__Pool_cleanup_register, file); (void)newXS("APR::Pool::is_ancestor", XS_APR__Pool_is_ancestor, file); (void)newXS("APR::Pool::parent_get", XS_APR__Pool_parent_get, file); (void)newXS("APR::Pool::tag", XS_APR__Pool_tag, file); (void)newXS("APR::Pool::clear", XS_APR__Pool_clear, file); (void)newXS("APR::Pool::destroy", XS_APR__Pool_destroy, file); (void)newXS("APR::Pool::new", XS_APR__Pool_new, file); (void)newXS("APR::Pool::DESTROY", XS_APR__Pool_DESTROY, file); /* Initialisation Section */ #line 126 "Pool.xs" items = items; /* -Wall */ modperl_opt_interp_unselect = APR_RETRIEVE_OPTIONAL_FN(modperl_interp_unselect); modperl_opt_thx_interp_get = APR_RETRIEVE_OPTIONAL_FN(modperl_thx_interp_get); #line 393 "Pool.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; }