[plt-scheme] v299 FFI question

From: Yoav Goldberg (yoav.goldberg at gmail.com)
Date: Mon Sep 26 14:00:34 EDT 2005

Hello.
I've started using the v299 FFI, and it is VERY nice.

But, there are some things I couldn't understand from the documentation.

I have the following C type declerations:

    typedef struct StructName FAR *StructPtr;
    typedef struct StructName
    {
        StructPtr link;          /* 1 */
        int data[12];            /* 2 */
    }   StructName

How do I define it in the new FFI (preferably using define-cstruct)?

My problems are:
1/  define-cstruct creates a binding for _StructName-pointer, but I
can't use it inside the
    struct I'm currently defining. Can I just use _pointer instead?
2/  What type is it?

Also - when I define an enum: (define en (_enum '(a b c))) - how do I
access the enumerated elements?

Thanks!

Yoav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20050926/50fff8db/attachment.html>

Posted on the users mailing list.