[cffi-devel] callbacks with variable arguments

Anselm Helbig anselm at chemie.fu-berlin.de
Sat May 20 07:44:18 UTC 2006


Hi list!

Background: I'm trying to write a CFFI interface to the silc client library
(see silcnet.org), for use with my silcbot. This is on SBCL 0.9.11, Debian
sarge, CFFI-tarball from 2006-04-24, silc toolkit 1.0.2.

Problem: the silc client library needs callbacks with variable argument lists.
Is there a portable way to access these arguments?

Possible solutions:

- I could define additional arguments to fit the maximal
  size of the argument list, and do some byte-shifting if necessary. Yuck!

- This should be possible to do in ECL. Cons: I lose portability, and ECL does
  not seem to be as widely supported on Linux as SBCL (libraries might break),
  and since this is my first CL-project I don't feel like patching libraries
  myself yet.

Has anyone a better idea how to accomplish this?

Regards,

Anselm



More information about the cffi-devel mailing list