This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Integration with C


Hi Andrew,

I've read over the gcj documentation in try to find a logical way to register a collection of function pointers. The only structure that I can find is the gnu.gcj.RawData class which can contain anything but need to be cast to the correct type explicitely. Is this a way to do what I need, or am I overlooking something? It would be great to see some examples of this, do you know if there are some available?

Thanks for the help,

Geert

Andrew Haley wrote:
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.



--
Geert Bevin                       Uwyn
"Use what you need"               Lambermontlaan 148
http://www.uwyn.com               1030 Brussels
gbevin[remove] at uwyn dot com    Tel & Fax +32 2 245 41 06

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]