aboutsummaryrefslogtreecommitdiff
path: root/libjava/jni/classpath
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/jni/classpath')
-rw-r--r--libjava/jni/classpath/classpath_jawt.h1
-rw-r--r--libjava/jni/classpath/jcl.c144
-rw-r--r--libjava/jni/classpath/jcl.h64
-rw-r--r--libjava/jni/classpath/jnilink.c117
-rw-r--r--libjava/jni/classpath/jnilink.h86
-rw-r--r--libjava/jni/classpath/primlib.c463
-rw-r--r--libjava/jni/classpath/primlib.h102
7 files changed, 1 insertions, 976 deletions
diff --git a/libjava/jni/classpath/classpath_jawt.h b/libjava/jni/classpath/classpath_jawt.h
index 51e6af3ea1d..1629505ac5c 100644
--- a/libjava/jni/classpath/classpath_jawt.h
+++ b/libjava/jni/classpath/classpath_jawt.h
@@ -53,6 +53,7 @@
jint classpath_jawt_get_awt_version ();
Display* classpath_jawt_get_default_display (JNIEnv* env, jobject canvas);
Drawable classpath_jawt_get_drawable (JNIEnv* env, jobject canvas);
+VisualID classpath_jawt_get_visualID (JNIEnv* env, jobject canvas);
jint classpath_jawt_lock ();
void classpath_jawt_unlock ();
diff --git a/libjava/jni/classpath/jcl.c b/libjava/jni/classpath/jcl.c
deleted file mode 100644
index 855c5938563..00000000000
--- a/libjava/jni/classpath/jcl.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/* jcl.c
- Copyright (C) 1998, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include <stdio.h>
-#include <jcl.h>
-#include <stdlib.h>
-
-#ifndef __GNUC__
-#define __attribute__(x) /* nothing */
-#endif
-
-/*
- * This way the memory is pre-allocated, so that we do not have to worry
- * if we are out of memory.
- */
-static char errstr[4098];
-
-JNIEXPORT void JNICALL JCL_ThrowException(JNIEnv * env, char * className, char * errMsg) {
- jclass excClass;
- if((*env)->ExceptionOccurred(env)) {
- (*env)->ExceptionClear(env);
- }
- excClass = (*env)->FindClass(env, className);
- if(excClass == NULL) {
- jclass errExcClass;
- errExcClass = (*env)->FindClass(env, "java/lang/ClassNotFoundException");
- if(errExcClass == NULL) {
- errExcClass = (*env)->FindClass(env, "java/lang/InternalError");
- if(errExcClass == NULL) {
- sprintf(errstr,"JCL: Utterly failed to throw exeption %s with message %s.",className,errMsg);
- fprintf(stderr, errstr);
- return;
- }
- }
- sprintf(errstr,"JCL: Failed to throw exception %s with message %s: could not find exception class.", className, errMsg);
- (*env)->ThrowNew(env, errExcClass, errstr);
- }
- (*env)->ThrowNew(env, excClass, errMsg);
-}
-
-JNIEXPORT void * JNICALL JCL_malloc(JNIEnv * env, size_t size) {
- void * mem = malloc(size);
- if(mem == NULL) {
- JCL_ThrowException(env, "java/lang/OutOfMemoryError", "malloc() failed.");
- return NULL;
- }
- return mem;
-}
-
-JNIEXPORT void * JNICALL JCL_realloc(JNIEnv *env, void *ptr, size_t size)
-{
- ptr = realloc(ptr, size);
- if (ptr == 0)
- {
- JCL_ThrowException(env, "java/lang/OutOfMemoryError",
- "malloc() failed.");
- return NULL;
- }
- return(ptr);
-}
-
-JNIEXPORT void JNICALL JCL_free(JNIEnv * env __attribute__((unused)),
- void * p)
-{
- if(p != NULL) {
- free(p);
- }
-}
-
-JNIEXPORT char * JNICALL JCL_jstring_to_cstring(JNIEnv * env, jstring s) {
- char* cstr;
- if(s == NULL) {
- JCL_ThrowException(env, "java/lang/NullPointerException","Null string");
- return NULL;
- }
- cstr = (char*)(*env)->GetStringUTFChars(env, s, NULL);
- if(cstr == NULL) {
- JCL_ThrowException(env, "java/lang/InternalError", "GetStringUTFChars() failed.");
- return NULL;
- }
- return cstr;
-}
-
-JNIEXPORT void JNICALL JCL_free_cstring(JNIEnv * env, jstring s, char * cstr) {
- (*env)->ReleaseStringUTFChars(env, s, cstr);
-}
-
-JNIEXPORT jint JNICALL JCL_MonitorEnter(JNIEnv * env, jobject o) {
- jint retval = (*env)->MonitorEnter(env,o);
- if(retval != 0) {
- JCL_ThrowException(env, "java/lang/InternalError", "MonitorEnter() failed.");
- }
- return retval;
-}
-
-JNIEXPORT jint JNICALL JCL_MonitorExit(JNIEnv * env, jobject o) {
- jint retval = (*env)->MonitorExit(env,o);
- if(retval != 0) {
- JCL_ThrowException(env, "java/lang/InternalError", "MonitorExit() failed.");
- }
- return retval;
-}
-
-JNIEXPORT jclass JNICALL JCL_FindClass(JNIEnv * env, char * className) {
- jclass retval = (*env)->FindClass(env,className);
- if(retval == NULL) {
- JCL_ThrowException(env, "java/lang/ClassNotFoundException", className);
- }
- return retval;
-}
diff --git a/libjava/jni/classpath/jcl.h b/libjava/jni/classpath/jcl.h
deleted file mode 100644
index a7d00b47cd3..00000000000
--- a/libjava/jni/classpath/jcl.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* jcl.h
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-#ifndef __JCL_H__
-#define __JCL_H__
-
-#include <stddef.h>
-#include <jni.h>
-#include <config.h>
-
-JNIEXPORT jclass JNICALL JCL_FindClass(JNIEnv * env, char * className);
-JNIEXPORT void JNICALL JCL_ThrowException(JNIEnv * env, char * className, char * errMsg);
-JNIEXPORT void * JNICALL JCL_malloc(JNIEnv *env, size_t size);
-JNIEXPORT void * JNICALL JCL_realloc(JNIEnv *env, void *ptr, size_t size);
-JNIEXPORT void JNICALL JCL_free(JNIEnv *env, void * p);
-JNIEXPORT char * JNICALL JCL_jstring_to_cstring(JNIEnv *env, jstring s);
-JNIEXPORT void JNICALL JCL_free_cstring(JNIEnv *env, jstring s, char * cstr);
-JNIEXPORT jint JNICALL JCL_MonitorEnter(JNIEnv *env, jobject o);
-JNIEXPORT jint JNICALL JCL_MonitorExit(JNIEnv *env, jobject o);
-
-#define JCL_RETHROW_EXCEPTION(env) if((*(env))->ExceptionOccurred((env)) != NULL) return NULL;
-
-/* Simple debug macro */
-#ifdef DEBUG
-#define DBG(x) fprintf(stderr, (x));
-#else
-#define DBG(x)
-#endif
-
-#endif
diff --git a/libjava/jni/classpath/jnilink.c b/libjava/jni/classpath/jnilink.c
deleted file mode 100644
index d92654161c8..00000000000
--- a/libjava/jni/classpath/jnilink.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* JNILINK 1.1: JNI version.
- Copyright (C) 1998, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-#include "jnilink.h"
-#include <string.h>
-#include <jcl.h>
-
-#include <stdlib.h>
-
-#define GETCLASS(c) *(jclass*)(c)
-
-JNIEXPORT jclass JNICALL
-LINK_RelinkClass (JNIEnv * env, linkedClass * c, char * name) {
- jclass found;
- LINK_UnlinkClass(env,*c);
-
- found = (*env)->FindClass(env,name);
- if(found == NULL)
- return NULL;
-
- *c = JCL_malloc(env,sizeof(jclass));
- if(*c == NULL)
- return NULL;
-
- GETCLASS(*c) = (*env)->NewGlobalRef(env,found);
- return GETCLASS(*c);
-}
-
-JNIEXPORT jclass JNICALL
-LINK_RelinkKnownClass(JNIEnv * env, linkedClass * c, jclass newClass) {
- LINK_UnlinkClass(env,*c);
-
- *c = JCL_malloc(env,sizeof(jclass));
- if(*c == NULL)
- return NULL;
-
- GETCLASS(*c) = (*env)->NewGlobalRef(env,newClass);
- return newClass;
-}
-
-JNIEXPORT jmethodID JNICALL
-LINK_RelinkMethod (JNIEnv * env, jmethodID * m, linkedClass c,
- char * name, char * sig) {
- *m = (*env)->GetMethodID(env,GETCLASS(c),name,sig);
- return *m;
-}
-
-JNIEXPORT jmethodID JNICALL
-LINK_RelinkStaticMethod(JNIEnv * env, jmethodID * m, linkedClass c,
- char * name, char * sig) {
- *m = (*env)->GetStaticMethodID(env,GETCLASS(c),name,sig);
- return *m;
-}
-
-JNIEXPORT jfieldID JNICALL
-LINK_RelinkField (JNIEnv * env, jfieldID * f, linkedClass c,
- char * name, char * sig) {
- *f = (*env)->GetFieldID(env,GETCLASS(c),name,sig);
- return *f;
-}
-
-JNIEXPORT jfieldID JNICALL
-LINK_RelinkStaticField (JNIEnv * env, jfieldID * f, linkedClass c,
- char * name, char * sig) {
- *f = (*env)->GetStaticFieldID(env,GETCLASS(c),name,sig);
- return *f;
-}
-
-
-/* These are for when the class referencing the symbols is unloaded; it
-destroys any object references
- * the linker might have kept around.
- */
-JNIEXPORT void JNICALL LINK_UnlinkClass (JNIEnv * env, linkedClass * c) {
- if(*c != NULL) {
- if(GETCLASS(*c) != NULL)
- (*env)->DeleteGlobalRef(env,GETCLASS(*c));
- JCL_free(env,*c);
- *c = NULL;
- }
-}
-
diff --git a/libjava/jni/classpath/jnilink.h b/libjava/jni/classpath/jnilink.h
deleted file mode 100644
index 448e2b5dfdd..00000000000
--- a/libjava/jni/classpath/jnilink.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* JNILINK 1.1: JNI version.
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-#ifndef __JNILINK_H__
-#define __JNILINK_H__
-
-#include <jni.h>
-
-typedef void* linkedClass;
-
-#define LINK_LinkClass(env,c,name) ((c)==NULL ? LINK_ReallyLinkClass((env),&(c),(name)) : (c))
-#define LINK_LinkKnownClass(env,c,newClass) ((c)==NULL ? LINK_ReallyLinkKnownClass((env),&(c),(newClass)) : (c))
-#define LINK_LinkMethod(env,m,c,name,sig) ((m)==NULL ? LINK_RelinkMethod((env),&(m),(c),(name),(sig)) : (m))
-#define LINK_LinkStaticMethod(env,m,c,name,sig) ((m)==NULL ? LINK_RelinkStaticMethod((env),&(m),(c),(name),(sig)) : (m))
-#define LINK_LinkField(env,f,c,name,sig) ((m)==NULL ? LINK_RelinkField((env),&(f),(c),(name),(sig)) : (f))
-#define LINK_LinkStaticField(env,f,c,name,sig) ((m)==NULL ? LINK_RelinkStaticField((env),&(f),(c),(name),(sig)) : (f))
-
-#define LINK_LinkConstructor(env,m,c,sig) ((m)==NULL ? LINK_RelinkMethod((env),&(m),(c),"<init>",(sig)) : (m))
-
-JNIEXPORT jclass JNICALL
-LINK_ReallyLinkClass (JNIEnv * env, linkedClass * c,
- char * name);
-JNIEXPORT jclass JNICALL
-LINK_ReallyLinkKnownClass(JNIEnv * env, linkedClass * c,
- jclass newClass);
-JNIEXPORT jclass JNICALL
-LINK_RelinkClass (JNIEnv * env, linkedClass * c,
- char * name);
-JNIEXPORT jclass JNICALL
-LINK_RelinkKnownClass (JNIEnv * env, linkedClass * c,
- jclass newClass);
-JNIEXPORT jmethodID JNICALL
-LINK_RelinkMethod (JNIEnv * env, jmethodID * m, linkedClass c,
- char * name, char * sig);
-JNIEXPORT jmethodID JNICALL
-LINK_RelinkStaticMethod(JNIEnv * env, jmethodID * m, linkedClass c,
- char * name, char * sig);
-JNIEXPORT jfieldID JNICALL
-LINK_RelinkField (JNIEnv * env, jfieldID * f, linkedClass c,
- char * name, char * sig);
-JNIEXPORT jfieldID JNICALL
-LINK_RelinkStaticField (JNIEnv * env, jfieldID * f, linkedClass c,
- char * name, char * sig);
-
-/* These are for when the class referencing the symbols is unloaded; it
-destroys any object references
- * the linker might have kept around.
- */
-JNIEXPORT void JNICALL LINK_UnlinkClass (JNIEnv * env, linkedClass * c);
-
-#endif
diff --git a/libjava/jni/classpath/primlib.c b/libjava/jni/classpath/primlib.c
deleted file mode 100644
index c7396e2a9a7..00000000000
--- a/libjava/jni/classpath/primlib.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/* primlib.c
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include <jnilink.h>
-#include <primlib.h>
-#include <jcl.h>
-
-static jclass nativeWrapClass[PRIMLIB_NUMTYPES] = {NULL,NULL,NULL, NULL,NULL,NULL,
- NULL,NULL,NULL, NULL,NULL,NULL};
-
-static jclass nativeTypeClass[PRIMLIB_NUMTYPES] = {NULL,NULL,NULL, NULL,NULL,NULL,
- NULL,NULL,NULL, NULL,NULL,NULL};
-
-static jmethodID nativeWrapClassConstructor[PRIMLIB_NUMTYPES] = {NULL,NULL,NULL, NULL,NULL,NULL,
- NULL,NULL,NULL, NULL,NULL,NULL};
-
-static jmethodID nativeWrapClassAccessor[PRIMLIB_NUMTYPES] = {NULL,NULL,NULL, NULL,NULL,NULL,
- NULL,NULL,NULL, NULL,NULL,NULL};
-
-static char * nativeWrapClassName[PRIMLIB_NUMTYPES] = {
- NULL,
- NULL,
- "java/lang/Boolean",
- "java/lang/Byte",
- "java/lang/Character",
- "java/lang/Short",
- "java/lang/Integer",
- "java/lang/Long",
- "java/lang/Float",
- "java/lang/Double",
- "java/lang/Void",
- NULL
- };
-
-static char * nativeWrapClassConstructorSig[PRIMLIB_NUMTYPES] = {
- NULL,
- NULL,
- "(Z)V",
- "(B)V",
- "(C)V",
- "(S)V",
- "(I)V",
- "(J)V",
- "(F)V",
- "(D)V",
- "()V",
- NULL
- };
-
-static char * nativeWrapClassAccessorName[PRIMLIB_NUMTYPES] = {
- NULL,
- NULL,
- "booleanValue",
- "byteValue",
- "charValue",
- "shortValue",
- "intValue",
- "longValue",
- "floatValue",
- "doubleValue",
- NULL,
- NULL
-};
-
-static char * nativeWrapClassAccessorSig[PRIMLIB_NUMTYPES] = {
- NULL,
- NULL,
- "()Z",
- "()B",
- "()C",
- "()S",
- "()I",
- "()J",
- "()F",
- "()D",
- NULL,
- NULL
-};
-
-
-JNIEXPORT jclass JNICALL PRIMLIB_GetNativeWrapClass(JNIEnv * env, int reflectType) {
- return LINK_LinkClass(env,nativeWrapClass[reflectType],nativeWrapClassName[reflectType]);
-}
-
-static jclass ActuallyGetNativeTypeClass(JNIEnv * env, int reflectType) {
- jclass wrapClass;
- jfieldID typeField;
-
- wrapClass = PRIMLIB_GetNativeWrapClass(env, reflectType);
- if(wrapClass == NULL)
- return NULL;
- typeField = (*env)->GetStaticFieldID(env, wrapClass, "TYPE", "Ljava/lang/Class");
- if(typeField == NULL)
- return NULL;
- return (*env)->GetStaticObjectField(env, wrapClass, typeField);
-}
-
-JNIEXPORT jclass JNICALL PRIMLIB_GetNativeTypeClass(JNIEnv * env, int reflectType) {
- return LINK_LinkKnownClass(env, nativeTypeClass[reflectType], ActuallyGetNativeTypeClass(env,reflectType));
-}
-
-JNIEXPORT jmethodID JNICALL PRIMLIB_GetNativeWrapClassConstructor(JNIEnv * env, int reflectType) {
- PRIMLIB_GetNativeWrapClass(env,reflectType);
- return LINK_LinkConstructor(env, nativeWrapClassConstructor[reflectType], nativeWrapClass[reflectType], nativeWrapClassConstructorSig[reflectType]);
-}
-
-JNIEXPORT jmethodID JNICALL PRIMLIB_GetNativeWrapClassAccessor(JNIEnv * env, int reflectType) {
- PRIMLIB_GetNativeWrapClass(env,reflectType);
- return LINK_LinkMethod(env, nativeWrapClassAccessor[reflectType], nativeWrapClass[reflectType], nativeWrapClassAccessorName[reflectType], nativeWrapClassAccessorSig[reflectType]);
-}
-
-
-
-JNIEXPORT jobject JNICALL PRIMLIB_WrapBoolean(JNIEnv * env, jboolean b) {
- jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_BOOLEAN);
- JCL_RETHROW_EXCEPTION(env);
- return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BOOLEAN), construct, b);
-}
-
-JNIEXPORT jobject JNICALL PRIMLIB_WrapByte (JNIEnv * env, jbyte b) {
- jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_BYTE);
- JCL_RETHROW_EXCEPTION(env);
- return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE), construct, b);
-}
-
-JNIEXPORT jobject JNICALL PRIMLIB_WrapChar (JNIEnv * env, jchar c) {
- jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_CHAR);
- JCL_RETHROW_EXCEPTION(env);
- return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR), construct, c);
-}
-
-JNIEXPORT jobject JNICALL PRIMLIB_WrapShort (JNIEnv * env, jshort s) {
- jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_SHORT);
- JCL_RETHROW_EXCEPTION(env);
- return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT), construct, s);
-}
-
-JNIEXPORT jobject JNICALL PRIMLIB_WrapInt (JNIEnv * env, jint i) {
- jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_INT);
- JCL_RETHROW_EXCEPTION(env);
- return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT), construct, i);
-}
-
-JNIEXPORT jobject JNICALL PRIMLIB_WrapLong (JNIEnv * env, jlong l) {
- jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_LONG);
- JCL_RETHROW_EXCEPTION(env);
- return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG), construct, l);
-}
-
-JNIEXPORT jobject JNICALL PRIMLIB_WrapFloat (JNIEnv * env, jfloat f) {
- jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_FLOAT);
- JCL_RETHROW_EXCEPTION(env);
- return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_FLOAT), construct, f);
-}
-
-JNIEXPORT jobject JNICALL PRIMLIB_WrapDouble (JNIEnv * env, jdouble d) {
- jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_DOUBLE);
- JCL_RETHROW_EXCEPTION(env);
- return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_DOUBLE), construct, d);
-}
-
-
-JNIEXPORT jboolean JNICALL PRIMLIB_UnwrapBoolean(JNIEnv * env, jobject obj) {
- if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BOOLEAN))) {
- return PRIMLIB_GetBooleanObjectValue(env, obj);
- } else {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type.");
- return JNI_FALSE;
- }
-}
-
-JNIEXPORT jbyte JNICALL PRIMLIB_UnwrapByte(JNIEnv * env, jobject obj) {
- if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) {
- return PRIMLIB_GetByteObjectValue(env, obj);
- } else {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type.");
- return 0;
- }
-}
-
-JNIEXPORT jshort JNICALL PRIMLIB_UnwrapShort(JNIEnv * env, jobject obj) {
- if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) {
- return PRIMLIB_GetShortObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) {
- return (jshort)PRIMLIB_GetByteObjectValue(env, obj);
- } else {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type.");
- return 0;
- }
-}
-
-JNIEXPORT jchar JNICALL PRIMLIB_UnwrapChar(JNIEnv * env, jobject obj) {
- if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) {
- return PRIMLIB_GetCharObjectValue(env, obj);
- } else {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type.");
- return 0;
- }
-}
-
-JNIEXPORT jint JNICALL PRIMLIB_UnwrapInt(JNIEnv * env, jobject obj) {
- if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT))) {
- return PRIMLIB_GetIntObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) {
- return (jint)PRIMLIB_GetShortObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) {
- return (jint)PRIMLIB_GetCharObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) {
- return (jint)PRIMLIB_GetByteObjectValue(env, obj);
- } else {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type.");
- return 0;
- }
-}
-
-JNIEXPORT jlong JNICALL PRIMLIB_UnwrapLong(JNIEnv * env, jobject obj) {
- if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG))) {
- return PRIMLIB_GetLongObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT))) {
- return (jlong)PRIMLIB_GetIntObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) {
- return (jlong)PRIMLIB_GetShortObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) {
- return (jlong)PRIMLIB_GetCharObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) {
- return (jlong)PRIMLIB_GetByteObjectValue(env, obj);
- } else {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type.");
- return 0;
- }
-}
-
-JNIEXPORT jfloat JNICALL PRIMLIB_UnwrapFloat(JNIEnv * env, jobject obj) {
- if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_FLOAT))) {
- return PRIMLIB_GetFloatObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG))) {
- return (jfloat)PRIMLIB_GetLongObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT))) {
- return (jfloat)PRIMLIB_GetIntObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) {
- return (jfloat)PRIMLIB_GetShortObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) {
- return (jfloat)PRIMLIB_GetCharObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) {
- return (jfloat)PRIMLIB_GetByteObjectValue(env, obj);
- } else {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type.");
- return 0;
- }
-}
-
-JNIEXPORT jdouble JNICALL PRIMLIB_UnwrapDouble(JNIEnv * env, jobject obj) {
- if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_DOUBLE))) {
- return PRIMLIB_GetDoubleObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_FLOAT))) {
- return (jdouble)PRIMLIB_GetFloatObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG))) {
- return (jdouble)PRIMLIB_GetLongObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT))) {
- return (jdouble)PRIMLIB_GetIntObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) {
- return (jdouble)PRIMLIB_GetShortObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) {
- return (jdouble)PRIMLIB_GetCharObjectValue(env, obj);
- } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) {
- return (jdouble)PRIMLIB_GetByteObjectValue(env, obj);
- } else {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type.");
- return 0;
- }
-}
-
-JNIEXPORT jint JNICALL PRIMLIB_GetReflectiveWrapperType(JNIEnv * env, jobject obj) {
- jclass typeClass;
- if(obj == NULL) {
- return PRIMLIB_NULL;
- }
-
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_DOUBLE);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_DOUBLE;
- }
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_FLOAT);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_FLOAT;
- }
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_LONG;
- }
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_INT;
- }
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_CHAR;
- }
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_SHORT;
- }
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_BYTE;
- }
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BOOLEAN);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_BOOLEAN;
- }
- typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_VOID);
- if((*env)->IsInstanceOf(env, obj, typeClass)) {
- return PRIMLIB_VOID;
- }
- return PRIMLIB_OBJECT;
-}
-
-JNIEXPORT jint JNICALL PRIMLIB_GetReflectiveType(JNIEnv * env, jclass returnType) {
- jclass typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_DOUBLE);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_DOUBLE;
- }
- typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_FLOAT);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_FLOAT;
- }
- typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_LONG);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_LONG;
- }
- typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_INT);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_INT;
- }
- typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_CHAR);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_CHAR;
- }
- typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_SHORT);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_SHORT;
- }
- typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_BYTE);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_BYTE;
- }
- typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_BOOLEAN);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_BOOLEAN;
- }
- typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_VOID);
- if((*env)->IsAssignableFrom(env, returnType, typeClass)) {
- return PRIMLIB_VOID;
- }
- return PRIMLIB_OBJECT;
-}
-
-
-JNIEXPORT jboolean JNICALL PRIMLIB_GetBooleanObjectValue(JNIEnv * env, jobject obj) {
- jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_BOOLEAN);
- return (*env)->CallBooleanMethod(env, obj, acc);
-}
-
-JNIEXPORT jbyte JNICALL PRIMLIB_GetByteObjectValue(JNIEnv * env, jobject obj) {
- jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_BYTE);
- return (*env)->CallByteMethod(env, obj, acc);
-}
-
-JNIEXPORT jshort JNICALL PRIMLIB_GetShortObjectValue(JNIEnv * env, jobject obj) {
- jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_SHORT);
- return (*env)->CallShortMethod(env, obj, acc);
-}
-
-JNIEXPORT jchar JNICALL PRIMLIB_GetCharObjectValue(JNIEnv * env, jobject obj) {
- jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_CHAR);
- return (*env)->CallCharMethod(env, obj, acc);
-}
-
-JNIEXPORT jint JNICALL PRIMLIB_GetIntObjectValue(JNIEnv * env, jobject obj) {
- jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_INT);
- return (*env)->CallIntMethod(env, obj, acc);
-}
-
-JNIEXPORT jlong JNICALL PRIMLIB_GetLongObjectValue(JNIEnv * env, jobject obj) {
- jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_LONG);
- return (*env)->CallLongMethod(env, obj, acc);
-}
-
-JNIEXPORT jfloat JNICALL PRIMLIB_GetFloatObjectValue(JNIEnv * env, jobject obj) {
- jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_FLOAT);
- return (*env)->CallFloatMethod(env, obj, acc);
-}
-
-JNIEXPORT jdouble JNICALL PRIMLIB_GetDoubleObjectValue(JNIEnv * env, jobject obj) {
- jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_DOUBLE);
- return (*env)->CallDoubleMethod(env, obj, acc);
-}
-
-
-
-JNIEXPORT jvalue JNICALL PRIMLIB_UnwrapJValue(JNIEnv* env, jobject obj, jclass classType) {
- jvalue retval;
- jint objType = PRIMLIB_GetReflectiveType(env, classType);
- if(objType == PRIMLIB_BOOLEAN) {
- retval.z = PRIMLIB_UnwrapBoolean(env,obj);
- } else if(objType == PRIMLIB_BYTE) {
- retval.b = PRIMLIB_UnwrapByte(env,obj);
- } else if(objType == PRIMLIB_CHAR) {
- retval.c = PRIMLIB_UnwrapChar(env,obj);
- } else if(objType == PRIMLIB_SHORT) {
- retval.s = PRIMLIB_UnwrapShort(env,obj);
- } else if(objType == PRIMLIB_INT) {
- retval.i = PRIMLIB_UnwrapInt(env,obj);
- } else if(objType == PRIMLIB_LONG) {
- retval.j = PRIMLIB_UnwrapLong(env,obj);
- } else if(objType == PRIMLIB_FLOAT) {
- retval.f = PRIMLIB_UnwrapFloat(env,obj);
- } else if(objType == PRIMLIB_DOUBLE) {
- retval.d = PRIMLIB_UnwrapDouble(env,obj);
- } else {
- if(obj != NULL && !(*env)->IsInstanceOf(env, obj, classType)) {
- JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct object type.");
- return retval;
- }
- retval.l = obj;
- }
- return retval;
-}
-
diff --git a/libjava/jni/classpath/primlib.h b/libjava/jni/classpath/primlib.h
deleted file mode 100644
index 12f3bae9185..00000000000
--- a/libjava/jni/classpath/primlib.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* primlib.h
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-#ifndef __PRIMLIB_H__
-#define __PRIMLIB_H__
-
-#include <jni.h>
-
-#define PRIMLIB_UNKNOWN 0
-#define PRIMLIB_OBJECT 1
-#define PRIMLIB_BOOLEAN 2
-#define PRIMLIB_BYTE 3
-#define PRIMLIB_CHAR 4
-#define PRIMLIB_SHORT 5
-#define PRIMLIB_INT 6
-#define PRIMLIB_LONG 7
-#define PRIMLIB_FLOAT 8
-#define PRIMLIB_DOUBLE 9
-#define PRIMLIB_VOID 10
-#define PRIMLIB_NULL 11
-#define PRIMLIB_NUMTYPES 12
-
-/* Low-level primitive class accessor functions. */
-JNIEXPORT jclass JNICALL PRIMLIB_GetNativeWrapClass(JNIEnv * env, int reflectType);
-JNIEXPORT jclass JNICALL PRIMLIB_GetNativeTypeClass(JNIEnv * env, int reflectType);
-JNIEXPORT jmethodID JNICALL PRIMLIB_GetNativeWrapClassConstructor(JNIEnv * env, int reflectType);
-JNIEXPORT jmethodID JNICALL PRIMLIB_GetNativeWrapClassAccessor(JNIEnv * env, int reflectType);
-
-/* Type discovery functions: WrapperType finds out j.l.Boolean/Byte/etc., and
- Type finds out j.l.Boolean.TYPE, etc.
-*/
-JNIEXPORT jint JNICALL PRIMLIB_GetReflectiveWrapperType(JNIEnv * env, jobject obj);
-JNIEXPORT jint JNICALL PRIMLIB_GetReflectiveType(JNIEnv * env, jclass returnType);
-
-/* Constructor functions. */
-JNIEXPORT jobject JNICALL PRIMLIB_WrapBoolean(JNIEnv * env, jboolean b);
-JNIEXPORT jobject JNICALL PRIMLIB_WrapByte (JNIEnv * env, jbyte b);
-JNIEXPORT jobject JNICALL PRIMLIB_WrapChar (JNIEnv * env, jchar c);
-JNIEXPORT jobject JNICALL PRIMLIB_WrapShort (JNIEnv * env, jshort s);
-JNIEXPORT jobject JNICALL PRIMLIB_WrapInt (JNIEnv * env, jint i);
-JNIEXPORT jobject JNICALL PRIMLIB_WrapLong (JNIEnv * env, jlong l);
-JNIEXPORT jobject JNICALL PRIMLIB_WrapFloat (JNIEnv * env, jfloat f);
-JNIEXPORT jobject JNICALL PRIMLIB_WrapDouble (JNIEnv * env, jdouble d);
-
-/* Widening conversion unwrapping functions. */
-JNIEXPORT jboolean JNICALL PRIMLIB_UnwrapBoolean(JNIEnv * env, jobject obj);
-JNIEXPORT jbyte JNICALL PRIMLIB_UnwrapByte (JNIEnv * env, jobject obj);
-JNIEXPORT jshort JNICALL PRIMLIB_UnwrapShort (JNIEnv * env, jobject obj);
-JNIEXPORT jchar JNICALL PRIMLIB_UnwrapChar (JNIEnv * env, jobject obj);
-JNIEXPORT jint JNICALL PRIMLIB_UnwrapInt (JNIEnv * env, jobject obj);
-JNIEXPORT jlong JNICALL PRIMLIB_UnwrapLong (JNIEnv * env, jobject obj);
-JNIEXPORT jfloat JNICALL PRIMLIB_UnwrapFloat (JNIEnv * env, jobject obj);
-JNIEXPORT jdouble JNICALL PRIMLIB_UnwrapDouble (JNIEnv * env, jobject obj);
-
-/* Simple unwrapping functions. Objects *must* be of correct type. */
-JNIEXPORT jboolean JNICALL PRIMLIB_GetBooleanObjectValue(JNIEnv * env, jobject obj);
-JNIEXPORT jbyte JNICALL PRIMLIB_GetByteObjectValue (JNIEnv * env, jobject obj);
-JNIEXPORT jshort JNICALL PRIMLIB_GetShortObjectValue (JNIEnv * env, jobject obj);
-JNIEXPORT jchar JNICALL PRIMLIB_GetCharObjectValue (JNIEnv * env, jobject obj);
-JNIEXPORT jint JNICALL PRIMLIB_GetIntObjectValue (JNIEnv * env, jobject obj);
-JNIEXPORT jlong JNICALL PRIMLIB_GetLongObjectValue (JNIEnv * env, jobject obj);
-JNIEXPORT jfloat JNICALL PRIMLIB_GetFloatObjectValue (JNIEnv * env, jobject obj);
-JNIEXPORT jdouble JNICALL PRIMLIB_GetDoubleObjectValue (JNIEnv * env, jobject obj);
-
-/* jvalue conversion: Unwrap obj to the type of classType, with widening conversion. */
-JNIEXPORT jvalue JNICALL PRIMLIB_UnwrapJValue(JNIEnv* env, jobject obj, jclass classType);
-
-#endif