>>>>> "ecm" == Eric Marsden <[EMAIL PROTECTED]> writes:
>>>>> "kd" == Kick Damien-DKICK1 <[EMAIL PROTECTED]> writes:
kd> I've been reading the CMU CL FFI documentation
kd> <http://cvs2.cons.org/ftp-area/cmucl/doc/cmu-user/aliens.html> and I
kd> don't see any mention of how to represent variadic arguments with it.
kd> Can this be done?
ecm> I don't think that this is possible with the CMUCL FFI (indeed I don't
ecm> know of any other FFI that handles it -- the vararg calling convention
ecm> is tricky to emulate). The best that you can do is write C wrappers
ecm> with fixed arglists for each of the signatures that you need, and bind
ecm> to the wrapper functions.
But even in C, the vararg functions somehow need to determine how many
args there really are the args that are required. Like printf figures
it from the format string.
As a workaround, couldn't you define the FFI with the largest number
of args you expect to use and then have a macro to call the ffi with
the appropriate real, defined number of args.
Ray