ST(0) = sv_2mortal(newSVuv(o == NULL));
XSRETURN(1);
+void
+zero(SV *sv)
+PROTOTYPE: $
+PREINIT:
+ HV *hv;
+ IV res;
+CODE:
+ if (!SvOK(sv))
+ XSRETURN_IV(1);
+ if (!SvROK(sv)) {
+ res = SvNOK(sv) ? SvNV(sv) == 0.0 : SvUV(sv) == 0;
+ XSRETURN_IV(res);
+ }
+ hv = (HV *) SvRV(sv);
+ res = hv_exists(hv, "0", 1) && hv_iterinit(hv) == 1;
+ XSRETURN_IV(res);
+
void
count(SV *sv)
PROTOTYPE: $
$n eq 'null' ? substr(ppname($_[0]->targ), 3) : $n
}
-sub zero ($) {
- my $r = $_[0];
- return 1 unless defined $r;
- return $r eq '0' unless ref $r;
- return $r->{0} and 1 == scalar keys %$r;
-}
-
sub list ($) {
my $r = $_[0];
return 0 unless defined $r;