Firstly, once again "thank you" to everyone who works on SWIG. A great
and very useful tool.
Here is my situation: I am porting an application which, through the
fell powers of XS, allows its users to write callbacks in Perl.
It calls something close to this:
<sets up function call>
rcount = call_sv(fcSV, G_EVAL | G_ARRAY);
(Bear with me, I am far from being an XS expert. :>)
In the Perl code, callbacks are bound like:
$c_program->map($callback_name => \&Perl_callback);
...anyway, I read in the SWIG documentation that native callbacks aren't
supported, except when they are. Section 5.4.9 says:
Although SWIG does not normally allow callback functions to be written in
the target language, this can be accomplished with the use of typemaps and
other advanced SWIG features. This is described in a later chapter.
...my questions are 1) which later chapter (I couldn't find it! :<), and
2) does anyone have experience doing this with perl5 typemaps? Anything
similar? 3) Will flirting with catastrophe and using integers for the SV
lead to bliss or eternal torment? (I think I know the answer, but I'd
better check! :>)
Please save me from the horrors of XS hell! I /so/ don't want to have to
port all of this by hand. It might make me cry and stuff. <sniff>
Thank you, and have a fantastic day! :>
_Jesse Williamson ;-};