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