Hi Folks,

I've been trying out FFI using Tomas Hlavaty's ffi.l wrapper. All goes well in terms of generating wrappers, but I don't know how to call the functions from picolisp:

Here's my ffi file:

(load "ffi.l")
(module 'epi '((X) (pack "epi:" (cddr (chop X)))))
(include "epidemic.h")
(put 'cwrap 'RNG* (get 'cwrap 'int))
(put 'cbody 'RNG* (get 'cbody 'int))
(cfun RNG* new_RNG (ulong seed))
(cfun double RNG_next_double (RNG* self))

I guess due to the underscores, the function names get garbled in the .fn file:

  {cfun_new_RNG, "epi:w_RNG"},
  {cfun_RNG_next_double, "epi:G_next_double"},

Everything links fine, but are these functions automatically exposed? Are there any tips so I can do things like

(setq r (epi:new_RNG 1))

Thanks!
Simon

--
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

Reply via email to