Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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@l...>
Subject: [Caml-list] Interfacing_C_with_Objective_Caml
Hello Camlers,

I designed a simple OCaml module with a abstract type t and
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

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

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 :
Offre soumise à conditions.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: