English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Caml idl and structure typedefs.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-16 (17:59)
From: Shishir Ramam <sramam@y...>
Subject: [Caml-list] Caml idl and structure typedefs.
I am running into some troubles with converting
C data-structures from C-to-Ocaml using camlidl. 

A common C coding convention is to use
struct definitions of the form - 

<test.idl> ---------

typedef struct a {
  int x;
  int y;
} a;

</test.idl> --------

Using CamlIdl, this results in a conversion to

<test.ml> ---------
(* File generated from test.idl *)
type a = {
  x: int;
  y: int;
and a = a

</test.ml> ---------

which gives me the following error - 

"Multiple definition of the type name a.
Names must be unique in a given structure or

One method that comes to mind is to prepend and "_" 
for the struct definition when such a case is
encounterd. The trick is that this only needs to be 
done for the struct definition in ocaml, and the 
wrapper code should continue to use the old 
name for the C binding. Anything else would 
require modification of the C code too - a 
problem of some magnitude in itself.

I do not understand the implementation of camlidl 
very well, but given a little help, am willing to 
make necessary modifications.

Was wondering if anyone would be willing to provide


Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.

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