coyocanid has asked for the wisdom of the Perl Monks concerning the following question:
I am working on a perl XS project and would like to use unpack in the XS/C portion of the code. (Using pack in the perl portion seems to do what I want).
I'm reading the API documents for unpackstring and have some questions questions
The engine implementing the unpack() Perl function.
Using the template pat..patend, this function unpacks the string s..strend into a number of mortal SVs, which it pushes onto the perl argument (@_) stack (so you will need to issue a "PUTBACK" before and "SPAGAIN" after the call to this function). It returns the number of pushed elements.
The strend and patend pointers should point to the byte following the last character of each string.
Although this function returns its values on the perl argument stack, it doesn't take any parameters from that stack (and thus in particular there's no need to do a PUSHMARK before calling it, unlike "call_pv" for example).
I32 unpackstring(const char *pat, const char *patend, const char *s, const char *strend, U32 flags)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XS unpackstring, flags and useage
by BrowserUk (Patriarch) on May 25, 2018 at 02:00 UTC |