Next: inc-pointer, Previous: foreign-alloc, Up: Pointers [Contents][Index]
A foreign pointer, or
A Lisp symbol or an instance of
foreign-symbol-pointer will return a foreign
pointer corresponding to the foreign symbol denoted by the string
foreign-name. If a foreign symbol named foreign-name
nil is returned.
ABI name manglings will be performed on foreign-name by
foreign-symbol-pointer if necessary. (eg: adding a leading
underscore on darwin/ppc)
library should name a foreign library as defined by
:default (which is the default)
or an instance of
foreign-library as returned by
Important note: do not keep these pointers across saved Lisp cores as the foreign-library may move across sessions.
CFFI> (foreign-symbol-pointer "errno") ⇒ #<A Mac Pointer #xA0008130> CFFI> (foreign-symbol-pointer "strerror") ⇒ #<A Mac Pointer #x9002D0F8> CFFI> (foreign-funcall-pointer * () :int (mem-ref ** :int) :string) ⇒ "No such file or directory" CFFI> (foreign-symbol-pointer "inexistent symbol") ⇒ NIL