Hello all. I have had some time lately to work on my C FFI for Clojure and I think it's pretty much feature complete now. It has support for functions, callbacks, structures, unions and globals. For structures there is support for different alignments.
The library has two main namespaces: clj-native.direct and clj- native.dynamic. The direct namespace uses the "direct mapping" feature of JNA in order to be as efficient and arity and type safe as possible. However, it does not support varargs functions since they require reflection and dynamic translation of the parameters. That's what the dynamic namespace is for: It can map any C function into clojure, even vararg functions like printf but at a higher cost in call time and less safety (it's easy to crash the jvm by sending the wrong type or number of parameters). Access to global variables through the JNA Pointer class is also available in the dynamic namespace. The library is available from github: http://github.com/bagucode/clj-native and clojars: http://clojars.org/clj-native Example usage of the direct namespace can be found here: http://github.com/bagucode/clj-native/blob/master/src/examples/c_lib.clj Please report issues or make requests to my github account or by mail. Enjoy! /Markus -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en