Bob Marinier
2004-12-22 18:18:30 UTC
I'm trying to get callbacks working through Java. Ultimately I'd like
to do this properly with typemaps, but due to time constraints I've
opted to write the code myself. I have a .h file which contains all of
the necessary C and JNI code. I can include this .h via my .i file.
However, I also have some custom Java code which needs to be appended to
various java files that SWIG generates. Is there any way of doing this
via SWIG, or must I do it by hand?
I'm also exploring the possibility of only providing the custom JNI
functions and letting SWIG generate the necessary Java code (i.e. via
%native). However, I'm not sure this is possible without writing some
typemaps. One of my JNI functions looks like this:
JNIEXPORT jint JNICALL
Java_sml_smlJNI_Agent_1RegisterForRunEventByHand(JNIEnv *jenv, jclass
jcls, jlong jarg1, jint jarg2, jobject jarg3, jobject jarg4, jstring
jarg5, jobject jarg6)
To use %native I need to provide the equivalent C types, but I don't
know how to do that for jobjects. Any ideas?
Thanks!
Bob Marinier
AI Laboratory
University of Michigan
_______________________________________________
Swig maillist - ***@cs.uchicago.edu
http://mailman.cs.uchicago.edu/mailman/listinfo/swig
to do this properly with typemaps, but due to time constraints I've
opted to write the code myself. I have a .h file which contains all of
the necessary C and JNI code. I can include this .h via my .i file.
However, I also have some custom Java code which needs to be appended to
various java files that SWIG generates. Is there any way of doing this
via SWIG, or must I do it by hand?
I'm also exploring the possibility of only providing the custom JNI
functions and letting SWIG generate the necessary Java code (i.e. via
%native). However, I'm not sure this is possible without writing some
typemaps. One of my JNI functions looks like this:
JNIEXPORT jint JNICALL
Java_sml_smlJNI_Agent_1RegisterForRunEventByHand(JNIEnv *jenv, jclass
jcls, jlong jarg1, jint jarg2, jobject jarg3, jobject jarg4, jstring
jarg5, jobject jarg6)
To use %native I need to provide the equivalent C types, but I don't
know how to do that for jobjects. Any ideas?
Thanks!
Bob Marinier
AI Laboratory
University of Michigan
_______________________________________________
Swig maillist - ***@cs.uchicago.edu
http://mailman.cs.uchicago.edu/mailman/listinfo/swig