Xsub: doing $$var = Obj->new in C
I've got some code that I'm invoking as:
$obj->get_global_pointer(\$gp)
where get_global_pointer is an xsub. I want to do the equivalent of
$$gpref = GP->new()
I can generate the blessed reference for the rhs no problem, it's
just assigning to lhs that I'm having problems with.
Let me get this straight (if I can). You have an XSUB which has a
prologue starting something like this:
SV *
get_global_pointer(foo)
SV * foo
And, you pass ``foo'' in as a scalar reference?
If that's so, then you should only need something like:
SvSetSV(SvRV(foo), <generated SV* here>)
Or, if the generated version is a temp that you need to preserve,
newSVsv(SvRV(foo), <generated SV* here>)
Was that all you needed, or did I misunderstand the problem?
--
speaking only for myself ...!decvax!orb!spider