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] Interfacing C with Ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-15 (13:31)
From: Julius <flute@n...>
Subject: [Caml-list] Interfacing C with Ocaml

I'am using ocamlidl to build an interface from custom C header but I have some 
problems (sorry if they are trivial)...

First, the following opaque structure definition doesn't pass the compilation 
stage (dereferencing pointer to incomplete type) :
typedef struct foo toto;
I thought this appens because C compiler doesn't know the size of foo 
structure. I tryed to define my own ml2c and c2ml functions (avoiding the 
problem by using pointers toto*) but I don't see how i can convert C pointer 
to Caml value...

Second, I have to give an IDL description of this awful thing...
typedef int (*foo_fun)(void*, int, char**, char**);
... and I really don't see how to do that.

Is anyone can help me? Thanks a lot :)

Julien Blond

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: