I am confused.

I have a simple scalar tie which uses an XS routine to do the fetching
and this all works just fine in perl code.

However, I want to do a "tied" (or magical?) fetch on the same thing in
XS. When the thing is passed on the stack, it is a reference which
actually points to an opaque pointer to my internal data dictionary
system. It seems to me that it is the *reference* that has the magic on
it, not the dereferenced opaque pointer.  

Do I just do an SvNV(refsv) or do I have to dereference the refsv, then
do something else to invoke the magic. 

Effectively this is the perl equivaleny of what I want to do XS:

my $n = $SAL::BAL;

where $SAL::BAL is a tied variable that causes a numeric value contained
within the system (called SAL::BAL) to be put into $n (this all works).

In my naive way, it would seem that this would be an XS equivalent:

SV *refsv = get_sv("SAL::BAL", 0);
NV d = SvNV(refsv);

But somehow, I doubt it :-)

Dirk

Reply via email to