I am struggling a bit to convert a Perl unpack
to Inline::C
@array = unpack("C*", $buf);
This is what I have so far, but I am an Inline::C novice so I am having trouble of what to do next:
STRLEN len;
char* test = SvPVbyte(buf, len);
...
AV* arr = SvRV(?);
Can anyone provide a tip to how to do this?
The smart thing here is probably to avoid calling
unpack
, and do whatunpack
would do, which is simpler.Or, of course, just write the loop and leave out the array if you don't need it :)