in reply to Re^2: XS: Passing an external library's function a Perl XS callback
in thread SOLVED: XS: Passing an external library's function a Perl XS callback
before you can use this. The run ofmine = Perl_get_context();
just segfaults ifdSP;
have not been set viamine
I call on initialisation of my module a XS function which does does domine = Perl_get_context();
and verify that mine is not NULL before trying to call a perl function.mine = Perl_get_context();
The initialisation in XS(!):void dorunperlfunction() { if (mine) { PERL_SET_CONTEXT(mine); dSP; ENTER; SAVETMPS; PUSHMARK(SP); PUTBACK; call_pv("functionname", G_DISCARD|G_NOARGS); FREETMPS; LEAVE; }
PerlInterpreter * mine = NULL; ... void setcallback() CODE: ... mine = Perl_get_context(); ...
|
|---|