syphilis has asked for the wisdom of the Perl Monks concerning the following question:
There's also a demo in the Inline::C-Cookbook that returns values in the same way without an explicit XSRETURN(x).use warnings; use Inline C => Config => BUILD_NOISY => 1; use Inline C => <<'EOC'; void foo() { dXSARGS; sp = mark; XPUSHs(sv_2mortal(newSVuv(111))); XPUSHs(sv_2mortal(newSVuv(87))); XPUSHs(sv_2mortal(newSVuv(42))); PUTBACK; } EOC @bar = foo(); print "@bar\n"; # prints 111 87 42
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [XS] Correct way to return the stack
by jand (Friar) on Sep 07, 2008 at 19:16 UTC | |
|
Re: [XS] Correct way to return the stack (source)
by tye (Sage) on Sep 07, 2008 at 19:18 UTC | |
by syphilis (Archbishop) on Sep 08, 2008 at 01:31 UTC |