revert to ffi.C as want to support synamic linking