<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/6da311da670a99572f6a1091fd48e228"
  from="nick.name@i..."
  author="nick.name@i..."
  date="2003-11-18T04:23:50"
  subject="[Caml-list] How to avoid duplicate type declarations in C files with camlidl?"
  prev="2003/11/c5e9aace0d2e0cee5765b5fd98eb520d"
  next="2003/11/7336ceb58e4b58d6cc463bc16d0abb23"
  prev-thread="2003/11/4d893cc52b22fe3904f8f579fcf78b2d"
  next-thread="2003/11/7336ceb58e4b58d6cc463bc16d0abb23"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] How to avoid duplicate type declarations in C files with camlidl?">
<msg 
  url="2003/11/6da311da670a99572f6a1091fd48e228"
  from="nick.name@i..."
  author="nick.name@i..."
  date="2003-11-18T04:23:50"
  subject="[Caml-list] How to avoid duplicate type declarations in C files with camlidl?">
</msg>
</thread>

<contents>
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 &lt;sys/types.h&gt;");
quote(h,"#include &lt;dirent.h&gt;");
quote(h,"#include &lt;unistd.h&gt;");

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

</contents>

</message>

