1 | #include "org_zoo_project_ZOO.h" |
---|
2 | #include "service.h" |
---|
3 | #include "service_internal.h" |
---|
4 | #include "service_internal_java.h" |
---|
5 | |
---|
6 | JNIEXPORT jstring JNICALL Java_org_zoo_1project_ZOO_translate |
---|
7 | (JNIEnv *env, jclass _class, jstring msg){ |
---|
8 | const char *message = |
---|
9 | #ifdef JAVA7 |
---|
10 | (*env).GetStringUTFChars(msg,0); |
---|
11 | return (*env).NewStringUTF(_(message)); |
---|
12 | #else |
---|
13 | (*env)->GetStringUTFChars(env,msg, 0); |
---|
14 | return (*env)->NewStringUTF(env, _(message)); |
---|
15 | #endif |
---|
16 | |
---|
17 | } |
---|
18 | |
---|
19 | JNIEXPORT jobject JNICALL Java_org_zoo_1project_ZOO_updateStatus |
---|
20 | (JNIEnv *env, jclass _class, jobject conf, jstring pourc, jstring msg){ |
---|
21 | |
---|
22 | jclass scHashMapClass,scHashMap_class; |
---|
23 | #ifdef JAVA7 |
---|
24 | scHashMapClass = (*env).FindClass("java/util/HashMap"); |
---|
25 | const char *pourcent = (*env).GetStringUTFChars(pourc,0); |
---|
26 | const char *message = (*env).GetStringUTFChars(msg,0); |
---|
27 | #else |
---|
28 | scHashMapClass = (*env)->FindClass(env, "java/util/HashMap"); |
---|
29 | const char *pourcent = (*env)->GetStringUTFChars(env,pourc, 0); |
---|
30 | const char *message = (*env)->GetStringUTFChars(env,msg, 0); |
---|
31 | #endif |
---|
32 | maps* m = mapsFromHashMap(env,conf,scHashMapClass); |
---|
33 | setMapInMaps(m,"lenv","status",pourcent); |
---|
34 | setMapInMaps(m,"lenv","message",message); |
---|
35 | _updateStatus(m); |
---|
36 | freeMaps(&m); |
---|
37 | free(m); |
---|
38 | return (jint)0; |
---|
39 | } |
---|