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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id F2EF6BC6C for ; Thu, 17 Jan 2008 16:37:53 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGMFj0fAXQImh2dsb2JhbACQFwEBAQgKKYEUnCs X-IronPort-AV: E=Sophos;i="4.24,301,1196636400"; d="scan'208";a="6232120" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 17 Jan 2008 16:37:53 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m0HFbrOh005231 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 17 Jan 2008 16:37:53 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAOsEj0fBL1AZn2dsb2JhbACQFwEBAQEBBgQGCQgYgRScKg X-IronPort-AV: E=Sophos;i="4.24,301,1196636400"; d="scan'208";a="21425687" Received: from gw.exalead.com (HELO exalead.com) ([193.47.80.25]) by mail4-smtp-sop.national.inria.fr with ESMTP; 17 Jan 2008 16:37:53 +0100 Received: from [192.168.204.148] (madpc064.exalead.com [192.168.204.148]) (authenticated bits=0) by exalead.com (8.14.0/8.14.0) with ESMTP id m0HFbZbt031321; Thu, 17 Jan 2008 16:37:41 +0100 Message-ID: <478F763F.3020604@exalead.com> Date: Thu, 17 Jan 2008 16:37:35 +0100 From: Berke Durak User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: Oliver Bandel Cc: caml-list@inria.fr Subject: Re: [Caml-list] Give back a Pair from C to OCaml? References: <1200583973.478f7525e7a5a@webmail.in-berlin.de> In-Reply-To: <1200583973.478f7525e7a5a@webmail.in-berlin.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at discorde with ID 478F7651.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; berke:01 durak:01 berke:01 durak:01 ocaml:01 bandel:01 int's:01 ocaml:01 integers:01 alloc:01 val:01 val:01 oliver:01 caml-list:01 pair:01 Oliver Bandel a écrit : > Hello, > > how can I give back a pair of values (in my case both are > int's) from C to OCaml? > > Didn't found something in the docs so far. > Just allocate a block of size two and store your integers in the two fields of the block. pairv = caml_alloc(2, 0); Store_field(pairv, 0, Val_int(x)); Store_field(pairv, 1, Val_int(y)); -- Berke DURAK