Package: cffi

Macro with-foreign-pointer-as-string

Lambda List

with-foreign-pointer-as-string ((var-or-vars size &rest args) &body body)

Arguments

var -- A symbol.
body -- List of forms to be executed.

Return Value

A Lisp string.

Details

The with-foreign-pointer-as-string macro is similar to with-foreign-pointer except that var is used as the returned value of an implicit progn around body, after being converted to a Lisp string using the provided args.

Examples

  CFFI> (with-foreign-pointer-as-string (str 6 str-size :encoding :ascii)
          (lisp-string-to-foreign "Hello, foreign world!" str str-size))
  => "Hello"  
 

See also