theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3Call_jv.c File Reference

tag: nhi1-release-250425 More...

#include <jni.h>
#include "LibSq3Lite_jv.h"
+ Include dependency graph for Sq3Call_jv.c:

Go to the source code of this file.

Functions

Sq3Fupu_Sq3LiteExec_callback_call_ret jvsq3lite_LiteExecCall (Sq3Fupu_Sq3LiteExec_callback_call_args)
 
Sq3LiteExecV2CB_ret jvsq3lite_LiteExecV2Call (Sq3LiteExecV2CB_args)
 

Detailed Description

tag: nhi1-release-250425

Definition in file Sq3Call_jv.c.

Function Documentation

◆ jvsq3lite_LiteExecCall()

Definition at line 15 of file Sq3Call_jv.c.

16{
18
19 struct MkProcCallS const * const call = callV1;
20 JNIEnv *env = call->env;
21 MkRtSetup_RT(call->mkrt);
22
23 jobjectArray valsO = (*env)->NewObjectArray(env, num, MK(Class_String), NULL);
24 jobjectArray colsO = (*env)->NewObjectArray(env, num, MK(Class_String), NULL);
25
26 for (int i=0; i<num; i++) {
27 (*env)->SetObjectArrayElement(env, valsO, i, (*env)->NewStringUTF(env,vals[i]));
28 (*env)->SetObjectArrayElement(env, colsO, i, (*env)->NewStringUTF(env,cols[i]));
29 }
30
31 // call the function
32 if (call->class == NULL) {
33 // method call of the same class
34 (*env)->CallObjectMethod(env, call->object, call->method, valsO, colsO);
35 } else if (call->object == NULL) {
36 // static method call returning an object
37 (*env)->CallStaticObjectMethod(env, call->class, call->method, valsO, colsO);
38 } else {
39 // method call of an other class
40 (*env)->CallNonvirtualObjectMethod(env, call->object, call->class, call->method, valsO, colsO);
41 }
42 if((*env)->ExceptionCheck(env) != JNI_FALSE) goto error_lng;
43
44 return 0;
45error_lng:
46 OT_ERROR_LNG_2_META(NULL);
48 return 1;
49}
#define MkErrorStack_0E()
#define MkRtSetup_RT(r)
#define Sq3Fupu_Sq3LiteExec_callback_call_check

◆ jvsq3lite_LiteExecV2Call()

Sq3LiteExecV2CB_ret jvsq3lite_LiteExecV2Call ( Sq3LiteExecV2CB_args )

Definition at line 52 of file Sq3Call_jv.c.

53{
55
56 struct MkProcCallS const * const call = callV2;
57 JNIEnv *env = call->env;
58
59 jobject valsO = MK(MkBufferListC_ObjNew)(MK_RT_CALL env,vals);
60 jobject colsO = MK(MkBufferListC_ObjNew)(MK_RT_CALL env,cols);
61
62 // call the function
63 if (call->class == NULL) {
64 // method call of the same class
65 (*env)->CallObjectMethod(env, call->object, call->method, valsO, colsO);
66 } else if (call->object == NULL) {
67 // static method call returning an object
68 (*env)->CallStaticObjectMethod(env, call->class, call->method, valsO, colsO);
69 } else {
70 // method call of an other class
71 (*env)->CallNonvirtualObjectMethod(env, call->object, call->class, call->method, valsO, colsO);
72 }
73
74 // check on error
75 if((*env)->ExceptionCheck(env) != JNI_FALSE) {
76 // is the ERROR from "java" or "jvmkkernel"
77 OT_ERROR_LNG_2_META(NULL);
78 }
79 return MkErrorStack_0E_Check();
80}
#define MkErrorStack_0E_Check()
#define MK_RT_CALL
#define Sq3Fupu_Sq3LiteExecV2CB_callback_call_check