Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Interfacing_C_with_Objective_Caml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: matthieu.dubuget@libertysurf.fr <matthieu.dubuget@l...>
Subject: [Caml-list] Interfacing_C_with_Objective_Caml
Hello Camlers,

I designed a simple OCaml module with a abstract type t and
functions
to create and manipulate values of that type.

type t
val create : int -> t
val use : t -> int
...

I now want to turn this module as a C dynamic link library under
Windows.

I do not know exactly how I should manage the ocaml values
created by
ocaml's 'create' function: passed to C (as pointer/handle),
and returned back
to ocaml when calling 'use' function.

I think I should register the values returned by 'create' in
order to
avoid them to be garbage collected between 'create' and
'use' calls,
but I don't know how to do this?

I should also provide a way to unregister those values?

I did not find (or understand ;-) how to achieve this using
a tool
(like CamlIDL or camouflage). It's why I'm trying to do it
by hand
first.

Thanks in advance

Matthieu Dubuget


********** L'ADSL A 20 EUR/MOIS********** 
Avec Tiscali, l'ADSL est à 20 EUR/mois. Vous pourrez chercher longtemps avant de trouver moins cher ! 
Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/
Offre soumise à conditions.


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners