[kaffe] CVS kaffe (guilhem): NIO+NET classes merging from GNU Classpath + KJC updates.

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Sun Sep 28 13:02:02 2003


PatchSet 4072 
Date: 2003/09/28 19:53:51
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
NIO+NET classes merging from GNU Classpath + KJC updates.

This KJC should fix the past issue. Please report any misbehaviour (regression tests
work here).

Members: 
	ChangeLog:1.1667->1.1668 
	include/Makefile.am:1.48->1.49 
	include/Makefile.in:1.122->1.123 
	libraries/clib/net/PlainDatagramSocketImpl.c:1.29->1.30 
	libraries/clib/net/PlainSocketImpl.c:1.32->1.33 
	libraries/javalib/Klasses.jar.bootstrap:1.38->1.39 
	libraries/javalib/Makefile.am:1.135->1.136 
	libraries/javalib/Makefile.in:1.183->1.184 
	libraries/javalib/bootstrap.classlist:1.31->1.32 
	libraries/javalib/essential.files:1.27->1.28 
	libraries/javalib/kjc.jar:1.21->1.22 
	libraries/javalib/gnu/java/net/PlainDatagramSocketImpl.java:INITIAL->1.1 
	libraries/javalib/gnu/java/net/PlainSocketImpl.java:INITIAL->1.1 
	libraries/javalib/gnu/java/net/SocketInputStream.java:INITIAL->1.1 
	libraries/javalib/gnu/java/net/SocketOutputStream.java:INITIAL->1.1 
	libraries/javalib/gnu/java/nio/DatagramChannelImpl.java:1.3->1.4 
	libraries/javalib/gnu/java/nio/DatagramChannelSelectionKey.java:INITIAL->1.1 
	libraries/javalib/gnu/java/nio/FileLockImpl.java:INITIAL->1.1 
	libraries/javalib/gnu/java/nio/NIOConstants.java:INITIAL->1.1 
	libraries/javalib/gnu/java/nio/NIODatagramSocket.java:INITIAL->1.1 
	libraries/javalib/gnu/java/nio/NIOSocket.java:INITIAL->1.1 
	libraries/javalib/gnu/java/nio/SelectionKeyImpl.java:1.3->1.4 
	libraries/javalib/gnu/java/nio/SelectorImpl.java:1.2->1.3 
	libraries/javalib/gnu/java/nio/SocketChannelImpl.java:1.5->1.6 
	libraries/javalib/gnu/java/nio/SocketChannelSelectionKey.java:INITIAL->1.1 
	libraries/javalib/java/net/DatagramSocket.java:1.15->1.16 
	libraries/javalib/java/net/PlainDatagramSocketImpl.java:1.10->1.11(DEAD) 
	libraries/javalib/java/net/PlainSocketImpl.java:1.17->1.18(DEAD) 
	libraries/javalib/java/net/ServerSocket.java:1.16->1.17 
	libraries/javalib/java/net/Socket.java:1.26->1.27 
	libraries/javalib/java/net/SocketInputStream.java:1.8->1.9(DEAD) 
	libraries/javalib/java/net/SocketOutputStream.java:1.4->1.5(DEAD) 
	libraries/javalib/java/nio/ByteBufferImpl.java:1.2->1.3 
	libraries/javalib/java/nio/DirectByteBufferImpl.java:1.2->1.3 
	libraries/javalib/java/nio/MappedByteBufferImpl.java:1.1->1.2 
	libraries/javalib/java/nio/channels/FileChannelImpl.java:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1667 kaffe/ChangeLog:1.1668
--- kaffe/ChangeLog:1.1667	Sun Sep 28 19:47:40 2003
+++ kaffe/ChangeLog	Sun Sep 28 19:53:51 2003
@@ -1,3 +1,59 @@
+2003-09-28  Guilhem Lavaux <guilhem@kaffe.org>
+
+	* libraries/javalib/gnu/java/net/PlainDatagramSocketImpl.java,
+	libraries/javalib/gnu/java/net/PlainSocketImpl.java,
+	libraries/javalib/gnu/java/net/SocketInputStream.java,
+	libraries/javalib/gnu/java/net/SocketOutputStream.java,
+	Moved implementation dependent NET classes to gnu/java/net as
+	requested by new NET classes from GNU Classpath.
+	(PlainSocketImpl.getNativeFD) Added and also a field called native_fd.
+	(PlainDatagramSocketImpl.getNativeFD) Added and also a field called
+	native_fd.
+
+	* libraries/javalib/gnu/java/nio/DatagramChannelImpl.java,
+	libraries/javalib/gnu/java/nio/DatagramChannelSelectionKey.java,
+	libraries/javalib/gnu/java/nio/FileLockImpl.java,
+	libraries/javalib/gnu/java/nio/NIOConstants.java,
+	libraries/javalib/gnu/java/nio/NIODatagramSocket.java,
+	libraries/javalib/gnu/java/nio/NIOSocket.java,
+	libraries/javalib/gnu/java/nio/SelectionKeyImpl.java,
+	libraries/javalib/gnu/java/nio/SelectorImpl.java,
+	libraries/javalib/gnu/java/nio/SocketChannelImpl.java,
+	libraries/javalib/gnu/java/nio/SocketChannelSelectionKey.java,
+	libraries/javalib/java/nio/ByteBufferImpl.java,
+	libraries/javalib/java/nio/DirectByteBufferImpl.java,
+	libraries/javalib/java/nio/MappedByteBufferImpl.java,
+	libraries/javalib/java/nio/channels/FileChannelImpl.java:
+	Merged new NIO classes from GNU Classpath.
+
+	* libraries/javalib/java/net/DatagramSocket.java,
+	libraries/javalib/java/net/PlainDatagramSocketImpl.java,
+	libraries/javalib/java/net/PlainSocketImpl.java,
+	libraries/javalib/java/net/ServerSocket.java,
+	libraries/javalib/java/net/Socket.java,
+	libraries/javalib/java/net/SocketInputStream.java,
+	libraries/javalib/java/net/SocketOutputStream.java,
+	libraries/clib/net/PlainDatagramSocketImpl.c,
+	libraries/clib/net/PlainSocketImpl.c:
+	Updated NET classes from GNU Classpath. Native implementation must
+	initialize the new field called native_fd.
+	
+	* include/Makefile.am:
+	(NOINSTALL_DERIVED_HDRS) Changed java_net_PlainDatagramSocketImpl.h,
+	java_net_PlainSocketImpl.h into
+	gnu_java_net_PlainDatagramSocketImpl.h and
+	gnu_java_net_PlainSocketImpl.h.
+	
+	* include/Makefile.in, libraries/javalib/Klasses.jar.bootstrap,
+	libraries/javalib/Makefile.am, libraries/javalib/Makefile.in:
+	regenerated.
+
+	* libraries/javalib/bootstrap.classlist,
+	libraries/javalib/essential.files: updated to reflect the
+	new NIO and NET classes.
+	
+	* libraries/javalib/kjc.jar: Updated.
+
 2003-09-28  Helmer Kraemer  <hkraemer@freenet.de>
 
 	* kaffe/kaffevm/mem/gc-incremental.c:
Index: kaffe/include/Makefile.am
diff -u kaffe/include/Makefile.am:1.48 kaffe/include/Makefile.am:1.49
--- kaffe/include/Makefile.am:1.48	Sun Aug 31 17:16:48 2003
+++ kaffe/include/Makefile.am	Sun Sep 28 19:53:53 2003
@@ -75,8 +75,8 @@
 	java_net_InetAddress.h \
 	java_net_InetSocketAddress.h \
 	java_net_NetworkInterface.h \
-	java_net_PlainDatagramSocketImpl.h \
-	java_net_PlainSocketImpl.h \
+	gnu_java_net_PlainDatagramSocketImpl.h \
+	gnu_java_net_PlainSocketImpl.h \
 	java_net_SocketAddress.h \
 	java_net_SocketImpl.h \
 	java_net_SocketOptions.h \
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.122 kaffe/include/Makefile.in:1.123
--- kaffe/include/Makefile.in:1.122	Sun Sep 14 20:09:36 2003
+++ kaffe/include/Makefile.in	Sun Sep 28 19:53:53 2003
@@ -316,8 +316,8 @@
 	java_net_InetAddress.h \
 	java_net_InetSocketAddress.h \
 	java_net_NetworkInterface.h \
-	java_net_PlainDatagramSocketImpl.h \
-	java_net_PlainSocketImpl.h \
+	gnu_java_net_PlainDatagramSocketImpl.h \
+	gnu_java_net_PlainSocketImpl.h \
 	java_net_SocketAddress.h \
 	java_net_SocketImpl.h \
 	java_net_SocketOptions.h \
Index: kaffe/libraries/clib/net/PlainDatagramSocketImpl.c
diff -u kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.29 kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.30
--- kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.29	Tue Sep  2 23:38:28 2003
+++ kaffe/libraries/clib/net/PlainDatagramSocketImpl.c	Sun Sep 28 19:53:54 2003
@@ -21,7 +21,7 @@
 #include "java_net_DatagramPacket.h"
 #include "java_net_NetworkInterface.h"
 #include "java_net_SocketAddress.h"
-#include "java_net_PlainDatagramSocketImpl.h"
+#include "gnu_java_net_PlainDatagramSocketImpl.h"
 #include "java_net_InetSocketAddress.h"
 #include "java_net_InetAddress.h"
 #include "java_net_SocketOptions.h"
@@ -90,7 +90,7 @@
  * Create a datagram socket.
  */
 void
-java_net_PlainDatagramSocketImpl_datagramSocketCreate(struct Hjava_net_PlainDatagramSocketImpl* this)
+gnu_java_net_PlainDatagramSocketImpl_datagramSocketCreate(struct Hgnu_java_net_PlainDatagramSocketImpl* this)
 {
 	int fd;
 	int rc;
@@ -105,6 +105,7 @@
 		SignalError("java.net.SocketException", SYS_ERROR(rc));
 	}
 	unhand(unhand(this)->fd)->nativeFd = fd;
+	unhand(this)->native_fd = fd;
 
 DBG(NATIVENET,
 	dprintf("datagram_create(%p) -> fd=%d\n", this, fd);
@@ -124,7 +125,7 @@
  * Bind a port to the socket.
  */
 void
-java_net_PlainDatagramSocketImpl_bind(struct Hjava_net_PlainDatagramSocketImpl* this, jint port, struct Hjava_net_InetAddress* laddr)
+gnu_java_net_PlainDatagramSocketImpl_bind(struct Hgnu_java_net_PlainDatagramSocketImpl* this, jint port, struct Hjava_net_InetAddress* laddr)
 {
 	int r;
 	struct sockaddr_in addr;
@@ -176,7 +177,7 @@
 }
 
 void
-java_net_PlainDatagramSocketImpl_send(struct Hjava_net_PlainDatagramSocketImpl* this, struct Hjava_net_DatagramPacket* pkt)
+gnu_java_net_PlainDatagramSocketImpl_send(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_DatagramPacket* pkt)
 {
 	int rc;
 	ssize_t bsent;
@@ -215,7 +216,7 @@
 }
 
 jint
-java_net_PlainDatagramSocketImpl_peek(struct Hjava_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* addr)
+gnu_java_net_PlainDatagramSocketImpl_peek(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* addr)
 {
 	ssize_t r;
 	int rc;
@@ -235,7 +236,7 @@
 }
 
 void
-java_net_PlainDatagramSocketImpl_receive(struct Hjava_net_PlainDatagramSocketImpl* this, struct Hjava_net_DatagramPacket* pkt)
+gnu_java_net_PlainDatagramSocketImpl_receive(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_DatagramPacket* pkt)
 {
 	ssize_t r;
 	int rc;
@@ -319,7 +320,7 @@
  * Close the socket.
  */
 void
-java_net_PlainDatagramSocketImpl_datagramSocketClose(struct Hjava_net_PlainDatagramSocketImpl* this)
+gnu_java_net_PlainDatagramSocketImpl_datagramSocketClose(struct Hgnu_java_net_PlainDatagramSocketImpl* this)
 {
 	int r;
 
@@ -338,7 +339,7 @@
 
 
 void
-java_net_PlainDatagramSocketImpl_socketSetOption(struct Hjava_net_PlainDatagramSocketImpl* this, jint opt, struct Hjava_lang_Object* arg)
+gnu_java_net_PlainDatagramSocketImpl_socketSetOption(struct Hgnu_java_net_PlainDatagramSocketImpl* this, jint opt, struct Hjava_lang_Object* arg)
 {
 	struct Hjava_net_InetAddress* addrp;
 	int k, v, r;
@@ -394,7 +395,7 @@
 }
 
 jint
-java_net_PlainDatagramSocketImpl_socketGetOption(struct Hjava_net_PlainDatagramSocketImpl* this, jint opt)
+gnu_java_net_PlainDatagramSocketImpl_socketGetOption(struct Hgnu_java_net_PlainDatagramSocketImpl* this, jint opt)
 {
 	int k, r, v;
 	int vsize = sizeof(v);
@@ -447,7 +448,7 @@
  * Join multicast group
  */
 void
-java_net_PlainDatagramSocketImpl_join(struct Hjava_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* laddr)
+gnu_java_net_PlainDatagramSocketImpl_join(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* laddr)
 {
 #if defined(IP_ADD_MEMBERSHIP)
 	int r;
@@ -471,7 +472,7 @@
  * leave multicast group
  */
 void
-java_net_PlainDatagramSocketImpl_leave(struct Hjava_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* laddr)
+gnu_java_net_PlainDatagramSocketImpl_leave(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* laddr)
 {
 #if defined(IP_DROP_MEMBERSHIP)
 	int r;
@@ -495,7 +496,7 @@
  * Join multicast group
  */
 void
-java_net_PlainDatagramSocketImpl_joinGroup(struct Hjava_net_PlainDatagramSocketImpl* this, struct Hjava_net_SocketAddress *jsa, struct Hjava_net_NetworkInterface *jni)
+gnu_java_net_PlainDatagramSocketImpl_joinGroup(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_SocketAddress *jsa, struct Hjava_net_NetworkInterface *jni)
 {
 #if defined(IP_ADD_MEMBERSHIP)
 	struct Hjava_net_InetSocketAddress *jisa;
@@ -536,7 +537,7 @@
  * Leave multicast group
  */
 void
-java_net_PlainDatagramSocketImpl_leaveGroup(struct Hjava_net_PlainDatagramSocketImpl* this, struct Hjava_net_SocketAddress *jsa, struct Hjava_net_NetworkInterface *jni)
+gnu_java_net_PlainDatagramSocketImpl_leaveGroup(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_SocketAddress *jsa, struct Hjava_net_NetworkInterface *jni)
 {
 #if defined(IP_ADD_MEMBERSHIP)
 	struct Hjava_net_InetSocketAddress *jisa;
@@ -577,7 +578,7 @@
  * set multicast-TTL
  */
 void
-java_net_PlainDatagramSocketImpl_setTTL(struct Hjava_net_PlainDatagramSocketImpl* this, jbool ttl)
+gnu_java_net_PlainDatagramSocketImpl_setTTL(struct Hgnu_java_net_PlainDatagramSocketImpl* this, jbool ttl)
 {
 #if defined(IP_MULTICAST_TTL)
 	int r;
@@ -598,7 +599,7 @@
  * get multicast-TTL
  */
 jbyte
-java_net_PlainDatagramSocketImpl_getTTL(struct Hjava_net_PlainDatagramSocketImpl* this)
+gnu_java_net_PlainDatagramSocketImpl_getTTL(struct Hgnu_java_net_PlainDatagramSocketImpl* this)
 {
 #if defined(IP_MULTICAST_TTL)
 	unsigned char v;
Index: kaffe/libraries/clib/net/PlainSocketImpl.c
diff -u kaffe/libraries/clib/net/PlainSocketImpl.c:1.32 kaffe/libraries/clib/net/PlainSocketImpl.c:1.33
--- kaffe/libraries/clib/net/PlainSocketImpl.c:1.32	Sun Aug 31 17:16:49 2003
+++ kaffe/libraries/clib/net/PlainSocketImpl.c	Sun Sep 28 19:53:54 2003
@@ -18,7 +18,7 @@
 #include "java_lang_Integer.h"
 #include "java_net_SocketImpl.h"
 #include "java_net_InetAddress.h"
-#include "java_net_PlainSocketImpl.h"
+#include "gnu_java_net_PlainSocketImpl.h"
 #include "java_net_SocketOptions.h"
 #include "java_io_InterruptedIOException.h"
 #include "nets.h"
@@ -108,7 +108,7 @@
  * Create a stream or datagram socket.
  */
 void
-java_net_PlainSocketImpl_socketCreate(struct Hjava_net_PlainSocketImpl* this, jbool stream)
+gnu_java_net_PlainSocketImpl_socketCreate(struct Hgnu_java_net_PlainSocketImpl* this, jbool stream)
 {
 	int fd;
 	int type;
@@ -137,15 +137,16 @@
 	    )
 
 	unhand(unhand(this)->fd)->nativeFd = fd;
+	unhand(this)->native_fd = fd;
 }
 
 /*
  * Connect the socket to someone.
  */
 void
-java_net_PlainSocketImpl_socketConnect(struct Hjava_net_PlainSocketImpl* this,
-				       struct Hjava_net_InetAddress* daddr, 
-				       jint dport, jint timeout)
+gnu_java_net_PlainSocketImpl_socketConnect(struct Hgnu_java_net_PlainSocketImpl* this,
+					   struct Hjava_net_InetAddress* daddr, 
+					   jint dport, jint timeout)
 {
 	int fd;
 	int r;
@@ -206,9 +207,9 @@
  * Bind this socket to an address.
  */
 void
-java_net_PlainSocketImpl_socketBind(struct Hjava_net_PlainSocketImpl* this,
-				    struct Hjava_net_InetAddress* laddr, 
-				    jint lport)
+gnu_java_net_PlainSocketImpl_socketBind(struct Hgnu_java_net_PlainSocketImpl* this,
+					struct Hjava_net_InetAddress* laddr, 
+					jint lport)
 {
 	int r;
 	struct sockaddr_in addr;
@@ -270,7 +271,7 @@
  * Turn this socket into a listener.
  */
 void
-java_net_PlainSocketImpl_socketListen(struct Hjava_net_PlainSocketImpl* this, jint count)
+gnu_java_net_PlainSocketImpl_socketListen(struct Hgnu_java_net_PlainSocketImpl* this, jint count)
 {
 	int r;
 
@@ -288,7 +289,7 @@
  * Accept a connection.
  */
 void
-java_net_PlainSocketImpl_socketAccept(struct Hjava_net_PlainSocketImpl* this, struct Hjava_net_SocketImpl* sock)
+gnu_java_net_PlainSocketImpl_socketAccept(struct Hgnu_java_net_PlainSocketImpl* this, struct Hjava_net_SocketImpl* sock)
 {
 	int r;
 	int rc;
@@ -327,6 +328,7 @@
 		SignalError("java.io.IOException", SYS_ERROR(rc));
 	}
 	unhand(unhand(sock)->fd)->nativeFd = r;
+	unhand((struct Hgnu_java_net_PlainSocketImpl *)sock)->native_fd = r;
 
 	/* Enter information into socket object */
 	alen = sizeof(addr);
@@ -377,7 +379,7 @@
  * Return how many bytes can be read without blocking.
  */
 jint
-java_net_PlainSocketImpl_socketAvailable(struct Hjava_net_PlainSocketImpl* this)
+gnu_java_net_PlainSocketImpl_socketAvailable(struct Hgnu_java_net_PlainSocketImpl* this)
 {
 	int r;
 	jint len;
@@ -429,7 +431,7 @@
  * Close this socket.
  */
 void
-java_net_PlainSocketImpl_socketClose(struct Hjava_net_PlainSocketImpl* this)
+gnu_java_net_PlainSocketImpl_socketClose(struct Hgnu_java_net_PlainSocketImpl* this)
 {
 	int r;
 
@@ -447,9 +449,9 @@
 }
 
 void
-java_net_PlainSocketImpl_socketSetOption(struct Hjava_net_PlainSocketImpl* this,
-					 jint opt, 
-					 struct Hjava_lang_Object* arg)
+gnu_java_net_PlainSocketImpl_socketSetOption(struct Hgnu_java_net_PlainSocketImpl* this,
+					     jint opt, 
+					     struct Hjava_lang_Object* arg)
 {
 	int k, r, v;
 
@@ -505,7 +507,7 @@
 }
 
 jint
-java_net_PlainSocketImpl_socketGetOption(struct Hjava_net_PlainSocketImpl* this, jint opt)
+gnu_java_net_PlainSocketImpl_socketGetOption(struct Hgnu_java_net_PlainSocketImpl* this, jint opt)
 {
 	struct sockaddr_in addr;
 	int alen = sizeof(addr);
@@ -558,7 +560,7 @@
 }
 
 jint
-java_net_PlainSocketImpl_socketRead(struct Hjava_net_PlainSocketImpl* this, HArrayOfByte* buf, jint offset, jint len)
+gnu_java_net_PlainSocketImpl_socketRead(struct Hgnu_java_net_PlainSocketImpl* this, HArrayOfByte* buf, jint offset, jint len)
 {
         ssize_t r;
 	int rc;
@@ -604,7 +606,7 @@
 }
 
 void
-java_net_PlainSocketImpl_socketWrite(struct Hjava_net_PlainSocketImpl* this, HArrayOfByte* buf, jint offset, jint len)
+gnu_java_net_PlainSocketImpl_socketWrite(struct Hgnu_java_net_PlainSocketImpl* this, HArrayOfByte* buf, jint offset, jint len)
 {
 	int r;
 	int fd;
@@ -632,7 +634,7 @@
 }
 
 void
-java_net_PlainSocketImpl_setBlocking(struct Hjava_net_PlainSocketImpl* this, jbool blocking)
+gnu_java_net_PlainSocketImpl_setBlocking(struct Hgnu_java_net_PlainSocketImpl* this, jbool blocking)
 {
 	if (blocking == unhand(this)->blocking)
 		return;
@@ -642,7 +644,7 @@
 }
 
 void
-java_net_PlainSocketImpl_waitForConnection(struct Hjava_net_PlainSocketImpl* this)
+gnu_java_net_PlainSocketImpl_waitForConnection(struct Hgnu_java_net_PlainSocketImpl* this)
 {
 	fd_set w;
 	int fd = (int)unhand(unhand(this)->fd)->nativeFd;
Index: kaffe/libraries/javalib/Klasses.jar.bootstrap
cvs rdiff: failed to read diff file header /tmp/cvsdLgMOt for Klasses.jar.bootstrap,v: end of file
system command returned non-zero exit status: 1: aborting