From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 76C8EBC48 for ; Tue, 19 Apr 2005 10:55:01 +0200 (CEST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.206]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j3J8t0DT016410 for ; Tue, 19 Apr 2005 10:55:01 +0200 Received: by rproxy.gmail.com with SMTP id a36so2009207rnf for ; Tue, 19 Apr 2005 01:55:00 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=asbcYg7nvABcNyVJ19MCUURhPcMZFWBk8qlfkhIiPPSYGsUwwr1vSSOIXntb2lIq95KYdJEUN08r2gE+hyaf/u+y5PsmwVvDg3WoG3X4ffd97QrKRQFmEIBAMaJK+rpOBemO21Ge73OKLd1HVCoTUn802VeV2IPiXso3i+gdY2k= Received: by 10.38.75.77 with SMTP id x77mr307693rna; Tue, 19 Apr 2005 01:55:00 -0700 (PDT) Received: by 10.38.209.53 with HTTP; Tue, 19 Apr 2005 01:55:00 -0700 (PDT) Message-ID: Date: Tue, 19 Apr 2005 20:55:00 +1200 From: Jonathan Roewen Reply-To: Jonathan Roewen To: caml-list@yquem.inria.fr Subject: Initialising caml values from C Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 4264C764.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; initialise:01 ocaml:01 runtime:01 buffer:01 bigarray:01 elt:01 bigarray:01 initialiser:01 ...:98 functions:01 functions:01 int:01 int:01 caml:02 caml:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: Hi, I'm building an ocaml-native program (actually an OS). Anyways, I initialise the ocaml runtime from C, but the problem I have is that I want a couple of caml values to be initialised by calling into C-land. Something like: (lfb is a linear frame buffer) external get_lfb: unit -> (int32, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array2.t =3D "get_lfb" (* the part that doesn't seem to work *) (* create a cairo instance for drawing into the LFB *) let cairo =3D Cairo.create () (* gets the LFB, makes it into a cairo image, then sets it as surface for cairo to draw into *) let _ =3D Cairo.set_target_image cairo (of_bigarr_32 true (get_lfb ())) If I instead call some initialiser functions to set up the cairo instances, it seems to be okay... but it'd make life a lot easier if the above would work correctly. It'd especially help with other parts of the code that use the above (and other functions/values). Jon