[kaffe] CVS kaffe (robilad): Small fix for static builds
Kaffe CVS
cvs-commits at kaffe.org
Wed Dec 1 08:19:34 PST 2004
PatchSet 5502
Date: 2004/12/01 16:14:59
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Small fix for static builds
2004-12-01 Dalibor Topic <robilad at kaffe.org>
* libraries/clib/classpath/Makefile.am:
Removed primlib.c and primlib.h as they are not used anywhere,
and break compilation to static libraries.
* libraries/clib/awt/classpath-gtk/classpath/Makefile.in,
libraries/clib/classpath/Makefile.in:
Regenerated.
* libraries/clib/classpath/primlib.c,
libraries/clib/classpath/primlib.h:
Removed.
Reported by: Peter Naulls <peter at chocky.org>
Members:
ChangeLog:1.3048->1.3049
libraries/clib/classpath/Makefile.am:1.1->1.2
libraries/clib/classpath/Makefile.in:1.1->1.2
libraries/clib/classpath/primlib.c:1.1->1.2(DEAD)
libraries/clib/classpath/primlib.h:1.1->1.2(DEAD)
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3048 kaffe/ChangeLog:1.3049
--- kaffe/ChangeLog:1.3048 Wed Dec 1 14:41:41 2004
+++ kaffe/ChangeLog Wed Dec 1 16:14:59 2004
@@ -1,5 +1,21 @@
2004-12-01 Dalibor Topic <robilad at kaffe.org>
+ * libraries/clib/classpath/Makefile.am:
+ Removed primlib.c and primlib.h as they are not used anywhere,
+ and break compilation to static libraries.
+
+ * libraries/clib/awt/classpath-gtk/classpath/Makefile.in,
+ libraries/clib/classpath/Makefile.in:
+ Regenerated.
+
+ * libraries/clib/classpath/primlib.c,
+ libraries/clib/classpath/primlib.h:
+ Removed.
+
+ Reported by: Peter Naulls <peter at chocky.org>
+
+2004-12-01 Dalibor Topic <robilad at kaffe.org>
+
* libraries/javalib/Klasses.jar.bootstrap:
Regenerated.
Index: kaffe/libraries/clib/classpath/Makefile.am
diff -u kaffe/libraries/clib/classpath/Makefile.am:1.1 kaffe/libraries/clib/classpath/Makefile.am:1.2
--- kaffe/libraries/clib/classpath/Makefile.am:1.1 Wed Dec 1 02:41:53 2004
+++ kaffe/libraries/clib/classpath/Makefile.am Wed Dec 1 16:15:03 2004
@@ -6,7 +6,6 @@
libclasspath_la_SOURCES = jcl.c jcl.h \
jnilink.c jnilink.h \
- primlib.c primlib.h \
native_state.c native_state.h
libclasspath_la_LDFLAGS = @CLASSPATH_MODULE@
Index: kaffe/libraries/clib/classpath/Makefile.in
diff -u kaffe/libraries/clib/classpath/Makefile.in:1.1 kaffe/libraries/clib/classpath/Makefile.in:1.2
--- kaffe/libraries/clib/classpath/Makefile.in:1.1 Wed Dec 1 02:41:53 2004
+++ kaffe/libraries/clib/classpath/Makefile.in Wed Dec 1 16:15:03 2004
@@ -75,8 +75,7 @@
nativeLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(native_LTLIBRARIES)
libclasspath_la_LIBADD =
-am_libclasspath_la_OBJECTS = jcl.lo jnilink.lo primlib.lo \
- native_state.lo
+am_libclasspath_la_OBJECTS = jcl.lo jnilink.lo native_state.lo
libclasspath_la_OBJECTS = $(am_libclasspath_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config -I$(top_builddir)/include/kaffe
depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp
@@ -366,7 +365,6 @@
libclasspath_la_SOURCES = jcl.c jcl.h \
jnilink.c jnilink.h \
- primlib.c primlib.h \
native_state.c native_state.h
libclasspath_la_LDFLAGS = @CLASSPATH_MODULE@
@@ -442,7 +440,6 @@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jcl.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jnilink.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_state.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/primlib.Plo at am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
===================================================================
Checking out kaffe/libraries/clib/classpath/primlib.c
RCS: /home/cvs/kaffe/kaffe/libraries/clib/classpath/Attic/primlib.c,v
VERS: 1.1
***************
--- kaffe/libraries/clib/classpath/primlib.c Wed Dec 1 16:19:34 2004
+++ /dev/null Sun Aug 4 19:57:58 2002
@@ -1,724 +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 const 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 const 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 const char *nativeWrapClassAccessorName[PRIMLIB_NUMTYPES] = {
- NULL,
- NULL,
- "booleanValue",
- "byteValue",
- "charValue",
- "shortValue",
- "intValue",
- "longValue",
- "floatValue",
- "doubleValue",
- NULL,
- NULL
-};
-
-static const 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;
-}
===================================================================
Checking out kaffe/libraries/clib/classpath/primlib.h
RCS: /home/cvs/kaffe/kaffe/libraries/clib/classpath/Attic/primlib.h,v
VERS: 1.1
***************
--- kaffe/libraries/clib/classpath/primlib.h Wed Dec 1 16:19:34 2004
+++ /dev/null Sun Aug 4 19:57:58 2002
@@ -1,119 +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
More information about the kaffe
mailing list