caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Interfacing C procedure using an array as parameter ?
@ 1997-04-28 14:46 Vincent B.G. Leleu
  1997-04-29 15:42 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent B.G. Leleu @ 1997-04-28 14:46 UTC (permalink / raw)
  To: caml-list

[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)





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-04-29 17:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-28 14:46 Interfacing C procedure using an array as parameter ? Vincent B.G. Leleu
1997-04-29 15:42 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).