[771] | 1 | #include "org_zoo_project_ZOO.h" |
---|
[525] | 2 | #include "service.h" |
---|
| 3 | #include "service_internal.h" |
---|
| 4 | #include "service_internal_java.h" |
---|
| 5 | |
---|
[771] | 6 | JNIEXPORT jstring JNICALL Java_org_zoo_1project_ZOO_translate |
---|
[766] | 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); |
---|
[525] | 14 | return (*env)->NewStringUTF(env, _(message)); |
---|
[766] | 15 | #endif |
---|
[525] | 16 | |
---|
| 17 | } |
---|
| 18 | |
---|
[771] | 19 | JNIEXPORT jobject JNICALL Java_org_zoo_1project_ZOO_updateStatus |
---|
[766] | 20 | (JNIEnv *env, jclass _class, jobject conf, jstring pourc, jstring msg){ |
---|
[525] | 21 | |
---|
| 22 | jclass scHashMapClass,scHashMap_class; |
---|
| 23 | #ifdef JAVA7 |
---|
| 24 | scHashMapClass = (*env).FindClass("java/util/HashMap"); |
---|
[766] | 25 | const char *pourcent = (*env).GetStringUTFChars(pourc,0); |
---|
| 26 | const char *message = (*env).GetStringUTFChars(msg,0); |
---|
[525] | 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); |
---|
[766] | 31 | #endif |
---|
[525] | 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 | } |
---|