I would appreciate any and all help/guidance on this. ok, Im under the impression that lisp's cffi cant pass structs by value, but the cffi documentation says:

"To pass or return a structure by value to a function, load the cffi-libffi system and specify the structure as (:struct structure-name). To pass or return the pointer, you can use either :pointer or (:pointer (:struct structure-name)). "

Im re-wrapping the cl-opencv function get-size, which is a wrapper for this opencv function...

CvSize cvGetSize(const CvArr* arr)

and since i don't think cffi had the ability to pass structs by value, with the cffi-libffi system, when the author of cl-opencv wrote the library, so he had to use all of the below code to wrap..cvGetSize

so now how, with the cffi-libffi system, as outlined in the cffi documentation here:

"To pass or return a structure by value to a function, load the cffi-libffi system and specify the structure as (:struct structure-name). To pass or return the pointer, you can use either :pointer or (:pointer (:struct structure-name)). "

would i pass this cvGetSize struct...CvSize by value.....pls give me detailed instructions....I'll be updating the cl-opencv package which is available here:

i would like to know where and how in the cl-opencv package i "load the cffi-libffi system" as the cffi documentation states....and the cffi documentation says "and specify the structure as (:struct structure-name). To pass or return the pointer, you can use either :pointer or (:pointer (:struct structure-name))." I could use detailed instructions on how to do that using the above cvGetSize wrapper..get-size....again here:

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 convert the returned structure data into lisp data.