I have in a c file, don't curently call it from perl yet, bt have
been calling it from c since dirt was new.  Been using only gcc for past 15
years.
#include <stdarg.h>
int operate_on_figs(short operation, ... )
{
    va_list             arg_ptr;
    va_start(arg_ptr,operation);
    switch(operation) {
         case XOR       :
         case OUTLINE   :
         case NOT       :
         case COMMON    :
         case MERGE     :    f1         = (xy_p)    va_arg(arg_ptr,int);
                                       num_f1 = (short)   va_arg(arg_ptr,int);

                                       f2         = (xy_p)
va_arg(arg_ptr,int);
                                       num_f2 = (short)   va_arg(arg_ptr,int);



Jennifer Cranfill wrote:

> Hello,
>
> 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)?
>
> Thanks in advance.
>
> --Jennifer

Reply via email to