Revision: | 1.1 |
Committed: | Sat Dec 13 20:45:42 2003 UTC (20 years, 5 months ago) by tim |
Branch: | MAIN |
CVS Tags: | JSR166_PFD |
Log Message: | Add C++/JNI demo targets as first step to possible use of JNI in 1.4-usable version of j.u.c. Still probably highly Windows-specific, but at least it uses gcc, so there is hope. |
# | Content |
---|---|
1 | /* |
2 | * Native method implementations for JniDemo |
3 | */ |
4 | |
5 | #include <JniDemo.h> |
6 | |
7 | class JniDemo { |
8 | public: |
9 | static int count; |
10 | }; |
11 | |
12 | int JniDemo::count = 0; |
13 | |
14 | |
15 | /* |
16 | * Class: JniDemo |
17 | * Method: getCount |
18 | * Signature: ()I |
19 | */ |
20 | JNIEXPORT jint JNICALL Java_JniDemo_getCount |
21 | (JNIEnv *, jobject) |
22 | { |
23 | return JniDemo::count; |
24 | } |
25 | |
26 | /* |
27 | * Class: JniDemo |
28 | * Method: setCount |
29 | * Signature: (I)V |
30 | */ |
31 | JNIEXPORT void JNICALL Java_JniDemo_setCount |
32 | (JNIEnv *, jobject, jint count) |
33 | { |
34 | JniDemo::count = count; |
35 | } |
36 |