PUSHs(metaobject);
mPUSHs(message);
- mPUSHs(newSVpvs("depth"));
- mPUSHi(-1);
+ if(data){ /* extra arg, might be useful for debugging */
+ mPUSHs(newSVpsv("data"));
+ PUSHs(data);
+ mPUSHs(newSVpvs("depth"));
+ mPUSHi(-1);
+ }
PUTBACK;
int
mouse_predicate_call(pTHX_ SV* const self, SV* const method) {
- SV* const value = mcall0(self, method);
- return SvTRUE(value);
+ return sv_true( mcall0(self, method) );
}
SV*
}
bool
+is_valid_class_name(SV* sv)
+CODE:
+{
+ SvGETMAGIC(sv);
+ if(SvPOKp(sv) && SvCUR(sv) > 0){
+ UV i;
+ RETVAL = TRUE;
+ for(i = 0; i < SvCUR(sv); i++){
+ char const c = SvPVX(sv)[i];
+ if(!(isALNUM(c) || c == ':')){
+ RETVAL = FALSE;
+ break;
+ }
+ }
+ }
+ else{
+ RETVAL = SvNIOKp(sv) ? TRUE : FALSE;
+ }
+}
+OUTPUT:
+ RETVAL
+
+bool
is_class_loaded(SV* sv)
void
}
if(predicate_name == NULL){ /* anonymous predicate */
- XPUSHs( newRV_noinc((SV*)xsub) );
+ mXPUSHs( newRV_inc((SV*)xsub) );
}
}