[racket] Access c based dll through ffi

From: Danny Yoo (dyoo at hashcollision.org)
Date: Wed Feb 20 14:01:07 EST 2013

On Wed, Feb 20, 2013 at 7:01 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> If you load this DLL via DrRacket, then you won't see output, because
> stdout isn't connected to anything in particular in a GUI appplication.
> That is, stdout at the C level is not redirected to the Racket current
> output port.

That being said, here is an example to show how to access the
scheme_printf_utf8 function from the C side:


The key part of this is allowing the C code to access the
scheme_printf_utf8 function:


by pulling it from the FFI:


and passing it along as a function pointer:


where the C code can use it:


Posted on the users mailing list.