[plt-scheme] FFI: problem with define-cpointer-type

From: Sam Phillips (samdphillips at gmail.com)
Date: Thu Sep 25 15:42:15 EDT 2008

On Thu, Sep 25, 2008 at 12:11 PM, Eli Barzilay <eli at barzilay.org> wrote:
> I don't see anything wrong here offhand, but it looks like some
> context is missing.  Specifically, the question is what exactly does
> `my-type-maker' return -- what's the contents of it's `ptr' field.
> You can also just add a printf to the Scheme->C part of your
> definition to see that it gets to run, and check out its input/output.

(my-type-maker) returns a my-type struct the ptr field is an

I placed a printf in the scheme->C lambda checking on what kind of value
is being returned and it is a #<cpointer:my-type-ptr>.

I'm trying to come up with a more concrete simple test (that could
actually just be run), that should expose the behavior.  Just need to find
a simple libc func to use...


Posted on the users mailing list.