diff --git a/libjava/ChangeLog b/libjava/ChangeLog index aa3efab1eea..62b041342e5 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,13 @@ +2003-08-28 Mohan Embar + + * java/net/natInetAddressWin32.cc, + java/net/natNetworkInterfaceWin32.cc, + java/net/natPlainDatagramSocketImplWin32.cc, + java/net/natPlainSocketImplWin32.cc: + Readded code enclosed in DISABLE_JAVA_NET defines + in preparation for MinGW cleanup / networking + patch + 2003-08-28 Mohan Embar * Makefile.am: Fixed problems with parallel makes. diff --git a/libjava/java/net/natInetAddressWin32.cc b/libjava/java/net/natInetAddressWin32.cc index a0a8c676a6e..f6748fd5691 100644 --- a/libjava/java/net/natInetAddressWin32.cc +++ b/libjava/java/net/natInetAddressWin32.cc @@ -57,6 +57,34 @@ details. */ extern "C" int gethostname (char *name, int namelen); #endif +#ifdef DISABLE_JAVA_NET + +jbyteArray +java::net::InetAddress::aton (jstring) +{ + return NULL; +} + +jint +java::net::InetAddress::getFamily (jbyteArray bytes) +{ + return 0; +} + +JArray * +java::net::InetAddress::lookup (jstring, java::net::InetAddress *, jboolean) +{ + return NULL; +} + +jstring +java::net::InetAddress::getLocalHostname () +{ + return NULL; +} + +#else /* DISABLE_JAVA_NET */ + jbyteArray java::net::InetAddress::aton (jstring host) { @@ -323,3 +351,5 @@ java::net::InetAddress::getLocalHostname () // anyway, thanks to the InetAddress.localhost cache. return JvNewStringUTF (chars); } + +#endif /* DISABLE_JAVA_NET */ diff --git a/libjava/java/net/natNetworkInterfaceWin32.cc b/libjava/java/net/natNetworkInterfaceWin32.cc index c204841778a..47d68b5fd65 100644 --- a/libjava/java/net/natNetworkInterfaceWin32.cc +++ b/libjava/java/net/natNetworkInterfaceWin32.cc @@ -52,6 +52,17 @@ details. */ #include #include +#ifdef DISABLE_JAVA_NET + +::java::util::Vector* +java::net::NetworkInterface::getRealNetworkInterfaces () +{ + ::java::util::Vector* ht = new ::java::util::Vector(); + return ht; +} + +#else /* DISABLE_JAVA_NET */ + ::java::util::Vector* java::net::NetworkInterface::getRealNetworkInterfaces () { @@ -127,3 +138,5 @@ java::net::NetworkInterface::getRealNetworkInterfaces () return ht; #endif /* WIN32 */ } + +#endif // DISABLE_JAVA_NET // diff --git a/libjava/java/net/natPlainDatagramSocketImplWin32.cc b/libjava/java/net/natPlainDatagramSocketImplWin32.cc index bf7b69e3c64..d0d006d4b43 100644 --- a/libjava/java/net/natPlainDatagramSocketImplWin32.cc +++ b/libjava/java/net/natPlainDatagramSocketImplWin32.cc @@ -47,6 +47,111 @@ details. */ #include #include +#ifdef DISABLE_JAVA_NET + +void +java::net::PlainDatagramSocketImpl::create () +{ + throw new SocketException ( + JvNewStringLatin1 ("DatagramSocketImpl.create: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::bind (jint, java::net::InetAddress *) +{ + throw new BindException ( + JvNewStringLatin1 ("DatagramSocketImpl.bind: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::connect (java::net::InetAddress *, jint) +{ + throw new SocketException ( + JvNewStringLatin1 ("DatagramSocketImpl.connect: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::disconnect () +{ + throw new SocketException ( + JvNewStringLatin1 ("DatagramSocketImpl.disconnect: unimplemented")); +} + +jint +java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.peek: unimplemented")); +} + +jint +java::net::PlainDatagramSocketImpl::peekData(java::net::DatagramPacket *) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.peekData: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::close () +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.close: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::send (java::net::DatagramPacket *) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.send: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::receive (java::net::DatagramPacket *) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.receive: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::setTimeToLive (jint) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.setTimeToLive: unimplemented")); +} + +jint +java::net::PlainDatagramSocketImpl::getTimeToLive () +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.getTimeToLive: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *, + java::net::NetworkInterface *, + jboolean) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.mcastGrp: unimplemented")); +} + +void +java::net::PlainDatagramSocketImpl::setOption (jint, java::lang::Object *) +{ + throw new SocketException ( + JvNewStringLatin1 ("DatagramSocketImpl.setOption: unimplemented")); +} + +java::lang::Object * +java::net::PlainDatagramSocketImpl::getOption (jint) +{ + throw new SocketException ( + JvNewStringLatin1 ("DatagramSocketImpl.getOption: unimplemented")); +} + +#else /* DISABLE_JAVA_NET */ + + union SockAddr { struct sockaddr_in address; @@ -763,3 +868,5 @@ java::net::PlainDatagramSocketImpl::getOption (jint optID) char* strerr = strerror (errno); throw new java::net::SocketException (JvNewStringUTF (strerr)); } + +#endif /* DISABLE_JAVA_NET */ diff --git a/libjava/java/net/natPlainSocketImplWin32.cc b/libjava/java/net/natPlainSocketImplWin32.cc index 5f1a4e09204..1485ea842f9 100644 --- a/libjava/java/net/natPlainSocketImplWin32.cc +++ b/libjava/java/net/natPlainSocketImplWin32.cc @@ -9,6 +9,8 @@ details. */ #include #include +#ifndef DISABLE_JAVA_NET + #ifdef WIN32 #include @@ -52,6 +54,7 @@ read(int s, void *buf, int len) #include #endif /* WIN32 */ +#endif /* DISABLE_JAVA_NET */ #if HAVE_BSTRING_H // Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2 @@ -80,6 +83,122 @@ read(int s, void *buf, int len) #include #include +#ifdef DISABLE_JAVA_NET + +void +java::net::PlainSocketImpl::create (jboolean) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("SocketImpl.create: unimplemented")); +} + +void +java::net::PlainSocketImpl::bind (java::net::InetAddress *, jint) +{ + throw new BindException ( + JvNewStringLatin1 ("SocketImpl.bind: unimplemented")); +} + +void +java::net::PlainSocketImpl::connect (java::net::SocketAddress *, jint) +{ + throw new ConnectException ( + JvNewStringLatin1 ("SocketImpl.connect: unimplemented")); +} + +void +java::net::PlainSocketImpl::listen (jint) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("SocketImpl.listen: unimplemented")); +} + +void +java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *) +{ + throw new java::io::IOException ( + JvNewStringLatin1 ("SocketImpl.accept: unimplemented")); +} + +void +java::net::PlainSocketImpl::setOption (jint, java::lang::Object *) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.setOption: unimplemented")); +} + +java::lang::Object * +java::net::PlainSocketImpl::getOption (jint) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.getOption: unimplemented")); +} + +jint +java::net::PlainSocketImpl::read(void) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.read: unimplemented")); +} + +jint +java::net::PlainSocketImpl::read(jbyteArray buffer, jint offset, jint count) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.read: unimplemented")); +} + +void +java::net::PlainSocketImpl::write(jint b) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.write: unimplemented")); +} + +void +java::net::PlainSocketImpl::write(jbyteArray b, jint offset, jint len) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.write: unimplemented")); +} + +void +java::net::PlainSocketImpl::sendUrgentData(jint data) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.sendUrgentData: unimplemented")); +} + +jint +java::net::PlainSocketImpl::available(void) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.available: unimplemented")); +} + +void +java::net::PlainSocketImpl::close(void) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.close: unimplemented")); +} + +void +java::net::PlainSocketImpl::shutdownInput (void) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.shutdownInput: unimplemented")); +} + +void +java::net::PlainSocketImpl::shutdownOutput (void) +{ + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.shutdownOutput: unimplemented")); +} + +#else /* DISABLE_JAVA_NET */ + union SockAddr { struct sockaddr_in address; @@ -896,3 +1015,5 @@ java::net::PlainSocketImpl::shutdownOutput (void) if (::shutdown (fnum, 1)) throw new SocketException (JvNewStringUTF (strerror (errno))); } + +#endif /* DISABLE_JAVA_NET */