[racket] FFI and varargs

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Wed Feb 18 21:32:16 EST 2015

Yes. You can't produce a single ctype that represents a vararg
function, but you can create a wrapper that will produce (and call) a
fixed-arity ffi wrapper, based on the number of actual parameters you
pass it. See this example (using C's printf) by Eli Barzilay:
[http://svn.plt-scheme.org/plt/trunk/collects/ffi/c-printf.ss]. This
came out of a mailing list discussion from 2005:
(The example code may or may not run as-is, since it's from an older
version of the language.)


On Wed, Feb 18, 2015 at 5:32 PM, Bartosz Przygoda <bprzygoda at gmail.com> wrote:
> Hello,
> Defining wrapper that will call a vararg function - is it doable?
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.