Made FFI functions private and added some typedef aliases for convenience.