caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] How to avoid duplicate type declarations in C files with camlidl?
@ 2003-11-18  4:13 nick.name
  0 siblings, 0 replies; only message in thread
From: nick.name @ 2003-11-18  4:13 UTC (permalink / raw)
  To: caml-list

Hi all, I am stuck with camlidl: I want to declare a struct wich does not go 
in the produced .h file, because I (obviously) want to use the system header 
files. I don't seem to understand how to do so: here's my attempt


quote(h,"#include <sys/types.h>");
quote(h,"#include <dirent.h>");
quote(h,"#include <unistd.h>");

typedef [abstract] void DIR;

struct dirent 
{
  long int d_ino;
  [string] char d_name[256];
};

[unique] DIR * opendir([in,string] char *name);
[unique] struct dirent * readdir([in,ref] DIR *dir);


Written this way, the generated C and the header are wrong, because they 
contain a declaration for "DIR" , wich already exists, however I realize that 
dir is done with a macro. But the generated C source also contains a 
declaration for dirent, and according to the same example in the manual, it 
should not! Can someone show me how to compile and run this simple example? I 
have also tried the tests distributed with camlidl but I get so much 
compilation errors and in such different ways :) that I gave up.

Thanks in advance

Vincenzo

-------------------
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:[~2003-11-18  4:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-18  4:13 [Caml-list] How to avoid duplicate type declarations in C files with camlidl? nick.name

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