More work for XS Config

This commit is contained in:
Alessandro Ranellucci
2013-12-20 20:54:11 +01:00
parent 008f38cf68
commit 64e549a46f
7 changed files with 316 additions and 10 deletions

View File

@@ -171,6 +171,23 @@ Point::from_SV_check(SV* point_sv)
this->from_SV(point_sv);
}
}
SV*
Pointf::to_SV_pureperl() const {
AV* av = newAV();
av_fill(av, 1);
av_store(av, 0, newSVnv(this->x));
av_store(av, 1, newSVnv(this->y));
return newRV_noinc((SV*)av);
}
void
Pointf::from_SV(SV* point_sv)
{
AV* point_av = (AV*)SvRV(point_sv);
this->x = SvNV(*av_fetch(point_av, 0, 0));
this->y = SvNV(*av_fetch(point_av, 1, 0));
}
#endif
}