Dear Tomas,

Tomas Hlavaty wrote:
the functions should be "exposed", if you try (setq r (epi:w_RNG 1)),
because that's how you specified the name transformation with the
module function.

The second arg to module says how the C function names are turned into
picolisp function names.  By default, they stay the same.

In your case '((X) (pack "epi:" (cddr (chop X)))) chops off the first
two characters and prepends "epi:".

If you want to keep the name as is and prepend "epi:" only, try:

(module 'epi '((X) (pack "epi:" X)))

That should do the trick;-)

Thanks, the functions are now exposed, but things aren't quite working as I'd like them too. I basically have some 'object-oriented' style C code

(cfun RNG* new_RNG (ulong seed))
(cfun double RNG_next_double (RNG* self))

where a function allocates a new struct, and returns a pointer, which is then used as the first argument to all functions. The code for RNG_next_double just returns integers (are these pointers to doubles?). How do I access a double? - I saw this was on the 'todo' list. Also, is

(setq r (epi:new_RNG 1))

the right way to allocate a pointer RNG* to r?


Reply via email to