From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 7108BBC37 for ; Mon, 1 Mar 2010 04:55:02 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkoBAOvIikvRVaC0mGdsb2JhbACPN4QCh1UIFQEBAQEBCAkMBxMirBxCg1IiiFUBAQMFhHYEgxeJBg X-IronPort-AV: E=Sophos;i="4.49,557,1262559600"; d="scan'208";a="57936663" Received: from mail-gy0-f180.google.com ([209.85.160.180]) by mail4-smtp-sop.national.inria.fr with ESMTP; 01 Mar 2010 04:55:01 +0100 Received: by gyb11 with SMTP id 11so837191gyb.39 for ; Sun, 28 Feb 2010 19:55:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=1BfTW4LJo3S2ozvSjPVZQ2D1K/ZmSTJpmlzazK/Kad4=; b=NtZS5Flh8lUo4WKuCE5VJt2FP1g7rnok0gIdYhdrq1qouu6qPHNROs/QHLBTi+hOL4 38ulbiXnZmIRx4LU8SWOnlhtacOpKQWdr4MTJmWNY2h1ubnpiMP6WNVbovuO0XlsaEbJ xUELSBig3NA6HkBsLSEqjcNFropsrYaQ7xKA8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=sJlj2+0EadGRj9c7x626jMNiIrWNtcuqCpiWoozGMqMvxUwl31Qii9U4MNal473MW2 yej6sRV3cZJ7lw3G5q0WP6dRyBO+zhMeSM5Pt14e79uEGviLGRhrYV+E8O6hdx7FIpcq MHTWun1N4l430B/S/k4ceyPB6yXdq/K4BRkJY= MIME-Version: 1.0 Sender: jianzhou.zh@gmail.com Received: by 10.101.130.1 with SMTP id h1mr5191114ann.69.1267415700889; Sun, 28 Feb 2010 19:55:00 -0800 (PST) Date: Sun, 28 Feb 2010 22:55:00 -0500 X-Google-Sender-Auth: 5eef0a19c91ef235 Message-ID: <9dfe358d1002281955k4cb9207bi4afe5d649fc20e05@mail.gmail.com> Subject: How to pass C pointers to Caml From: Jianzhou Zhao To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; pointers:01 ocaml:01 pointers:01 ocaml:01 zhao:98 upenn:01 int:01 caml:02 caml:02 structures:02 manual:06 inria:06 docs:07 examples:07 examples:07 I have been calling OCaml code from C in my project. The C code has some pointers to C structures. I got 'seg fault' when calling the OCaml function receiving C structure pointers. 18.7 at http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html gives the examples that pass int into OCaml. These examples work for me. But, Does OCaml support to pass C structure pointers to OCaml? -- Jianzhou