Billy Patton <[EMAIL PROTECTED]> writes:
>I'm getting something I'm confused.
>I have this XS code:
>if (SvTYPE(ST(3)) != SVt_PVAV)
>{
> printf("arg 3 must be pointer to list of points!\n");
>}
That will fail when XS is called by normal perl. You never pass an
array as an argument :
something(@foo); # passes multiple args
something(\@foo); # passes one arg but it is refrence not an array
What you probably wanted was
if (!SvROK(ST(3)) || SvTYPE(SvRV(ST(3))) != SVt_PVAV)
{
printf("arg 3 must be pointer to list of points!\n");
}
>
>My test code is :
>$x{a} = undef;
>$_ = 'x';
>@pts = qw ( 0 0 0 10 10 10 10 0 0 0);
>print "not " if Laff::Node->New("BLA-BLA",1,\%x);
>print "ok 5\n";
>print "not " unless Laff::Node->New("BLA-BLA",1,\@pts);
>print "ok 8\n";
>
>Both get the error message about arg 3 must be pointer.
>
>What's the problem?
--
Nick Ing-Simmons
http://www.ni-s.u-net.com/