Question about native method
"qi fenghai" <[email protected]> Thu, 03 Nov 2005 22:36:14 +0800
| Newsgroups | gmane.comp.java.vm.sablevm.general |
|---|---|
| Message-ID | <[email protected]> |
Hi all, Please advise if native method can be implemented by this way
as bellow:
method 1:
in JVM:
typedef int (*FUNCTYPE)(); //function's return type is int
FUNCTYPE *nativefunc = (FUNCTYPE)dlsym(handle, "foo");
//four argument
(*nativefunc)(1, 2.5);
in share library:
int foo(int, double);
method 2:
in JVM:
typedef int (*FUNCTYPE)(...); //function's return type is int,
argument list is '...'
FUNCTYPE *nativefunc = (FUNCTYPE)dlsym(handle, "foo");
//four argument
(*nativefunc)(1, 2.5);
in share library:
int foo(int, double);
_________________________________________________________________
涓虹杩琛浜ゆ锛璇蜂娇 MSN Messenger: http://messenger.msn.com/cn