From: Jonathan Roewen <jonathan.roewen@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Initialising caml values from C
Date: Tue, 19 Apr 2005 20:55:00 +1200 [thread overview]
Message-ID: <ad8cfe7e050419015541f5f5e7@mail.gmail.com> (raw)
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
next reply other threads:[~2005-04-19 8:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-19 8:55 Jonathan Roewen [this message]
2005-04-19 9:37 ` [Caml-list] " Olivier Andrieu
2005-04-19 22:09 ` Jonathan Roewen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad8cfe7e050419015541f5f5e7@mail.gmail.com \
--to=jonathan.roewen@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox