Search found 1 match

by muyinliu
Wed Oct 12, 2016 1:34 am
Forum: Common Lisp
Topic: how do i pass structs by value with cffi-libffi?
Replies: 6
Views: 19303

Re: how do i pass structs by value with cffi-libffi?

You just have to add `:class xxx` to `cffi:defcstruct` then `(cffi:defmethod translate-into-foreign-memory (object (type xxx) pointer) yyyy)`, it will pass structure by value to a foreign function automatically!! Amazing!! And `(cffi:defmethod translate-from-foreign (pointer (type xxx)) zzzz)` will ...