<div>To clarify, the issue is not with C++, which I am successfully wrapping with C.<br></div><div><br></div><div>The actual issue is using the c_object type in Lisp--if it comes
back as a CFFI pointer, how can I use it in Lisp as a Lisp object? Is
there something like:<br></div><div><div><br></div></div><div> (ffi:pointer-to-lisp-object ptr)<br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br></div></div><div>--<br></div><div>Stewart Milberger<br></div><div>Kavalogic, Inc.<br></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On July 28, 2018 2:46 PM, Stewart M. <sjm-mail@protonmail.com> wrote:<br></div><div> <br></div><blockquote type="cite" class="protonmail_quote"><div>I am using CFFI with ECL to interface to a C++ library, which has a C++ class with a data member of type 'cl_object'. Simplified, my C++ code is:<br></div><div><br></div><div> class LispObject<br></div><div> {<br></div><div> public:<br></div><div> cl_object object;<br></div><div> };<br></div><div><br></div><div> extern "C" cl_object getObject(LispObject* lo) { return lo->object; }<br></div><div> extern "C" void setObject(LispObject* lo, cl_object clo) { lo->object = clo; }<br></div><div><br></div><div>The full code is:<br></div><div><br></div><div> <a href="https://common-lisp.net/viewvc/clive/trunk/src/extensions/corral/CliveCorral/LispObjectImpl.hpp?revision=149&view=markup#l59">https://common-lisp.net/viewvc/clive/trunk/src/extensions/corral/CliveCorral/LispObjectImpl.hpp?revision=149&view=markup#l59</a><br></div><div><br></div><div>Can I somehow declare the 'cl_object' type for the 'getValue()' and 'setValue()' functions using CFFI 'defcfun' to get and set ECL objects? Is there a technique using the lower-level FFI? I am looking for a way to do this without compiling C code embedded in Lisp, which I am aware ECL can do.<br></div><div><br></div><div>Thank you for any ideas!<br></div><div><br></div><div>--<br></div><div>Stewart Milberger<br></div><div>Kavalogic, Inc.<br></div><div><br></div></blockquote><div><br></div>