geoffleach has asked for the wisdom of the Perl Monks concerning the following question:
results in the runtime error:print Audio::TagLib::ID3v2::Frame::size(1), "\n";
THIS is not of type Audio::TagLib::ID3v2::Frame
I realize that this is not exactly a full example. I'm trying to keep things simple:-)
The short of it is this. We're accessing an XS interface to the C++ library taglib.. The XS code is:
and the C code derived from this is:unsigned int TagLib::ID3v2::Frame::size() CODE: RETVAL = THIS->size(); OUTPUT: RETVAL
So I see where the error is coming from, the question is: how is Perl determining what the type of THIS is? As far as I can tell, the various objects all have the correct specifications back to the C++ code. Additionally, is there a perlapi that will say what it thinks the type of THIS is?... if (sv_isobject(ST(0)) && sv_derived_from(ST(0), "Audio::TagLib::ID3v2 +::Fram THIS = INT2PTR(TagLib::ID3v2::Frame *, SvIV((SV *)SvRV(ST(0))) +); else Perl_croak(aTHX_ "THIS is not of type Audio::TagLib::ID3v2::Fr +ame");
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sv_derived_from gives a confsing result
by ikegami (Patriarch) on Mar 27, 2011 at 05:49 UTC | |
|
Re: sv_derived_from gives a confsing result
by syphilis (Archbishop) on Mar 27, 2011 at 06:13 UTC | |
by geoffleach (Scribe) on Mar 29, 2011 at 05:08 UTC | |
by ikegami (Patriarch) on Mar 29, 2011 at 08:52 UTC | |
by syphilis (Archbishop) on Mar 29, 2011 at 10:43 UTC |