=?Iso-8859-1?Q?Anders_s=F8nderberg_mortensen?= <[EMAIL PROTECTED]> writes:
>On Mon, 4 Nov 2002, Zac Hansen wrote:
>
>> with C.  I want the behaviour of it flattening down the array and pushing
>> each element on to the stack.
>>
>> It doesn't look like I can just cast it to an SV and use the XPUSHs macro,
>> and I don't see anything like XPUSHa..
>>
>> I can obviously do this by hand, but if there's something already done,
>> I'd really rather use it..

AFAIK there is not existing API to do that.

>>
>
>Push a RV to an array value. If my_list is your perl list, this will
>do the job:
>
>XPUSHs(sv2_mortal(newRV( (SV *) my_list)));

That does not mimic 

  foo(@a);

but does

  foo(\@a);

You need to itterate over the AV and XPUSHs each element something like:

  int count = av_len(av)+1;
  EXTEND(sp,count);
  for (i=0; i < count; i++)
   {
    SV **svp = av_fetch(av,i,0);
    if (svp)
     XPUSHs(*svp);
   }
  

>
>--Anders
>
>
>> --Zac
>> [EMAIL PROTECTED]
>>
>>
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/

Reply via email to