Next: lisp-string-to-foreign, Previous: foreign-string-free, Up: Strings
array-total-size-limit
, by default.
The foreign-string-to-lisp
function copies at most size
characters from ptr into a Lisp string.
When null-terminated-p is true (the default), characters are
copied until size is reached or a NULL
character is
found.
If ptr is a null pointer, returns nil.
Note that the :string
type will automatically convert between
Lisp strings and foreign strings.
CFFI> (foreign-funcall "getenv" :string "HOME" :pointer) => #<FOREIGN-ADDRESS #xBFFFFFD5> CFFI> (foreign-string-to-lisp *) => "/Users/luis"