Index: configure.ac =================================================================== RCS file: /cvsroot/classpath/classpath/configure.ac,v retrieving revision 1.37 diff -u -r1.37 configure.ac --- configure.ac 17 Jul 2004 07:17:03 -0000 1.37 +++ configure.ac 19 Jul 2004 20:00:38 -0000 @@ -458,6 +458,9 @@ vm/reference/java/lang/reflect/Makefile vm/reference/java/io/Makefile vm/reference/java/security/Makefile +vm/reference/gnu/Makefile +vm/reference/gnu/java/Makefile +vm/reference/gnu/java/nio/Makefile lib/Makefile lib/gen-classlist.sh]) AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh]) Index: gnu/java/nio/PipeImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/nio/PipeImpl.java,v retrieving revision 1.7 diff -u -r1.7 PipeImpl.java --- gnu/java/nio/PipeImpl.java 20 Mar 2004 10:46:36 -0000 1.7 +++ gnu/java/nio/PipeImpl.java 19 Jul 2004 20:00:43 -0000 @@ -168,12 +168,9 @@ throws IOException { super(); - nativeInit (provider); + VMPipeImpl.init (this, provider); } - private native void nativeInit (SelectorProvider provider) - throws IOException; - public Pipe.SinkChannel sink() { return sink; Index: include/Makefile.am =================================================================== RCS file: /cvsroot/classpath/classpath/include/Makefile.am,v retrieving revision 1.21 diff -u -r1.21 Makefile.am --- include/Makefile.am 15 Jul 2004 12:39:46 -0000 1.21 +++ include/Makefile.am 19 Jul 2004 20:00:46 -0000 @@ -41,7 +41,7 @@ $(top_srcdir)/include/gnu_java_net_PlainDatagramSocketImpl.h \ $(top_srcdir)/include/gnu_java_net_PlainSocketImpl.h \ $(top_srcdir)/include/gnu_java_nio_NIOServerSocket.h \ -$(top_srcdir)/include/gnu_java_nio_PipeImpl.h \ +$(top_srcdir)/include/gnu_java_nio_VMPipeImpl.h \ $(top_srcdir)/include/gnu_java_nio_SelectorImpl.h \ $(top_srcdir)/include/gnu_java_nio_channels_FileChannelImpl.h \ $(top_srcdir)/include/java_io_ObjectInputStream.h \ @@ -138,8 +138,8 @@ $(JAVAH) -o $@ gnu.java.net.PlainSocketImpl $(top_srcdir)/include/gnu_java_nio_NIOServerSocket.h: $(top_srcdir)/gnu/java/nio/NIOServerSocket.java $(JAVAH) -o $@ gnu.java.nio.NIOServerSocket -$(top_srcdir)/include/gnu_java_nio_PipeImpl.h: $(top_srcdir)/gnu/java/nio/PipeImpl.java - $(JAVAH) -o $@ gnu.java.nio.PipeImpl +$(top_srcdir)/include/gnu_java_nio_VMPipeImpl.h: $(top_srcdir)/gnu/java/nio/VMPipeImpl.java + $(JAVAH) -o $@ gnu.java.nio.VMPipeImpl $(top_srcdir)/include/gnu_java_nio_SelectorImpl.h: $(top_srcdir)/gnu/java/nio/SelectorImpl.java $(JAVAH) -o $@ gnu.java.nio.SelectorImpl $(top_srcdir)/include/java_io_ObjectInputStream.h: $(top_srcdir)/java/io/ObjectInputStream.java Index: include/gnu_java_nio_PipeImpl.h =================================================================== RCS file: include/gnu_java_nio_PipeImpl.h diff -N include/gnu_java_nio_PipeImpl.h --- include/gnu_java_nio_PipeImpl.h 28 May 2004 17:27:53 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ - -#ifndef __gnu_java_nio_PipeImpl__ -#define __gnu_java_nio_PipeImpl__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -JNIEXPORT void JNICALL Java_gnu_java_nio_PipeImpl_nativeInit (JNIEnv *env, jobject, jobject); - -#ifdef __cplusplus -} -#endif - -#endif /* __gnu_java_nio_PipeImpl__ */ Index: include/gnu_java_nio_VMPipeImpl.h =================================================================== RCS file: include/gnu_java_nio_VMPipeImpl.h diff -N include/gnu_java_nio_VMPipeImpl.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ include/gnu_java_nio_VMPipeImpl.h 19 Jul 2004 20:00:46 -0000 @@ -0,0 +1,19 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ + +#ifndef __gnu_java_nio_VMPipeImpl__ +#define __gnu_java_nio_VMPipeImpl__ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_gnu_java_nio_VMPipeImpl_init (JNIEnv *env, jobject, jobject, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __gnu_java_nio_VMPipeImpl__ */ Index: native/jni/java-nio/Makefile.am =================================================================== RCS file: /cvsroot/classpath/classpath/native/jni/java-nio/Makefile.am,v retrieving revision 1.9 diff -u -r1.9 Makefile.am --- native/jni/java-nio/Makefile.am 21 May 2004 07:25:44 -0000 1.9 +++ native/jni/java-nio/Makefile.am 19 Jul 2004 20:00:56 -0000 @@ -1,7 +1,7 @@ pkglib_LTLIBRARIES = libjavanio.la libjavanio_la_SOURCES = gnu_java_nio_NIOServerSocket.c \ - gnu_java_nio_PipeImpl.c \ + gnu_java_nio_VMPipeImpl.c \ gnu_java_nio_SelectorImpl.c \ gnu_java_nio_channels_FileChannelImpl.c \ java_nio_DirectByteBufferImpl.c \ Index: native/jni/java-nio/gnu_java_nio_PipeImpl.c =================================================================== RCS file: native/jni/java-nio/gnu_java_nio_PipeImpl.c diff -N native/jni/java-nio/gnu_java_nio_PipeImpl.c --- native/jni/java-nio/gnu_java_nio_PipeImpl.c 8 Apr 2004 23:11:20 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,54 +0,0 @@ -/* gnu_java_nio_PipeImpl.c - Native methods for PipeImpl class - Copyright (C) 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 -#include - -#include -#include - -#include "gnu_java_nio_PipeImpl.h" - -#define IO_EXCEPTION "java/io/IOException" - -JNIEXPORT void JNICALL -Java_gnu_java_nio_PipeImpl_nativeInit (JNIEnv *env, jobject obj, - jobject provider) -{ - JCL_ThrowException (env, IO_EXCEPTION, "gnu.java.nio.PipeImpl.nativeInit(): not implemented"); -} - Index: native/jni/java-nio/gnu_java_nio_VMPipeImpl.c =================================================================== RCS file: native/jni/java-nio/gnu_java_nio_VMPipeImpl.c diff -N native/jni/java-nio/gnu_java_nio_VMPipeImpl.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ native/jni/java-nio/gnu_java_nio_VMPipeImpl.c 19 Jul 2004 20:00:56 -0000 @@ -0,0 +1,55 @@ +/* gnu_java_nio_VMPipeImpl.c - Native methods for PipeImpl class + Copyright (C) 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 +#include + +#include +#include + +#include "gnu_java_nio_VMPipeImpl.h" + +#define IO_EXCEPTION "java/io/IOException" + +JNIEXPORT void JNICALL +Java_gnu_java_nio_VMPipeImpl_init (JNIEnv *env, jclass cls, + jobject self, + jobject provider) +{ + JCL_ThrowException (env, IO_EXCEPTION, "gnu.java.nio.VMPipeImpl.init(): not implemented"); +} + Index: vm/reference/Makefile.am =================================================================== RCS file: /cvsroot/classpath/classpath/vm/reference/Makefile.am,v retrieving revision 1.2 diff -u -r1.2 Makefile.am --- vm/reference/Makefile.am 6 Oct 2002 21:01:58 -0000 1.2 +++ vm/reference/Makefile.am 19 Jul 2004 20:00:58 -0000 @@ -1,3 +1,3 @@ # used by automake to generate Makefile.in -SUBDIRS = java +SUBDIRS = java gnu Index: vm/reference/gnu/.cvsignore =================================================================== RCS file: vm/reference/gnu/.cvsignore diff -N vm/reference/gnu/.cvsignore --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ vm/reference/gnu/.cvsignore 19 Jul 2004 20:00:58 -0000 @@ -0,0 +1,2 @@ +Makefile +Makefile.in Index: vm/reference/gnu/Makefile.am =================================================================== RCS file: vm/reference/gnu/Makefile.am diff -N vm/reference/gnu/Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ vm/reference/gnu/Makefile.am 19 Jul 2004 20:00:58 -0000 @@ -0,0 +1,3 @@ +# used by automake to generate Makefile.in + +SUBDIRS = java Index: vm/reference/gnu/java/.cvsignore =================================================================== RCS file: vm/reference/gnu/java/.cvsignore diff -N vm/reference/gnu/java/.cvsignore --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ vm/reference/gnu/java/.cvsignore 19 Jul 2004 20:00:58 -0000 @@ -0,0 +1,2 @@ +Makefile +Makefile.in Index: vm/reference/gnu/java/Makefile.am =================================================================== RCS file: vm/reference/gnu/java/Makefile.am diff -N vm/reference/gnu/java/Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ vm/reference/gnu/java/Makefile.am 19 Jul 2004 20:00:58 -0000 @@ -0,0 +1,3 @@ +# used by automake to generate Makefile.in + +SUBDIRS = nio Index: vm/reference/gnu/java/nio/.cvsignore =================================================================== RCS file: vm/reference/gnu/java/nio/.cvsignore diff -N vm/reference/gnu/java/nio/.cvsignore --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ vm/reference/gnu/java/nio/.cvsignore 19 Jul 2004 20:00:58 -0000 @@ -0,0 +1,2 @@ +Makefile +Makefile.in Index: vm/reference/gnu/java/nio/Makefile.am =================================================================== RCS file: vm/reference/gnu/java/nio/Makefile.am diff -N vm/reference/gnu/java/nio/Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ vm/reference/gnu/java/nio/Makefile.am 19 Jul 2004 20:00:58 -0000 @@ -0,0 +1,4 @@ +# used by automake to generate Makefile.in + +EXTRA_DIST = \ +VMPipeImpl.java Index: vm/reference/gnu/java/nio/VMPipeImpl.java =================================================================== RCS file: vm/reference/gnu/java/nio/VMPipeImpl.java diff -N vm/reference/gnu/java/nio/VMPipeImpl.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ vm/reference/gnu/java/nio/VMPipeImpl.java 19 Jul 2004 20:00:58 -0000 @@ -0,0 +1,64 @@ +/* VMPipeImpl.java -- Reference implementation for VM hooks used by PipeImpl + Copyright (C) 2004 Free Software Foundation + +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. */ + +package gnu.java.nio; + +import java.io.IOException; +import java.nio.channels.spi.SelectorProvider; +import gnu.classpath.Configuration; + +/** + * This class contains the native methods for gnu.java.nio.PipeImpl + * As such, it needs help from the VM. + * + * @author Patrik Reali + */ +final class VMPipeImpl +{ + + static + { + // load the shared library needed for native methods. + if (Configuration.INIT_LOAD_LIBRARY) + { + System.loadLibrary ("javanio"); + } + } + + static native void init(PipeImpl self, SelectorProvider provider) + throws IOException; +}