Next: , Previous: Allocating Foreign Objects, Up: Foreign Types


convert-from-foreign

Syntax

— Function: convert-from-foreign foreign-value type ⇒ value

Arguments and Values

foreign-value
The primitive C value as returned from a primitive foreign function or from convert-to-foreign.
type
A CFFI type specifier.
value
The Lisp value translated from foreign-value.

Description

This is an external interface to the type translation facility. In the implementation, all foreign functions are ultimately defined as type translation wrappers around primitive foreign function invocations.

This function is available mostly for inspection of the type translation process, and possibly optimization of special cases of your foreign function calls.

Its behavior is better described under translate-from-foreign's documentation.

Examples

  CFFI-USER> (convert-to-foreign "a boat" :string)
  => #<FOREIGN-ADDRESS #x097ACDC0>
  => (T)
  CFFI-USER> (convert-from-foreign * :string)
  => "a boat"

See Also

convert-to-foreign
free-converted-object
translate-from-foreign