From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA22856 for caml-redistribution; Tue, 29 Apr 1997 09:08:15 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA07690 for ; Mon, 28 Apr 1997 16:44:54 +0200 (MET DST) Received: from firefly (firefly.parc.anglia.ac.uk [194.82.46.33]) by nez-perce.inria.fr (8.8.5/8.7.3) with SMTP id QAA16497 for ; Mon, 28 Apr 1997 16:44:49 +0200 (MET DST) Received: from bart.parc.anglia.ac.uk by firefly (SMI-8.6/SMI-SVR4) id PAA25483; Mon, 28 Apr 1997 15:44:47 +0100 Received: from bart by bart.parc.anglia.ac.uk (SMI-8.6/SMI-SVR4) id PAA07059; Mon, 28 Apr 1997 15:46:16 +0100 Message-ID: <3364B837.4925@parc.anglia.ac.uk> Date: Mon, 28 Apr 1997 15:46:15 +0100 From: "Vincent B.G. Leleu" Organization: Anglia Polytechnic University X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.5.1 sun4m) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Interfacing C procedure using an array as parameter ? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis [French version at the bottom] Hello all, Firstly, thanks to those of you who provided me with information about C++/OCaml interfacing, this has been very usefull. This is the first time I interface C/OCaml and also I have a problem : How do I use a parameter which is a pointer on the beginning of an integer array ? The C prototype : ---------------- void EndConfig(int *tid, int nb_tids); /* tid is a pointer on an array of task id nb_tids is the number of task id in the array */ the Caml interface : ------------------- external end_config : int vect -> unit;; value end_config(tids) value tids; { /* what do I put here ? */ } Though the RM provides an example with return list (p.122-3) I am a bit lost regarding the use of vectors. Thanks for any help, Vincent. [Version francaise] Bonjour at tous, Tout d'abord merci aux personnes qui m'ont fourni des informations a propos de l'interfacing de C++/OCaml, elles ont ete tres utiles. C'est la premiere fois que j'interface C/OCaml et aussi j'ai un probleme : Comment utiliser un argument qui est un pointeur sur le debut d'un tableau d'entiers ? Le prototypage C : ----------------- void EndConfig(int *tid, int nb_tids); /* tid is a pointer on an array of task id nb_tids is the number of task id in the array */ l'interface Caml : ----------------- external end_config : int vect -> unit;; value end_config(tids) value tids; { /* que dois-je mettre ici ? */ } Bien que j'ai trouve un exemple dans le MR avec un retour de liste (p.122-3) je suis un peu perdu en ce qui concerne l'utilisation des vectors. Merci pour votre aide, Vincent. ______________________________________________________________ Vincent B.G.Leleu Parallel Computing Research Centre Anglia Polytechnic University Victoria Rd. South, Chelmsford Essex CM1 1JJ England E-Mail : mailto:vincent@parc.anglia.ac.uk URL : http://www.parc.anglia.ac.uk/~vincent Phone : +44 1245 493131 ext. 3416 Fax : +44 1245 495263 - PARC Pager : +44 1426 634330 (phone numbers only)