On Tue, 23 Oct 2001, Jennifer Cranfill wrote: > I am trying to write a Perl to C extension that passes variable-length > parameter lists from Perl to C. While I know how to pass variable-length > argument lists from Perl to my XS code, I am not sure how to then call a C > function with this variable number of arguments. > > I tried using the macros from stdarg.h, but this induced multiple > compilation problems. Is there any way to do this without writing a switch > statement in my XS code (which would be non-optimal, as I would like to be > able to pass thousands of arguments)?
If you are writing the C function and can change it, you could malloc and fill an array of pointers and pass that, having rewritten the function to exepect that : alternatively you could construct a va_list thingy and use that. HTH -- Vivek