Can I pass a reference to a string and have the C-library fill it for me so that I can de-reference it on return and get the string?
You don't need to take a reference first, just pass the string to your C function (think chomp). Your C function sees an SV* pointer and can directly modify the contents.
Also, no one has suggested Inline. Let me do so, it largely prevents you from having to use XS or mess with SWIG.
In reply to Re: Extending with C functions - some basic questions
by blakew
in thread Extending with C functions - some basic questions
by unlinker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |