caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] C interop: Return values in parameters
@ 2012-12-30 13:08 Marek Kubica
  2012-12-30 14:01 ` Török Edwin
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Kubica @ 2012-12-30 13:08 UTC (permalink / raw)
  To: caml-list

Hi,

I am trying to wrap a C library in OCaml but I don't know how to do
this particular thing:

I have a library that looks roughly like this:

int function(void** ptr);

So I get an int as return value to show whether the function succeeded
and it *sets* the ptr.

void* ptr;
function(&ptr);
// ptr is different now

How can I wrap such a function in OCaml? When I call my OCaml wrapper

let retval = function ptr in
    ...

the pointer does not get updated. Is there a function in the C API to
force OCaml to update the values?

regards,
Marek

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-31  1:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-30 13:08 [Caml-list] C interop: Return values in parameters Marek Kubica
2012-12-30 14:01 ` Török Edwin
2012-12-30 14:19   ` Marek Kubica
2012-12-30 14:36     ` Gabriel Scherer
2012-12-31  1:48       ` Marek Kubica

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