# Context in C, when call are from JNI to normal C
private class FromJavaCallContext
super CallContext
redef fun cast_to(mtype, name)
do
if mtype.java_is_nit_object then
return "({mtype.cname})nit_ffi_with_java_nit_object_data(nit_ffi_jni_env, {name})"
else
return "({mtype.cname})({name})"
end
end
redef fun cast_from(mtype, name)
do
if mtype.java_is_nit_object then
return "nit_ffi_with_java_new_nit_object(nit_ffi_jni_env, {name})"
else
return "({mtype.jni_type})({name})"
end
end
redef fun name_mtype(mtype) do return mtype.jni_type
end
src/ffi/java.nit:468,1--491,3