(ffi:clines
 "
typedef void (*cb_t)( void );

extern void call_it( cb_t cb )
{
    if( cb )
        cb();
}
")


(eval-when (:compile-toplevel :load-toplevel)
  (require 'cffi))

(cffi:defcfun ("call_it" call-it) :void
  (cb :pointer))

(cffi:defcallback my-cb :void ()
  (format t "Hello world!~%"))

(call-it (cffi:callback my-cb))

(quit)
