caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Initialising caml values from C
@ 2005-04-19  8:55 Jonathan Roewen
  2005-04-19  9:37 ` [Caml-list] " Olivier Andrieu
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Roewen @ 2005-04-19  8:55 UTC (permalink / raw)
  To: caml-list

Hi,

I'm building an ocaml-native program (actually an OS). Anyways, I
initialise the ocaml runtime from C, but the problem I have is that I
want a couple of caml values to be initialised by calling into C-land.

Something like: (lfb is a linear frame buffer)

external get_lfb: unit -> (int32, Bigarray.int32_elt,
Bigarray.c_layout) Bigarray.Array2.t = "get_lfb"

(* the part that doesn't seem to work *)

(* create a cairo instance for drawing into the LFB *)
let cairo = Cairo.create ()
(* gets the LFB, makes it into a cairo image, then sets it as surface
   for cairo to draw into *)
let _ = Cairo.set_target_image cairo (of_bigarr_32 true (get_lfb ()))

If I instead call some initialiser functions to set up the cairo
instances, it seems to be okay... but it'd make life a lot easier if
the above would work correctly. It'd especially help with other parts
of the code that use the above (and other functions/values).

Jon


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

end of thread, other threads:[~2005-04-19 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-19  8:55 Initialising caml values from C Jonathan Roewen
2005-04-19  9:37 ` [Caml-list] " Olivier Andrieu
2005-04-19 22:09   ` Jonathan Roewen

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