caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] CamlIDL documentation and COM issues
@ 2002-06-04 16:28 Florian Hars
  2002-06-04 17:23 ` Dmitry Bely
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Hars @ 2002-06-04 16:28 UTC (permalink / raw)
  To: caml-list

I am trying to write an interface to an existing C library and I intend 
to use CamlIDL for this task, but I am missing some more HOWTO-like 
documentation.

The library uses a pattern that should be common enough to supported in 
CamlIDL (and explained in the hints on writing IDL files): there is a 
struct that is only of internal relavance, and there is an open and a 
close function that returns or frees a pointer to such a struct, and 
several functions that operate on such a handle:

typedef struct { /* things */ } Foo;
typedef Foo * FooHandle;
FooHandle FooOpen(args...);
int FooOperate(FooHandle fhdl, args...);
void FooClose(FooHandle fhdl);

Now all I need is a way to put this handle into a Caml variable (and, 
optionally, to call FooClose automatically whenever the handle runs out 
of scope). It looks like the [abstract] and [ptr] attributes, either 
alone or in combination, might be relevant for this task. But [ptr] 
requires the Com module, which I do not want to use. (OK, it is tiny 
under unix, but still... what happens if I ever recompile the program 
under windoze? Shouldn't the generally useful features for interfacing 
to C/C++ and the COM-specific stuff be somehow separated, like in a 
module Idl and another module Com? This would certainly help to reduce 
the prevailing confusion over the possible uses of CamlIDL. Or is it 
irrelevant for my problem?)

An example for the use of errorcheck(fn) and a remark on the type of fn 
in errorcheck might be helpful, too.

Oh, and shouldn't the example on page 24 of the Manual (1.0.4) read

  double time() quote(call, "_res=....; ");
                      ^^^^^^
Or is "call" implicit if no ident is given in a quote in a function 
definition?

Yours, Florian Hars.

-------------------
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] 4+ messages in thread

end of thread, other threads:[~2002-06-08 19:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-04 16:28 [Caml-list] CamlIDL documentation and COM issues Florian Hars
2002-06-04 17:23 ` Dmitry Bely
2002-06-07 13:46   ` Florian Hars
2002-06-08 19:16     ` Dmitry Bely

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