|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: Need to pass an unsigned char array from an xsub back to Perlby Eliya (Priest) |
| on Mar 30, 2012 at 16:30 UTC ( #962647=note: print w/ replies, xml ) | Need Help?? |
|
Your code is somewhat confusing as to whether you want to return the unsigned char[16] as a Perl array/list (16 individual values), or as a scalar (Perl string of length 16). Assuming the latter, I think you're approaching things in a much too complicated way. Simply create a char[16] buffer in C, let XSessionID() fill it, and place a copy of it in an SV, which you then return:
Output:
Not using Inline::C (i.e. using a normal XSUB instead), this should translate to something like
Or, if you want to use PPCODE:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||