[cffi-devel] Calling Lisp Function from C: How to declare this function in C land ?

Frank Goenninger frgo at me.com
Sat Sep 22 22:28:09 UTC 2012


Am 22.09.2012 um 23:18 schrieb Stelian Ionescu:

> On Sat, 2012-09-22 at 21:27 +0200, Frank Goenninger wrote:
>> 
>> How do I make functions "known" to C land that are purely defined as
>> callbacks in Lisp land? 
> 
> You can't do that directly. Lisp callbacks must be passed to the C code
> as function pointers. You could write a C wrapper that calls the
> callback through a global variable and have the Lisp-side store the
> address of the callback in that variable.

Hmm - thanks! I hoped for a far more elegant solution ... Well, it's C after all ... ;-)

Regards

  Frank





More information about the cffi-devel mailing list