Next: , Previous: , Up: Functions   [Contents][Index]


foreign-funcall-pointer

foreign-funcall-pointer

Syntax

Macro: foreign-funcall-pointer pointer options &rest arguments ⇒ return-value

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

Arguments and Values

pointer

A foreign pointer.

arg-type

A foreign type.

arg

An argument of type arg-type.

return-type

A foreign type, :void by default.

return-value

A lisp object.

convention

One of :cdecl (default) or :stdcall.

Description

The foreign-funcall macro is the main primitive for calling foreign functions.

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

Implementation-specific Notes

Examples

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

See Also

defcfun
foreign-funcall