[racket-dev] [racket] newbie: foreign C structure definition question

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Nov 17 02:12:28 EST 2010

Two hours ago, Sam Tobin-Hochstadt wrote:
> Python's 'ctypes' library, which also uses libffi under the hood, has arrays:
>   http://docs.python.org/library/ctypes.html#arrays
> and also unions, which we don't have:
>   http://docs.python.org/library/ctypes.html#structures-and-unions
> So it seems like this should be possible, and maybe we can even use
> their code.

They guy who did ctypes knows how to deal with the libffi internals.
(He did the msvc version of the code.)

If you look through the libffi documentation you'll see no mention of
arrays, and an explicit mention of "no special support for unions".

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.