{"id":1055,"date":"2017-01-27T17:11:16","date_gmt":"2017-01-27T17:11:16","guid":{"rendered":"http:\/\/blog.briang.org\/?p=1055"},"modified":"2017-01-28T14:28:43","modified_gmt":"2017-01-28T14:28:43","slug":"send-in-a-perl-aref-to-c-get-back-a-perl-array-and-using-the-generated-xs","status":"publish","type":"post","link":"https:\/\/blog.briang.org\/?p=1055","title":{"rendered":"Send in a Perl aref to C, get back a Perl array (and using the generated XS)"},"content":{"rendered":"<p><a href=\"http:\/\/blogs.perl.org\/users\/steve_bertrand\/2017\/01\/send-in-a-perl-aref-to-c-get-back-a-perl-array-and-using-the-generated-xs.html\"><strong>Send in a Perl aref to C, get back a Perl array (and using the generated XS)<\/strong><\/a><\/p>\n<blockquote><p>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.<\/p>\n<p>It&#8217;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.<\/p><\/blockquote>\n<p>See also the <a href=\"http:\/\/perlmonks.org\/?node_id=1180481\">Perlmonks copypasta post<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[351,267,5,4,242],"class_list":["post-1055","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-authorstevieb","tag-cpaninlinec","tag-perl","tag-perlmonks","tag-xs"],"_links":{"self":[{"href":"https:\/\/blog.briang.org\/index.php?rest_route=\/wp\/v2\/posts\/1055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.briang.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.briang.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.briang.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.briang.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1055"}],"version-history":[{"count":4,"href":"https:\/\/blog.briang.org\/index.php?rest_route=\/wp\/v2\/posts\/1055\/revisions"}],"predecessor-version":[{"id":1059,"href":"https:\/\/blog.briang.org\/index.php?rest_route=\/wp\/v2\/posts\/1055\/revisions\/1059"}],"wp:attachment":[{"href":"https:\/\/blog.briang.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.briang.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.briang.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}