Made FFI use function pointer instead of void*