Re: XS to return Perl Arrays - and NetWare Select()

2011-06-11 Thread NormW
G/Morning, On 11/06/2011 10:27 AM, mich...@insulin-pumpers.org wrote: Take a look on CPAN at the C + macros code as well as the XS code in Net::Interface in the xs module. Thanks! Look at places that use PUSH or XPUSH that return a variety of references. hv's, av's, etc... examples of each

Re: XS to return Perl Arrays - and NetWare Select()

2011-06-11 Thread NormW
G/Morning All Lights sometimes come on very slowly. In addition to tweaking XS code to NetWare's select() to work (more anon) (finally) realised that IO::Select::INET was returning was an object and not the socket needed for select() (Doh!). On the the XS problem that began here have (ftm)

Re: XS to return Perl Arrays - and NetWare Select()

2011-06-09 Thread Brandon McCaig
On Wed, Jun 8, 2011 at 7:11 PM, NormW no...@gknw.net wrote: AFAICT, I want to implement the following Perl call to XS code: my (@ro,@wo,@eo) = nw_select(\@ri,\@wi,\@ei,$wait); Perhaps you meant: my ($ro, $wo, $eo) = nw_select(\@ri, \@wi, \@ei, $wait); That is, instead of getting three arrays

Re: XS to return Perl Arrays - and NetWare Select()

2011-06-09 Thread Josh Goldberg
What I do is something like AV *results; results = newAV(); something = (AV *)SvRV(*other_av_thing); av_store(results,i, something); RETVAL = results; sv_2mortal((SV *)RETVAL); On Wed, Jun 8, 2011 at 4:11 PM, NormW no...@gknw.net wrote: Hi All, AFAICT, I want to implement the

Re: XS to return Perl Arrays - and NetWare Select()

2011-06-09 Thread NormW
G/Morning, On 10/06/2011 4:36 AM, Josh Goldberg wrote: What I do is something like AV *results; results = newAV(); something = (AV *)SvRV(*other_av_thing); av_store(results,i, something); RETVAL = results; sv_2mortal((SV *)RETVAL); Have seen that method in several XS programs