/[cvs]/jsr166/src/test/JniDemo.cpp
ViewVC logotype

Contents of /jsr166/src/test/JniDemo.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Sat Dec 13 20:45:42 2003 UTC (15 years, 11 months ago) by tim
Branch: MAIN
CVS Tags: JSR166_PFD
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.

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

dl@cs.oswego.edu
ViewVC Help
Powered by ViewVC 1.1.27