CNI for C

Tom Tromey tromey@redhat.com
Wed Apr 7 20:04:00 GMT 2004


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

Andrew> Well, the nice thing about pinvoke as far as I can see is that you
Andrew> don't have to write anything: you can just call native DLLs directly.
Andrew> It's harder to do this in the general case of ISO C, because there
Andrew> aren't necessarily Java equivalents of the C types used to access
Andrew> DLLs.  However, in many cases, and this possibly includes all the
Andrew> platforms we care about, there are.

Yeah.  IMO if we do this the best thing to do is just look at PInvoke
and do something basically the same.

Andrew> So, we could do something like pinvoke in gcj.  We'd need to figure
Andrew> out how to parse the C types and make them available to Java.  We
Andrew> could get the C compiler to help with this.

I also wonder why people don't just use SWIG.

Tom



More information about the Java mailing list