Relationship of LablGTK/GTK signal processing

Robert Roessler roessler at rftp.com
Tue Mar 15 21:37:58 CET 2005


Robert Roessler wrote:

> Jacques Garrigue wrote:
> 
>> From: Robert Roessler <robertr at rftp.com>
>> ...
>> Note that the above code code doesn't attempt to do anything about the
>> pointer. It just allows you to get a hand on it, and eventually call a
>> C function that will use it. No memory management is done.
>> Note also that this pointer is "boxed", ie. the actuall pointer is in
>> the second field of an abstract ocaml block, which you can access on
>> the C side as Field(p,1).
> 
> 
> Reality is not quite matching expectations... to start with, the 
> callback ends up looking like int -> Gpointer.boxed option -> unit... 
> the runtime "boxed" pointer as seen by my
> 
> CAMLprim value ml_scn_from_boxed_pointer(value bpVal)
> 
> function has tag==0 and Wosize==1.  Seriously.  Also, interpreting the 
> pointed-to memory as the expected structure is problematic. :)
> 
> BTW, this function is intended to construct a record representation of 
> the Scintilla "SCNotification" struct.

That was easy - upon short reflection, it became clear that the extra 
level of indirection is because of the "option" - marshalling (at 
least in this direction) now functions properly! :)

Robert Roessler
roessler at rftp.com
http://www.rftp.com




More information about the Lablgtk-list mailing list