In c I have a routine that needs to pass back 2 numbers.
x(int *x,int *y)
{
....
}
I've been trying to rearrange my c/perl so that the c is designed
with perl defaults in mind.
my XS is currently(close but not compiled)
int
X(int opt1,int opt2)
PPCODE:
{
int x,y;
x(&x,&y);
XPUSHs(sv_2mortal(newSViv(x)));
XPUSHs(sv_2mortal(newSViv(y)));
XSRETURN(2);
}
in perl it would be
($x,$y) = X();
What I would like would be
int
X(int *opt1,int *opt2);
I'm using perl5.6.1
Can I Just ?
X(\$x,\$y);
After all that I now am able to ask a question!
Can I pass a pointer to a scalar in a perl script,
straight through the XS to a c routine expecting a
pointer to an int?