Send in a Perl aref to C, get back a Perl array (and using the generated XS)

Posted on January 27, 2017. Filed under: Uncategorized | Tags: , , , , |

Send in a Perl aref to C, get back a Perl array (and using the generated XS)

This will show you how to pass a Perl array reference (aref) into a C function, convert the aref into a C array, work on it, then push it back onto the stack so the C function returns it as a Perl array.

It’ll also show that although we [use] Inline::C, the XS code it generates can be used in your distribution, even without the end-user needing Inline installed.

See also the Perlmonks copypasta post.

Liked it here?
Why not try sites on the blogroll...