Discussion:
[Larceny-users] c union
Eduardo Cavazos
2009-02-28 22:24:36 UTC
Permalink
Dear Larceny FFI Wizards,

What's the proper way to specify a C union using the FFI?

Ed
Eduardo Cavazos
2009-02-28 22:50:43 UTC
Permalink
Post by Eduardo Cavazos
What's the proper way to specify a C union using the FFI?
My workaround for now was to just do a sizeof on the union and define:

(define make-XYX (make-bytevector the-size-of-XYZ))

Ed
Felix Klock
2009-03-03 18:56:20 UTC
Permalink
Ed (cc'ing larceny-users)-
Post by Eduardo Cavazos
Post by Eduardo Cavazos
What's the proper way to specify a C union using the FFI?
(define make-XYX (make-bytevector the-size-of-XYZ))
This is best current option I can think of.

----

Of course the above is not helpful when the C union is itself a
function parameter (as opposed to a pointer to the union). The
current Larceny FFI does not attempt to address that case directly.

The Larceny FFI is also missing arbitrary struct parameters; adding
the latter does not seem trivial to me, so we have been trying to get
by without it.

-Felix

Continue reading on narkive:
Loading...