i’m trying to write a binding for the ggi library using Ruby/DL, but i am
unclear on how to best deal with a couple of issues.
for instance given this from the header file:
typedef signed short sint16;
typedef struct { sint16 x, y; } ggi_coord;
how does one translate this to Ruby/DL? i put:
typealias “sint16”, "signed short"
Ggi_coord = struct [ “sint16 x”, “sint16 y” ]
but it dosen’t work, saying that sint16 is an unknown type.
and what about:
typedef struct { uint16 r,g,b,a; } ggi_color;
typedef struct { uint16 size; ggi_color *data; } ggi_clut;
i put:
Ggi_color = struct [ “uint16 r”, “uint16 g”, “uint16 b”, “uint16 a” ]
Ggi_clut = struct [ “uint16 size”, “Ggi_color data *” ]
which bombs on Ggi_color data *.
i’m not a c coder so i’m sort of pecking my way through this. any help is
greatly appreciated.
-transami