Package: cffi

Macro foreign-funcall-pointer

Lambda List

foreign-funcall-pointer (pointer options &rest args)

Syntax

arguments ::= { arg-type arg }* [return-type]
options ::= ( &key convention )

Arguments

pointer -- A foreign pointer.
arg-type -- A foreign type.
arg -- An argument of type arg-type.
return-type -- A foreign type, :void by default.
convention -- One of :cdecl (default) or :stdcall.

Return Value

A lisp object.

Details

The foreign-funcall-pointer macro is a primitive for calling foreign functions.

Note: The return value of foreign-funcall-pointer on functions with a :void return type is still undefined.

Implementation-specific Notes

Corman Lisp does not support foreign-funcall-pointer. On implementations that do not support foreign-funcall-pointer the symbol cffi-sys::no-foreign-funcall will be present in *features*. Note: in these Lisps you can still use the defcfun interface.

Examples

  CFFI> (foreign-funcall-pointer (foreign-symbol-pointer "abs") ()
                                 :int -42 :int)
  => 42  
 

See also