/* * This file was generated automatically by ExtUtils::ParseXS version 2.21 from the * contents of Table.xs. Do not edit this file, edit Table.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "Table.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/Table/APR__Table.h" #line 38 "Table.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 "Table.c" XS(XS_APR__Table_add); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_add) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) croak_xs_usage(cv, "t, key, val"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); const char * key = (const char *)SvPV_nolen(ST(1)); const char * val = (const char *)SvPV_nolen(ST(2)); apr_table_add(t, key, val); } XSRETURN_EMPTY; } XS(XS_APR__Table_clear); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_clear) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "t"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); apr_table_clear(t); } XSRETURN_EMPTY; } XS(XS_APR__Table_compress); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_compress) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "t, flags"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); unsigned flags = (unsigned)SvUV(ST(1)); apr_table_compress(t, flags); } XSRETURN_EMPTY; } XS(XS_APR__Table_do); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_do) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif PERL_UNUSED_VAR(cv); /* -W */ { int RETVAL; dXSTARG; #line 59 "Table.xs" RETVAL = mpxs_apr_table_do(aTHX_ items, MARK+1, SP); #line 167 "Table.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_APR__Table_merge); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_merge) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) croak_xs_usage(cv, "t, key, val"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); const char * key = (const char *)SvPV_nolen(ST(1)); const char * val = (const char *)SvPV_nolen(ST(2)); apr_table_merge(t, key, val); } XSRETURN_EMPTY; } XS(XS_APR__Table_overlap); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_overlap) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) croak_xs_usage(cv, "a, b, flags"); { APR__Table a = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); APR__Table b = modperl_hash_tied_object(aTHX_ "APR::Table", ST(1)); unsigned flags = (unsigned)SvUV(ST(2)); apr_table_overlap(a, b, flags); } XSRETURN_EMPTY; } XS(XS_APR__Table_set); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_set) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) croak_xs_usage(cv, "t, key, val"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); const char * key = (const char *)SvPV_nolen(ST(1)); const char * val = (const char *)SvPV_nolen(ST(2)); apr_table_set(t, key, val); } XSRETURN_EMPTY; } XS(XS_APR__Table_unset); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_unset) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "t, key"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); const char * key = (const char *)SvPV_nolen(ST(1)); apr_table_unset(t, key); } XSRETURN_EMPTY; } XS(XS_APR__Table_EXISTS); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_EXISTS) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "t, key"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); const char * key = (const char *)SvPV_nolen(ST(1)); int RETVAL; dXSTARG; RETVAL = mpxs_APR__Table_EXISTS(t, key); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_APR__Table_FETCH); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_FETCH) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "tsv, key"); { SV * tsv = ST(0); const char * key = (const char *)SvPV_nolen(ST(1)); const char * RETVAL; dXSTARG; #line 116 "Table.xs" RETVAL = mpxs_APR__Table_FETCH(aTHX_ tsv, key); #line 298 "Table.c" sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; } XSRETURN(1); } XS(XS_APR__Table_NEXTKEY); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_NEXTKEY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 2) croak_xs_usage(cv, "tsv, key=&PL_sv_undef"); { SV * tsv = ST(0); SV * key; const char * RETVAL; dXSTARG; if (items < 2) key = &PL_sv_undef; else { key = ST(1); } #line 130 "Table.xs" RETVAL = mpxs_APR__Table_NEXTKEY(aTHX_ tsv, key); #line 329 "Table.c" sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; } XSRETURN(1); } XS(XS_APR__Table_copy); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_copy) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "base, p_sv"); { APR__Table base = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); SV * p_sv = ST(1); SV * RETVAL; #line 144 "Table.xs" RETVAL = mpxs_APR__Table_copy(aTHX_ base, p_sv); #line 353 "Table.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_APR__Table_make); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_make) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "p_sv, nelts"); { SV * p_sv = ST(0); int nelts = (int)SvIV(ST(1)); SV * RETVAL; #line 158 "Table.xs" RETVAL = mpxs_APR__Table_make(aTHX_ p_sv, nelts); #line 378 "Table.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_APR__Table_overlay); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_overlay) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) croak_xs_usage(cv, "base, overlay, p_sv"); { APR__Table base = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); APR__Table overlay = modperl_hash_tied_object(aTHX_ "APR::Table", ST(1)); SV * p_sv = ST(2); SV * RETVAL; #line 173 "Table.xs" RETVAL = mpxs_APR__Table_overlay(aTHX_ base, overlay, p_sv); #line 404 "Table.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_APR__Table_CLEAR); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_CLEAR) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "t"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); #line 186 "Table.xs" mpxs_APR__Table_CLEAR(t); #line 426 "Table.c" } XSRETURN_EMPTY; } XS(XS_APR__Table_FIRSTKEY); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_FIRSTKEY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 2) croak_xs_usage(cv, "tsv, key=Nullsv"); { SV * tsv = ST(0); SV * key; const char * RETVAL; dXSTARG; if (items < 2) key = Nullsv; else { key = ST(1); } #line 198 "Table.xs" RETVAL = mpxs_APR__Table_NEXTKEY(aTHX_ tsv, key); #line 456 "Table.c" sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; } XSRETURN(1); } XS(XS_APR__Table_STORE); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_STORE) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) croak_xs_usage(cv, "t, key, value"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); const char * key = (const char *)SvPV_nolen(ST(1)); const char * value = (const char *)SvPV_nolen(ST(2)); #line 213 "Table.xs" mpxs_APR__Table_STORE(t, key, value); #line 479 "Table.c" } XSRETURN_EMPTY; } XS(XS_APR__Table_DELETE); /* prototype to pass -Wmissing-prototypes */ XS(XS_APR__Table_DELETE) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) croak_xs_usage(cv, "t, key"); { APR__Table t = modperl_hash_tied_object(aTHX_ "APR::Table", ST(0)); const char * key = (const char *)SvPV_nolen(ST(1)); #line 225 "Table.xs" mpxs_APR__Table_DELETE(t, key); #line 500 "Table.c" } XSRETURN_EMPTY; } #ifdef __cplusplus extern "C" #endif XS(boot_APR__Table); /* prototype to pass -Wmissing-prototypes */ XS(boot_APR__Table) { #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::Table::add", XS_APR__Table_add, file); (void)newXS("APR::Table::clear", XS_APR__Table_clear, file); (void)newXS("APR::Table::compress", XS_APR__Table_compress, file); (void)newXS("APR::Table::do", XS_APR__Table_do, file); (void)newXS("APR::Table::merge", XS_APR__Table_merge, file); (void)newXS("APR::Table::overlap", XS_APR__Table_overlap, file); (void)newXS("APR::Table::set", XS_APR__Table_set, file); (void)newXS("APR::Table::unset", XS_APR__Table_unset, file); (void)newXS("APR::Table::EXISTS", XS_APR__Table_EXISTS, file); (void)newXS("APR::Table::FETCH", XS_APR__Table_FETCH, file); (void)newXS("APR::Table::NEXTKEY", XS_APR__Table_NEXTKEY, file); (void)newXS("APR::Table::copy", XS_APR__Table_copy, file); (void)newXS("APR::Table::make", XS_APR__Table_make, file); (void)newXS("APR::Table::overlay", XS_APR__Table_overlay, file); (void)newXS("APR::Table::CLEAR", XS_APR__Table_CLEAR, file); (void)newXS("APR::Table::FIRSTKEY", XS_APR__Table_FIRSTKEY, file); (void)newXS("APR::Table::STORE", XS_APR__Table_STORE, file); (void)newXS("APR::Table::DELETE", XS_APR__Table_DELETE, file); /* Initialisation Section */ #line 232 "Table.xs" items = items; /* -Wall */ cv = newXS("APR::Table::get", MPXS_apr_table_get, __FILE__); #line 552 "Table.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; }