Thank you for your suggestions, unfortunately the situation is a little
more complicated:

On Wed, 24 Oct 2001, Vivek Dasmohapatra wrote:

> 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

Unfortunately I cannot change the C function. In addition it is a logging
function and the variable arguments are a mix of const char *, integers,
doubles, etc. So filling an array of pointers would be pretty tricky.

> exepect that : alternatively you could construct a va_list thingy and use
> that.

I tried to do a va_list in my XS code, using the stdarg.h file:

int 
c_clog(clogptr, defaultMessage, ...)
        ct_clog_ptr *   clogptr
        const char *    defaultMessage
    PREINIT:
        va_list ap; 
    CODE:
        va_start(ap, defaultMessage);
        RETVAL = clog(*clogptr, defaultMessage, ap);
     OUTPUT:
        RETVAL

However when I compile I get this error:

clogAPI.xs: In function `XS_clogAPI_c_clog':
clogAPI.xs:142: `va_start' used in function with fixed args

Do you know of any way to pass a variable number of arguments (of mixed
types) without using va_list?

Thanks,

--Jennifer



Reply via email to