#include "EXTERN.h" #include "perl.h" #include "XSUB.h" static XS(ActivePerl_PRODUCT) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: ActivePerl::PRODUCT()"); XSRETURN_PV(ACTIVEPERL_PRODUCT); } static XS(ActivePerl_BUILD) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: ActivePerl::BUILD()"); XSRETURN_PV(PRODUCT_BUILD_NUMBER); } static XS(ActivePerl_CHANGELIST) { dXSARGS; char *str = ACTIVEPERL_CHANGELIST; if (items != 0) Perl_croak(aTHX_ "Usage: ActivePerl::CHANGELIST()"); while (*str && !isDIGIT(*str)) str++; if (isDIGIT(*str)) { char *end = str + 1; while (isDIGIT(*end)) end++; XSRETURN_PVN(str, end - str); } else { XSRETURN_UNDEF; } } #ifdef CONFIG_HEAVY static XS(ActivePerl_CONFIG_HEAVY) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: ActivePerl::_CONFIG_HEAVY()"); XSRETURN_PV(STRINGIFY(CONFIG_HEAVY)); } #endif void Perl_boot_core_ActivePerl(pTHX) { char *file = __FILE__; SV *version_sv = get_sv("ActivePerl::VERSION", TRUE); #if ACTIVEPERL_SUBVERSION > 0 Perl_sv_setpvf(aTHX_ version_sv, "%d.%02d", ACTIVEPERL_VERSION, ACTIVEPERL_SUBVERSION); #else sv_setiv(version_sv, ACTIVEPERL_VERSION); #endif newXS("ActivePerl::PRODUCT", ActivePerl_PRODUCT, file); newXS("ActivePerl::BUILD", ActivePerl_BUILD, file); newXS("ActivePerl::CHANGELIST", ActivePerl_CHANGELIST, file); #ifdef CONFIG_HEAVY newXS("ActivePerl::_CONFIG_HEAVY", ActivePerl_CONFIG_HEAVY, file); #endif }