in reply to Re^4: 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
Does that work ok for you ? Make sure there's an empty line after the end of the C code.use warnings; use strict; use Inline ('C' => 'DATA'); callback(); sub p_callback { print "in perl callback\n"; } __DATA__ __C__ void callback(){ dSP; PUSHMARK(SP); call_pv("p_callback", G_DISCARD|G_NOARGS); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: XS: Passing an external library's function a Perl XS callback
by stevieb (Canon) on Aug 15, 2016 at 13:27 UTC |