#include "EXTERN.h"
#include "perl.h"
-#include "XSUB.h"
/*
* Contributed by Graham Barr <Graham.Barr@tiuk.ti.com>
* The main guts of traverse_isa was actually copied from gv_fetchmeth
*/
-static SV *
-isa_lookup(stash, name, len, level)
-HV *stash;
-char *name;
-int len;
-int level;
+STATIC SV *
+isa_lookup(HV *stash, char *name, int len, int level)
{
AV* av;
GV* gv;
}
if(hv) {
SV** svp = AvARRAY(av);
- I32 items = AvFILL(av) + 1;
+ /* NOTE: No support for tied ISA */
+ I32 items = AvFILLp(av) + 1;
while (items--) {
SV* sv = *svp++;
HV* basestash = gv_stashsv(sv, FALSE);
}
}
- return &sv_no;
+ return boolSV(strEQ(name, "UNIVERSAL"));
}
bool
-sv_derived_from(sv, name)
-SV * sv ;
-char * name ;
+sv_derived_from(SV *sv, char *name)
{
SV *rv;
char *type;
}
+#ifdef PERL_OBJECT
+#define NO_XSLOCKS
+#endif /* PERL_OBJECT */
+
+#include "XSUB.h"
static
XS(XS_UNIVERSAL_isa)
sv = ST(0);
name = (char *)SvPV(ST(1),na);
- ST(0) = (sv_derived_from(sv, name) ? &sv_yes : &sv_no) ;
-
+ ST(0) = boolSV(sv_derived_from(sv, name));
XSRETURN(1);
}
SV *sv;
char *name;
SV *rv;
- GV *gv;
- CV *cvp;
HV *pkg = NULL;
if (items != 2)
}
if (pkg) {
- gv = gv_fetchmethod(pkg, name);
-
- if(gv && GvCV(gv)) {
- /* If the sub is only a stub then we may have a gv to AUTOLOAD */
- GV **gvp = (GV**)hv_fetch(GvSTASH(gv), name, strlen(name), TRUE);
- if(gvp && (cvp = GvCV(*gvp))) {
- rv = sv_newmortal();
- sv_setsv(rv, newRV((SV*)cvp));
- }
- }
+ GV *gv = gv_fetchmethod_autoload(pkg, name, FALSE);
+ if (gv && isGV(gv))
+ rv = sv_2mortal(newRV((SV*)GvCV(gv)));
}
ST(0) = rv;
XSRETURN(1);
}
+#ifdef PERL_OBJECT
+#undef boot_core_UNIVERSAL
+#define boot_core_UNIVERSAL CPerlObj::Perl_boot_core_UNIVERSAL
+#define pPerl this
+#endif
+
void
-boot_core_UNIVERSAL()
+boot_core_UNIVERSAL(void)
{
char *file = __FILE__;