Integration with C

Andrew Haley aph@redhat.com
Thu Apr 17 18:21:00 GMT 2003


Geert Bevin writes:
 > Andrew Haley wrote:
 > > No, you'll have to write a C interface in C++.  It's still 10-100
 > > times faster than JNI.
 > 
 > Ok. Thanks a lot for this information. Another related question, can I 
 > work with function pointers to execute registered C callback hooks or is 
 > this not possible in the CNI architecture? Otherwise, I'll have to poll 
 > at regular intervals from within the gui, which is a pretty ugly 
 > solution ;-)

Yes, function pointers are fine for calling CNI hooks.  That was one
of the design goals.  However, if you want to call a Java method
you'll have to get the address of the object somehow.

Andrew.



More information about the Java mailing list