Package: cffi

Function get-var-pointer

Lambda List

get-var-pointer (symbol)

Arguments

symbol -- A symbol denoting a foreign variable defined with defcvar.

Return Value

A foreign pointer.

Details

The function get-var-pointer will return a pointer to the foreign global variable symbol previously defined with defcvar.

Examples

  CFFI> (defcvar "errno" :int :read-only t)
  => *ERRNO*
  CFFI> *errno*
  => 25
  CFFI> (get-var-pointer '*errno*)
  => #<A Mac Pointer #xA0008130>
  CFFI> (mem-ref * :int)
  => 25  
 

See also