Package: cffi
Function foreign-string-to-lisp
Lambda Listforeign-string-to-lisp (pointer &key offset count max-chars encoding) ArgumentsReturn ValueA Lisp string. Details 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. ExamplesCFFI> (foreign-funcall "getenv" :string "HOME" :pointer) => #<FOREIGN-ADDRESS #xBFFFFFD5> CFFI> (foreign-string-to-lisp *) => "/Users/luis" | See also |