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] 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: -- (:)
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

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

</> ---------

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 Archives:
Bug reports: FAQ:
Beginner's list: