Am Donnerstag, den 30.01.2014, 13:01 +0200 schrieb Ömer Sinan Ağacan: > Hi all, > > I want to be able to use some very big C libraries from OCaml and I > want to automate process of writing bindings as much as possible. What > are my options for this? Do we have any tools to generate bindings? I ran into this question a couple of months ago. The options we have are not really good (e.g. I tried camlidl before). Because of this I wrote my own utility that is special-cased for my application (bindings of gnutls): https://godirepo.camlcity.org/wwwsvn/branches/onet4/code/tools/stubgen.ml?rev=1935&root=lib-ocamlnet2&view=auto See here for an example how to use it: https://godirepo.camlcity.org/wwwsvn/branches/onet4/code/src/nettls-gnutls/?root=lib-ocamlnet2 especially gnutls.descr. Basically, this a little OCaml program, and by calling a function (called "standard") you generate a binding, e.g. standard "gnutls_alert_description_t gnutls_alert_get (gnutls_session_t session)" The syntax in the string mimicks C header declarations, and can use special data types like ztstr (for zero-terminated string). I haven't found time to make something more systematic out of this idea. Currently, the strong point of this method is that it is quite easy to adapt it to your own needs. Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------