From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 11ECE7F75D for ; Thu, 30 Jan 2014 15:13:40 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.17.10; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.17.10; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.17.10 as permitted sender) identity=helo; client-ip=212.227.17.10; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApACAAld6lLU4xEKlGdsb2JhbABZg0SDWLokgQkWDgEBAQEHCwsJEiqCJgEBBCNWEAtCAgJXBhMJiAAJqxSgWxeJNYNQgVcmB4IvQIFJBI8RikmFEQWPBQ X-IPAS-Result: ApACAAld6lLU4xEKlGdsb2JhbABZg0SDWLokgQkWDgEBAQEHCwsJEiqCJgEBBCNWEAtCAgJXBhMJiAAJqxSgWxeJNYNQgVcmB4IvQIFJBI8RikmFEQWPBQ X-IronPort-AV: E=Sophos;i="4.95,750,1384297200"; d="asc'?scan'208";a="47112985" Received: from moutng.kundenserver.de ([212.227.17.10]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Jan 2014 15:13:39 +0100 Received: from office1.lan.sumadev.de (dslb-088-069-129-019.pools.arcor-ip.net [88.69.129.19]) by mrelayeu.kundenserver.de (node=mreue005) with ESMTP (Nemesis) id 0LpRtB-1VfZQd3qK5-00fDHF; Thu, 30 Jan 2014 15:13:39 +0100 Received: from [192.168.5.106] (dslb-088-069-129-019.pools.arcor-ip.net [88.69.129.19]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 4D56CC00D3; Thu, 30 Jan 2014 15:13:38 +0100 (CET) Message-ID: <1391091217.3822.28.camel@thinkpad> From: Gerd Stolpmann To: =?ISO-8859-1?Q?=D6mer?= Sinan =?UTF-8?Q?A=C4=9Facan?= Cc: OCaml Mailing List Date: Thu, 30 Jan 2014 15:13:37 +0100 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-6FDccyFVT4wmQnf+WmWa" X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Provags-ID: V02:K0:/iyagJwKhYCMkVb2Avf7G/LRLS+LMQvoI2l12ioqtbi A1/beb/SSaQAS2LOvYmLRiQTe2KTM2D/bL+klY9Dza22gfr1O7 z4+PFZ7PSbwOq3axgIK7JZxPpgF9UuqZvcK7bRWYhVBh7x//NJ 5ly7J/qZhd/9qGTf2qbdpS4MBKQ2JnjwkYMenlDsP4um0aKVEc wgXsb/IKCoQTrkvMIf0Mijg+WJ4BtsFcT5E7unlYZDUSTS51IH polQBvHSKAuh5DmDtvW3/KIya2wqQ4E0JHQCW2mXbUFHPTnu7X c7jfbrJjWAA0FItCTWsmLJFdrR2Kg4KnThKsOxEwEvKPGd3+tT peOlptqqwN6jZaPRBc5nfQtM6Tip8vRnfV+THKiDD Subject: Re: [Caml-list] any automated FFI bindings generators? --=-6FDccyFVT4wmQnf+WmWa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Donnerstag, den 30.01.2014, 13:01 +0200 schrieb =C3=96mer Sinan A=C4=9Fa= can: > Hi all, >=20 > 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?r= ev=3D1935&root=3Dlib-ocamlnet2&view=3Dauto See here for an example how to use it: https://godirepo.camlcity.org/wwwsvn/branches/onet4/code/src/nettls-gnutls/= ?root=3Dlib-ocamlnet2 especially gnutls.descr. Basically, this a little OCaml program, and by calling a function (called "standard") you generate a binding, e.g.=20 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 --=20 ------------------------------------------------------------ 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 ------------------------------------------------------------ --=-6FDccyFVT4wmQnf+WmWa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAABAgAGBQJS6l4RAAoJEAaM4b9ZLB5TF3cH/0i9smL3QV7xQd9Gxe4lRkSO 1XiALornwBrGQMK0xIJ5e6q6VyyueKl3254olvgJt/9pT0lJ5fLc+yw5IJHh60Zk W3khK5/RaOEH4KWFwSFDPPi98/rVMIrAoEJvbHwP60QQM3LRNmFLr3oM8MXMv2ud HJ6EeHiaPJhINLwfQzT4KFMcdC6Z6wPUzN/AvpqeAdvNMp72JjJKJ/bbe1Q2Iqcc 2kOM+WDTA/SVq/Ua/tYgA7meF2nzom/RoI1/kOC+fNq5QwlCJY5oTZQrHgF0v1Qu /AlOaZhQiQ0P+MDY6MIGNUY5AZe57zKrL06eCeWWPGNb4SvCRzipfG2E41TT+4A= =1d6l -----END PGP SIGNATURE----- --=-6FDccyFVT4wmQnf+WmWa--