+2003-08-28 Mohan Embar <gnustuff@thisiscool.com>
+
+ * 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 <gnustuff@thisiscool.com>
* Makefile.am: Fixed problems with parallel makes.
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*> *
+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)
{
// anyway, thanks to the InetAddress.localhost cache.
return JvNewStringUTF (chars);
}
+
+#endif /* DISABLE_JAVA_NET */
#include <java/net/SocketException.h>
#include <java/util/Vector.h>
+#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 ()
{
return ht;
#endif /* WIN32 */
}
+
+#endif // DISABLE_JAVA_NET //
#include <java/lang/Boolean.h>
#include <java/lang/Integer.h>
+#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;
char* strerr = strerror (errno);
throw new java::net::SocketException (JvNewStringUTF (strerr));
}
+
+#endif /* DISABLE_JAVA_NET */
#include <config.h>
#include <platform.h>
+#ifndef DISABLE_JAVA_NET
+
#ifdef WIN32
#include <windows.h>
#include <string.h>
#endif /* WIN32 */
+#endif /* DISABLE_JAVA_NET */
#if HAVE_BSTRING_H
// Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2
#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <java/lang/IllegalArgumentException.h>
+#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;
if (::shutdown (fnum, 1))
throw new SocketException (JvNewStringUTF (strerror (errno)));
}
+
+#endif /* DISABLE_JAVA_NET */