From: "Vincent B.G. Leleu" <vincent@parc.anglia.ac.uk>
To: caml-list@inria.fr
Subject: Interfacing C procedure using an array as parameter ?
Date: Mon, 28 Apr 1997 15:46:15 +0100 [thread overview]
Message-ID: <3364B837.4925@parc.anglia.ac.uk> (raw)
[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)
next reply other threads:[~1997-04-29 7:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-04-28 14:46 Vincent B.G. Leleu [this message]
1997-04-29 15:42 ` Xavier Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3364B837.4925@parc.anglia.ac.uk \
--to=vincent@parc.anglia.ac.uk \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox