Next: translate-camelcase-name, Previous: foreign-funcall-varargs, Up: Functions [Contents][Index]
fixed-arguments ::= { arg-type arg }* [return-type]
arguments ::= { arg-type arg }* [return-type]
options ::= (&key convention)
A foreign pointer.
A foreign type.
An argument of type arg-type.
A foreign type, :void
by default.
A lisp object.
One of :cdecl
(default) or :stdcall
.
The foreign-funcall-pointer-varargs
macro is the main primitive
for calling foreign variadic functions. It behaves similarily to
foreign-funcall-pointer
except fixed-arguments
are
distinguished from the remaining arguments.
CFFI> (with-foreign-pointer-as-string (s 100)
(setf (mem-ref s :char) 0)
(foreign-funcall-pointer-varargs
(foreign-symbol-pointer "sprintf") () (:pointer s :string "%.2f")
:double (coerce pi 'double-float) :int))
⇒ 3.14