flapigen 0.11.0

Tool for connecting libraries written in Rust with other languages
Documentation
r##"#[unsafe(no_mangle)]
pub extern "C" fn Java_org_example_Foo_do_1f1(
    env: *mut JNIEnv,
    _: jclass,
    this: jlong,
    a0: jboolean,
) -> jboolean {
    let mut a0: bool = a0 != 0;
    let this: &mut Foo = unsafe { jlong_to_pointer::<Foo>(this).as_mut().unwrap() };
    let mut ret: bool = f1(this, a0);
    let mut ret: jboolean = if ret { 1 as jboolean } else { 0 as jboolean };
    ret
}"##;

r##"#[unsafe(no_mangle)]
pub extern "C" fn Java_org_example_Foo_f2(env: *mut JNIEnv, _: jclass, a0: jboolean) -> jboolean {
    let mut a0: bool = a0 != 0;
    let mut ret: bool = f2(a0);
    let mut ret: jboolean = if ret { 1 as jboolean } else { 0 as jboolean };
    ret
}"##;


r##"# [ unsafe ( no_mangle ) ] pub extern "C" fn Java_org_example_Foo_init ( env : * mut JNIEnv , _ : jclass , a0 : jboolean , ) -> jlong {
 let mut a0 : bool = a0 != 0;
 let this : Foo = Foo :: new ( a0 ) ;
 let this : Box < Foo > = Box :: new ( this ) ;
 let this : * mut Foo = Box :: into_raw ( this ) ;
 this as jlong
}"##;

r##"impl SomeTrait for JavaCallback {
    #[allow(unused_mut)]
    fn on_state_changed1(&self, a0: i32, a1: bool) {
        swig_assert_eq_size!(::std::os::raw::c_uint, u32);
        swig_assert_eq_size!(::std::os::raw::c_int, i32);
        let env = self.get_jni_env();
        if let Some(env) = env.env {
            let mut a0: jint = a0;
            let mut a1: jboolean = if a1 { 1 as jboolean } else { 0 as jboolean };
            unsafe {
                (**env).CallVoidMethod.unwrap()(
                    env,
                    self.this,
                    self.methods[0usize],
                    a0,
                    a1 as ::std::os::raw::c_uint,
                );
                if (**env).ExceptionCheck.unwrap()(env) != 0 {
                    log::error!(concat!(
                        stringify!(on_state_changed1),
                        ": java throw exception"
                    ));
                    (**env).ExceptionDescribe.unwrap()(env);
                    (**env).ExceptionClear.unwrap()(env);
                }
            };
        }
    }
}"##;