Commit 5aa9bbc4 by Thomas Fitzsimmons

Makefile.am (gtk_c_source_files): Remove jni/classpath/jcl.c,…

Makefile.am (gtk_c_source_files): Remove jni/classpath/jcl.c, jni/classpath/jnilink.c, jni/classpath/primlib.c.

2005-03-16  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* Makefile.am (gtk_c_source_files): Remove jni/classpath/jcl.c,
	jni/classpath/jnilink.c, jni/classpath/primlib.c.
	(lib_gnu_java_awt_peer_gtk_la_SOURCES): jni/classpath/jcl.h,
	jni/classpath/jnilink.h, jni/classpath/primlib.h.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* external/Makefile.in: Regenerate.
	* external/sax/Makefile.in: Regenerate.
	* external/w3c_dom/Makefile.in: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* jni/classpath/jcl.h: Remove.
	* jni/classpath/jcl.c: Likewise.
	* jni/classpath/jnilink.h: Remove.
	* jni/classpath/jnilink.c: Likewise.
	* jni/classpath/primlib.h: Remove.
	* jni/classpath/primlib.c: Likewise.

From-SVN: r96590
parent f37a936b
......@@ -257,7 +257,7 @@ libgcj_la_LIBADD = \
$(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
$(libgcj_la_LIBADD)
$(LIBLTDL) $(libgcj_la_LIBADD)
libgcj_la_LINK = $(LIBLINK)
......@@ -320,10 +320,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \
jni/gtk-peer/gthread-jni.c \
jni/gtk-peer/gtk_jawt.c \
jni/classpath/jcl.c \
jni/classpath/jnilink.c \
jni/classpath/native_state.c \
jni/classpath/primlib.c
jni/classpath/native_state.c
## Java sources for Gtk peers.
gtk_awt_peer_sources = \
......@@ -469,10 +466,7 @@ $(gtk_awt_peer_sources) \
$(gtk_c_source_files) \
jni/gtk-peer/gthread-jni.h \
jni/gtk-peer/gtkpeer.h \
jni/classpath/jcl.h \
jni/classpath/jnilink.h \
jni/classpath/native_state.h \
jni/classpath/primlib.h
jni/classpath/native_state.h
lib_gnu_java_awt_peer_gtk_la_CFLAGS = \
-Ijniinclude -I$(srcdir)/jni/classpath \
......
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -39,7 +39,8 @@ target_triplet = @target@
subdir = external
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/gcc-version.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
......@@ -47,7 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
......@@ -384,7 +385,13 @@ uninstall-info-am:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
......@@ -396,7 +403,7 @@ $(RECURSIVE_TARGETS):
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
......@@ -404,7 +411,13 @@ $(RECURSIVE_TARGETS):
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
......@@ -425,7 +438,7 @@ maintainer-clean-recursive:
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
......
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -42,7 +42,8 @@ target_triplet = @target@
subdir = external/sax
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/gcc-version.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
......@@ -50,7 +51,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
......
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -42,7 +42,8 @@ target_triplet = @target@
subdir = external/w3c_dom
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/gcc-version.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
......@@ -50,7 +51,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
......
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -42,7 +42,8 @@ DIST_COMMON = $(gcj_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/libgcj-config.h.in \
$(toolgcj_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/gcc-version.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
......@@ -50,7 +51,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
......
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -41,7 +41,8 @@ subdir = include
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(tool_include__HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/gcc-version.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
......@@ -49,7 +50,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
......
/* 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;
}
/* 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
/* 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;
}
}
/* 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
/* 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
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -39,7 +39,8 @@ target_triplet = @target@
subdir = testsuite
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/gcc-version.m4 \
$(top_srcdir)/../config/gxx-include-dir.m4 \
......@@ -47,7 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
$(top_srcdir)/../config/lcmessage.m4 \
$(top_srcdir)/../config/lib-ld.m4 \
$(top_srcdir)/../config/lib-link.m4 \
$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
$(top_srcdir)/../config/lib-prefix.m4 \
$(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment