caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Caml idl and structure typedefs.
@ 2004-06-16 17:58 Shishir Ramam
  0 siblings, 0 replies; only message in thread
From: Shishir Ramam @ 2004-06-16 17:58 UTC (permalink / raw)
  To: caml list

Hi,
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
signature."

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
pointers. 

thanks,
-shishir



		
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-06-16 17:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-16 17:58 [Caml-list] Caml idl and structure typedefs Shishir Ramam

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