diff options
author | Brian Jones <cbj@gnu.org> | 2003-01-25 19:09:36 +0000 |
---|---|---|
committer | Brian Jones <cbj@gnu.org> | 2003-01-25 19:09:36 +0000 |
commit | 91e929c29a906e330df9c5585f085bf27b92a870 (patch) | |
tree | 0abbbe920999e96c6b5cb3a32ff583883d59c94b | |
parent | c5e9578906745e9113fdfd0faf000f0f5b1d16dd (diff) | |
download | classpath-91e929c29a906e330df9c5585f085bf27b92a870.tar.gz |
2003-01-25 C. Brian Jones <cbj@gnu.org>
* NEWS: note jni.h updates and patches
* include/jni.h.in (AttachCurrentThreadAsDaemon): new function
2003-01-25 Stephen Crawley <crawley@dstc.edu.au>
* include/jni.h.in (JNI_VERSION_1_4): new define
(NewDirectByteBuffer): new function
(GetDirectBufferAddress): new function
(GetDirectBufferCapacity): new function
(_JNI_VM_INTERNAL_TYPES_DEFINED): if defined, do not use default
declarations for jobject, jfieldID, and jmethodID
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | include/jni.h.in | 55 |
3 files changed, 64 insertions, 9 deletions
@@ -1,3 +1,17 @@ +2003-01-25 C. Brian Jones <cbj@gnu.org> + + * NEWS: note jni.h updates and patches + * include/jni.h.in (AttachCurrentThreadAsDaemon): new function + +2003-01-25 Stephen Crawley <crawley@dstc.edu.au> + + * include/jni.h.in (JNI_VERSION_1_4): new define + (NewDirectByteBuffer): new function + (GetDirectBufferAddress): new function + (GetDirectBufferCapacity): new function + (_JNI_VM_INTERNAL_TYPES_DEFINED): if defined, do not use default + declarations for jobject, jfieldID, and jmethodID + 2003-01-24 Mark Wielaard <mark@klomp.org> * java/io/ObjectOutputStream.java (writeObject): Rethrow fatal @@ -1,4 +1,8 @@ New in release 0.05 [ no date yet ] +* Include file jni.h has been updated to the 1.4 specification. +* VM specific internal types for jobject, jfieldID, and jmethodID are + supported in jni.h. More details can be found by reading the comment + in include/jni.h.in. By default the old definitions are used instead. * New VM helper class java.io.VMObjectStreamClass which should provide the hasClassInitializer() method. Previously ObjectStreamClass used Class.getDeclaredMethod("<clinit>") but according to the spec this diff --git a/include/jni.h.in b/include/jni.h.in index b82f21606..cb40d36be 100644 --- a/include/jni.h.in +++ b/include/jni.h.in @@ -91,6 +91,25 @@ typedef struct _Jv_JNIEnv JNIEnv; typedef struct _Jv_JavaVM JavaVM; #else /* __cplusplus */ + +/* + * Before jni.h is #included within a typical JVM, the source code should + * #define _JNI_VM_INTERNAL_TYPES_DEFINED and provide the real declarations + * for 'jobject', 'jfieldID', 'jMethodID' and other implementation types. + * If _JNI_VM_INTERNAL_TYPES_DEFINED is not defined, the following + * declares the old versions of the types. + */ +#ifndef _JNI_VM_INTERNAL_TYPES_DEFINED +/* +typedef void *jobject; +typedef void *jfieldID; +typedef void *jmethodID; +*/ +struct _jfieldID; +struct _jmethodID; +typedef struct _jfieldID *jfieldID; +typedef struct _jmethodID *jmethodID; +#endif typedef void *jobject; typedef jobject jclass; @@ -138,11 +157,6 @@ typedef union jvalue jdouble d; jobject l; } jvalue; - -struct _jfieldID; /* FIXME: VM specific */ -struct _jmethodID; /* FIXME: VM specific */ -typedef struct _jfieldID *jfieldID; -typedef struct _jmethodID *jmethodID; /* Used for jboolean type */ #define JNI_TRUE 1 @@ -158,6 +172,7 @@ typedef jobject jweak; /* Version numbers. */ #define JNI_VERSION_1_1 0x00010001 /* JNI version 1.1 */ #define JNI_VERSION_1_2 0x00010002 /* JNI version 1.2 */ +#define JNI_VERSION_1_4 0x00010004 /* JNI version 1.4 */ /* Error codes */ #define JNI_OK 0 @@ -435,6 +450,7 @@ struct JNINativeInterface jint (JNICALL *MonitorExit) (JNIEnv *, jobject); /* 218 */ jint (JNICALL *GetJavaVM) (JNIEnv *, JavaVM **); /* 219 */ + /* ---- JNI 1.2 functions ---- */ void (JNICALL *GetStringRegion) (JNIEnv *, jstring, jsize, jsize, jchar *); /* 220 */ void (JNICALL *GetStringUTFRegion) (JNIEnv *, jstring, jsize, jsize, char *); /* 221 */ @@ -448,6 +464,12 @@ struct JNINativeInterface void (JNICALL *DeleteWeakGlobalRef) (JNIEnv *, jweak); /* 227 */ jboolean (JNICALL *ExceptionCheck) (JNIEnv *); /* 228 */ + + /* ---- JNI 1.4 functions ---- */ + jobject (JNICALL *NewDirectByteBuffer) (JNIEnv *, void *, jlong); /* 229 */ + void * (JNICALL *GetDirectBufferAddress) (JNIEnv *, jobject); /* 230 */ + long (JNICALL *GetDirectBufferCapacity) (JNIEnv *, jobject); /* 231 */ + }; #ifdef __cplusplus @@ -1314,6 +1336,16 @@ struct _Jv_JNIEnv jboolean ExceptionCheck () { return p->ExceptionCheck (this); } + + jobject NewDirectByteBuffer (void * val1, jlong val2) + { return p->NewDirectByteBuffer (this, val1, val2); } + + void * GetDirectBufferAddress (jobject val1) + { return p->GetDirectBufferAddress (this, val1); } + + long GetDirectBufferCapacity (jobject val1) + { return p->GetDirectBufferCapacity (this, val1); } + }; #endif /* __cplusplus */ @@ -1327,10 +1359,12 @@ struct JNIInvokeInterface _Jv_func reserved1; _Jv_func reserved2; - jint (JNICALL *DestroyJavaVM) (JavaVM *); - jint (JNICALL *AttachCurrentThread) (JavaVM *, void **, void *); - jint (JNICALL *DetachCurrentThread) (JavaVM *); - jint (JNICALL *GetEnv) (JavaVM *, void **, jint); + jint (JNICALL *DestroyJavaVM) (JavaVM *); + jint (JNICALL *AttachCurrentThread) (JavaVM *, void **, void *); + jint (JNICALL *DetachCurrentThread) (JavaVM *); + jint (JNICALL *GetEnv) (JavaVM *, void **, jint); + jint (JNICALL *AttachCurrentThreadAsDaemon) (JavaVM *, void **, void *); + }; #ifdef __cplusplus @@ -1350,6 +1384,9 @@ struct _Jv_JavaVM jint GetEnv (void **penv, jint version) { return functions->GetEnv (this, penv, version); } + + jint AttachCurrentThreadAsDaemon (void **penv, void *args) + { return functions->AttachCurrentThreadAsDaemon (this, penv, args); } }; #endif /* __cplusplus */ |