From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA32572; Wed, 16 Jun 2004 19:59:01 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA32417 for ; Wed, 16 Jun 2004 19:59:00 +0200 (MET DST) Received: from web52805.mail.yahoo.com (web52805.mail.yahoo.com [206.190.39.169]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i5GHwxEV020639 for ; Wed, 16 Jun 2004 19:59:00 +0200 Message-ID: <20040616175859.51961.qmail@web52805.mail.yahoo.com> Received: from [66.120.160.255] by web52805.mail.yahoo.com via HTTP; Wed, 16 Jun 2004 10:58:59 PDT Date: Wed, 16 Jun 2004 10:58:59 -0700 (PDT) From: Shishir Ramam Subject: [Caml-list] Caml idl and structure typedefs. To: caml list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at nez-perce with ID 40D08A63.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; typedefs:01 struct:01 struct:01 prepend:01 pointers:01 idl:01 idl:01 typedef:01 ocaml:01 caml:01 camlidl:01 camlidl:01 int:01 int:01 binding:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 - --------- typedef struct a { int x; int y; } a; -------- 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 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