1use jni::objects::*;
2use jni::sys::jint;
3use jni::JNIEnv;
4
5mod func;
6mod util;
7
8#[no_mangle]
9pub unsafe extern "system" fn Java_com_github_lauset_vuetomx_rs_RustJNI_init(
10 env: JNIEnv,
11 _class: JClass,
12) {
13 println!("lib vuetom_dc inited.");
14}
15
16#[no_mangle]
17pub unsafe extern "system" fn Java_com_github_lauset_vuetomx_rs_RustJNI_divInt(
18 mut env: JNIEnv,
19 _class: JClass,
20 a: jint,
21 b: jint,
22) -> jint {
23 if b == 0 {
24 env.throw_new("Ljava/lang/Exception;", "divide zero")
25 .expect("throw");
26 0
27 } else {
28 a / b
29 }
30}