Defining callback functions with varargs
Hi everyone,
currently I’m trying to define a callback function in Lispworks that accepts varargs (as that is the defined interface for the callback), i.e. the defined callback must match the following signature:
void myCallback(Component c, myString name, myStatus status, myString category,
myString message, ....);
Defining a similar callback from Lisp for the non-variable arguments is simple, e.g.
(fli:define-foreign-callable ("myCallback" :result-type :void :calling-convention :cdecl)
((component component-ptr)
(name (:reference-return my-string))
(status my-status)
(category (:reference-return my-string))
(message (:reference-return my-string)))
…)
However for the access to the remaining arguments I’d need access to the stack-pointer to access and manually convert the arguments based on the message string, and I can’t find anything related to that in the documentation…
Has anyone done something like this?
Regs, Pierre.
--
Pierre R. Mai <pmai@pmsf.de>
PMSF IT Consulting Pierre R. Mai http://www.pmsf.de/
Blumenstr. 4 Goethestr. 32
85417 Marzling 87724 Ottobeuren
Tel. +49(0)8161/935 35 12 +49(0)8332/936 69 13
Fax +49(0)8161/935 35 08 +49(0)8332/936 69 03
VAT ID / USt-ID Nr: DE 212838159 Germany