in reply to Extending with C functions - some basic questions
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extending with C functions - some basic questions
by unlinker (Monk) on Dec 18, 2010 at 05:31 UTC | |
by BrowserUk (Patriarch) on Dec 18, 2010 at 05:46 UTC | |
by Anonymous Monk on Dec 18, 2010 at 07:11 UTC |