define-foreign-funcallable the-name args &key lambda-list documentation result-type language no-check calling-convention => the-name
A symbol naming the Lisp function.
The other arguments are interpreted as by define-foreign-function.
This is like define-foreign-function, but creates a function with an extra argument at the start of the argument list for the address to call.
Define a caller for this shape:
(fli:define-foreign-funcallable
call-with-string-and-int
((string (:reference-pass :ef-mb-string))
(value :int)))
(fli:register-module "msvcrt")
Call printf. Note that the output goes to console output which is hidden by default:
(let ((printf-func
(fli:make-pointer :symbol-name "printf")))
(call-with-string-and-int
printf-func "printf called with %d" 1234))
LispWorks Foreign Language Interface User Guide and Reference Manual - 7 Dec 2011