Seed FFI

August 2, 2009

I was bored yesterday and added a simple ffi to Seed…I imagine it might be useful for someone someday.

GObject = imports.GObject;
ffi = imports.ffi;
app = new ffi.Library(); // ffi.Library with no arguments is
                                 //equivalent to g_module_open with 
                                //NULL for filename.
sin = app.sin;
sin.signature = {arguments: [GObject.TYPE_DOUBLE], returns: GObject.TYPE_DOUBLE}
almostzero = sin (3.14);

More interestingly, I have a working computer again! (New 13 inch macbook pro). Hopefully I’ll be blogging and coding a little more often than the last month.