Next: lisp-string-to-foreign, Previous: foreign-string-free, Up: Strings [Contents][Index]
A pointer.
An integer greater than or equal to 0. Defauls to 0.
Either nil
(the default), or an integer greater than or equal to 0.
An integer greater than or equal to 0.
(1- array-total-size-limit)
, by default.
Foreign encoding. Defaults to *default-foreign-encoding*
.
A Lisp string.
The foreign-string-to-lisp
function converts at most
count octets from ptr into a Lisp string, using the
defined encoding.
If count is nil
(the default), characters are copied
until max-chars 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"