I want to pass a treemap from java to c with jni. I call the native method:
public native int getEuklid(TreeMap<int,short[]> map);
static {
System.loadLibrary("Euklid");
}
Now in my c file i want to access the elements in the map. How i can do that. This is the header from my c file:
JNIEXPORT int JNICALL
Java_Main_getEuklid (JNIEnv *env, jobject o, jobject o2)
Where o2 is the treemap. How can i handle with that jobject like the treemap in java?
Edit:
Where is my fault?:
JNIEXPORT int JNICALL
Java_Main_getEuklid (JNIEnv *env, jobject o, jobject o2){
jclass cls = env->GetObjectClass(o2) ;
jmethodID mGetValue = env->GetMethodID(cls, "keySet","()Ljava/util/Set;");
jobject value = env->CallObjectMethod(o2, mGetValue)
I became:
In function ‘Java_Main_getEuklid’:
11: error: request for member ‘GetObjectClass’ in something not a structure or union
12: error: request for member ‘GetMethodID’ in something not a structure or union
13: error: request for member ‘CallObjectMethod’ in something not a structure or union
I am really new in c and i want to test something so i hope you could help me.