From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=5.0 tests=HTML_00_10,HTML_MESSAGE, SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 91F5ABC69 for ; Mon, 2 Jul 2007 13:06:04 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l62B64ph025889 for ; Mon, 2 Jul 2007 13:06:04 +0200 Received: by ug-out-1314.google.com with SMTP id j3so1233348ugf for ; Mon, 02 Jul 2007 04:06:03 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=ODFaCYY0oWmdTlU1GQQtRrkRC4SLVWkHJzdQfzgwuGgwlu5ctnPpId1oG4KNUBHVrmWo8yW2jwuGzcy67iKCpyuhtvBAp4RMRdmbBqRjUjwN5DUnjUCYyt4quAH2rAKbpmcYaRoQXjQ45nIZfPzrD94CfrFJV/rp45KNJYu+ZxQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=dMeRwpi7mKT673B45dz24Qtgw0ztpsW8X0eSXccdQVmMnzU2ybbEKlq/n7FEjmoYGDs+s1O1Pb2Og1Bh5ELN/GtYowFCVPyX675Ki+cCr8pcZ1kjyaoUWXDJaAS0vBU30gLRxJvaloXZZPQO8AgY6KMzIDQrx3UvKqbxOsgp97U= Received: by 10.82.152.16 with SMTP id z16mr12707562bud.1183374363312; Mon, 02 Jul 2007 04:06:03 -0700 (PDT) Received: by 10.82.112.15 with HTTP; Mon, 2 Jul 2007 04:06:03 -0700 (PDT) Message-ID: <1262c4ee0707020406s7da99e37mc6706db8d35342a0@mail.gmail.com> Date: Mon, 2 Jul 2007 13:06:03 +0200 From: "Oliver Kania" To: caml-list@yquem.inria.fr Subject: embedding ocaml from C++ -- PODs MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_66282_5870681.1183374363101" X-j-chkmail-Score: MSGID : 4688DC1C.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 4688DC1C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 oliver:01 oliver:01 functions:01 functions:01 data:02 data:02 objects:02 objects:02 languages:03 languages:03 embedding:03 generally:04 generally:04 ------=_Part_66282_5870681.1183374363101 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, the OCAML documentation gives good explanation about how call OCAML functions from C. However , what I want to do is the following. I have a C structure with many fields. I want to be able to initialize this structure both in C and in Ocaml and want access to the same instance from both languages. The structure could be a global object in OCAML and C. The important point is that I want to have access to the very same data and not to any copies, which means I want to pass a reference from OCAML to C or vice versa. More generally speaking, I would like to create objects in C and pass references to these objects to the OCAML side and vice versa. Its all about data flow between the two sides. ------=_Part_66282_5870681.1183374363101 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello,
the OCAML documentation gives good explanation about how call OCAML functions from C.
However , what I want to do is the following. I have a C structure with many fields.
I want to be able to initialize this structure both in C and in Ocaml and want access to the same instance from both languages.
The structure could be a global object in OCAML and C. The important point is that I want to have access to the very same
data and not to any copies, which means I want to pass a reference from OCAML to C or vice versa.
More generally speaking, I would like to create objects in C and pass references to these objects to the OCAML side and vice versa.
Its all about data flow between the two sides.

------=_Part_66282_5870681.1183374363101--