theConfig 10.0
Loading...
Searching...
No Matches
LcCall_jv.c
Go to the documentation of this file.
1
9/* LABEL-NO */
10
11#include <jni.h>
12#include "LibLcConfig_jv.h"
13
14void MK_DECL
15NS(SettingDeleteFree) ( LcSettingDeleteFreeF_ARGS)
16{
17 if (cfg->fSettingDeleteData == NULL) return;
18 MK(ProcFree)((struct MkProcCallS **)&cfg->fSettingDeleteData);
19
20 cfg->fSettingDeleteData = NULL;
21 cfg->fSettingDeleteCall = NULL;
22 cfg->fSettingDeleteFree = NULL;
23}
24
26NS(SettingDeleteCall) ( LcSettingDeleteCallF_ARGS )
27{
29
30 struct MkProcCallS const * const call = (struct MkProcCallS const * const) cfg->fSettingDeleteData;
31 JNIEnv *env = call->env;
32
33 jlong hdl = (jlong) MkObjectHandleGet_1X(cfs);
34
35 // call the function
36 if (call->class == NULL) {
37 // method call of the same class
38 (*env)->CallVoidMethod(env, call->object, call->method, hdl);
39 } else if (call->object == NULL) {
40 // static method call returning an object
41 (*env)->CallStaticVoidMethod(env, call->class, call->method, hdl);
42 } else {
43 // method call of an other class
44 (*env)->CallNonvirtualVoidMethod(env, call->object, call->class, call->method, hdl);
45 }
46
47 // check on error
48 if((*env)->ExceptionCheck(env) != JNI_FALSE) {
49 // is the ERROR from "java" or "jvmkkernel"
50 OT_ERROR_LNG_2_META(cfg);
51 }
52 return MkErrorStack_0E_Check();
53}
54
55void MK_DECL
56NS(ConfigIncludeFree) ( LcConfigIncludeFreeF_ARGS)
57{
58 if (cfg->fConfigIncludeData == NULL) return;
59 MK(ProcFree)((struct MkProcCallS **)&cfg->fConfigIncludeData);
60
61 cfg->fConfigIncludeData = NULL;
62 cfg->fConfigIncludeCall = NULL;
63 cfg->fConfigIncludeFree = NULL;
64}
65
67NS(ConfigIncludeCall) ( LcConfigIncludeCallF_ARGS )
68{
70
71 struct MkProcCallS const * const call = (struct MkProcCallS const * const) cfg->fConfigIncludeData;
72 JNIEnv *env = call->env;
73
74 jstring incDirO = (*env)->NewStringUTF(env,incDir?incDir:"");
75 jstring pathO = (*env)->NewStringUTF(env,path?path:"");
76 jobject ret = MK(MkBufferListC_ObjNew)(MK_RT_CALL env,ret_inout);
77
78 // call the function
79 if (call->class == NULL) {
80 // method call of the same class
81 (*env)->CallObjectMethod(env, call->object, call->method, incDirO, pathO, ret);
82 } else if (call->object == NULL) {
83 // static method call returning an object
84 (*env)->CallStaticObjectMethod(env, call->class, call->method, incDirO, pathO, ret);
85 } else {
86 // method call of an other class
87 (*env)->CallNonvirtualObjectMethod(env, call->object, call->class, call->method, incDirO, pathO, ret);
88 }
89
90 // check on error
91 if((*env)->ExceptionCheck(env) != JNI_FALSE) {
92 // is the ERROR from "java" or "jvmkkernel"
93 OT_ERROR_LNG_2_META(cfg);
94 }
95 return MkErrorStack_0E_Check();
96}
97
98//}
#define LcSettingDeleteFreeF_ARGS
#define LcSettingDeleteCallF_CHECK
#define LcConfigIncludeCallF_CHECK
#define LcConfigIncludeFreeF_ARGS
#define LcConfigIncludeCallF_ARGS
#define LcSettingDeleteCallF_ARGS
#define MkErrorStack_0E_Check()
#define MK_DECL
MkErrorE
#define MkObjectHandleGet_1X(x)
#define MK_RT_CALL