You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2006/02/06 12:18:36 UTC
svn commit: r375249 [2/4] - in
/incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio:
OSNetworkSystem.c OSNetworkSystem.h OSNetworkSystemWin32.c helpers.c
helpers.h hynio.def makefile nethelp.c nethelp.h socket.c socket.h
Added: incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/OSNetworkSystem.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/OSNetworkSystem.h?rev=375249&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/OSNetworkSystem.h (added)
+++ incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/OSNetworkSystem.h Mon Feb 6 03:18:33 2006
@@ -0,0 +1,365 @@
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+/* Header for class com_ibm_platform_OSNetworkSystem */
+#define SOCKET_CONNECT_STEP_START 0
+#define SOCKET_CONNECT_STEP_CHECK 1
+#define SOCKET_OP_NONE 0
+#define SOCKET_OP_READ 1
+#define SOCKET_OP_WRITE 2
+#define SOCKET_READ_WRITE 3
+
+
+#ifndef _Included_com_ibm_platform_OSNetworkSystem
+#define _Included_com_ibm_platform_OSNetworkSystem
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: oneTimeInitializationDatagram
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_oneTimeInitializationDatagram
+ (JNIEnv *, jclass, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: oneTimeInitializationSocket
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_oneTimeInitializationSocket
+ (JNIEnv *, jclass, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: createSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;Z)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_createSocketImpl
+ (JNIEnv *, jclass, jobject, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: createDatagramSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;Z)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_createDatagramSocketImpl
+ (JNIEnv *, jclass, jobject, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: readSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;[BIII)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_readSocketImpl
+ (JNIEnv *, jclass, jobject, jbyteArray, jint, jint, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: writeSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;[BII)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_writeSocketImpl
+ (JNIEnv *, jclass, jobject, jbyteArray, jint, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: setNonBlockingImpl
+ * Signature: (Ljava/io/FileDescriptor;Z)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_setNonBlockingImpl
+ (JNIEnv *, jclass, jobject, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: connectSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;ILjava/net/InetAddress;I)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_connectSocketImpl
+ (JNIEnv *, jclass, jobject, jint, jobject, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: connectWithTimeoutSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;IILjava/net/InetAddress;IILjava/lang/Long;)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_connectWithTimeoutSocketImpl
+ (JNIEnv *, jclass, jobject, jint, jint, jobject, jint, jint, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: connectStreamWithTimeoutSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;IIILjava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_connectStreamWithTimeoutSocketImpl
+ (JNIEnv *, jclass, jobject, jint, jint, jint, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: socketBindImpl
+ * Signature: (Ljava/io/FileDescriptor;ILjava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_socketBindImpl
+ (JNIEnv *, jclass, jobject, jint, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: listenStreamSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;I)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_listenStreamSocketImpl
+ (JNIEnv *, jclass, jobject, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: availableStreamImpl
+ * Signature: (Ljava/io/FileDescriptor;)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_availableStreamImpl
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: acceptSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;Ljava/net/SocketImpl;Ljava/io/FileDescriptor;I)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_acceptSocketImpl
+ (JNIEnv *, jclass, jobject, jobject, jobject, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: supportsUrgentDataImpl
+ * Signature: (Ljava/io/FileDescriptor;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_ibm_platform_OSNetworkSystem_supportsUrgentDataImpl
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: sendUrgentDataImpl
+ * Signature: (Ljava/io/FileDescriptor;B)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_sendUrgentDataImpl
+ (JNIEnv *, jclass, jobject, jbyte);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: connectDatagramImpl2
+ * Signature: (Ljava/io/FileDescriptor;IILjava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_connectDatagramImpl2
+ (JNIEnv *, jclass, jobject, jint, jint, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: disconnectDatagramImpl
+ * Signature: (Ljava/io/FileDescriptor;)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_disconnectDatagramImpl
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: socketBindImpl2
+ * Signature: (Ljava/io/FileDescriptor;IZLjava/net/InetAddress;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_ibm_platform_OSNetworkSystem_socketBindImpl2
+ (JNIEnv *, jclass, jobject, jint, jboolean, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: peekDatagramImpl
+ * Signature: (Ljava/io/FileDescriptor;Ljava/net/InetAddress;I)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_peekDatagramImpl
+ (JNIEnv *, jclass, jobject, jobject, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: receiveDatagramImpl
+ * Signature: (Ljava/io/FileDescriptor;Ljava/net/DatagramPacket;[BIIIZ)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_receiveDatagramImpl
+ (JNIEnv *, jclass, jobject, jobject, jbyteArray, jint, jint, jint, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: recvConnectedDatagramImpl
+ * Signature: (Ljava/io/FileDescriptor;Ljava/net/DatagramPacket;[BIIIZ)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_recvConnectedDatagramImpl
+ (JNIEnv *, jclass, jobject, jobject, jbyteArray, jint, jint, jint, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: sendDatagramImpl
+ * Signature: (Ljava/io/FileDescriptor;[BIIIZILjava/net/InetAddress;)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_sendDatagramImpl
+ (JNIEnv *, jclass, jobject, jbyteArray, jint, jint, jint, jboolean, jint, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: sendConnectedDatagramImpl
+ * Signature: (Ljava/io/FileDescriptor;[BIIZ)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_sendConnectedDatagramImpl
+ (JNIEnv *, jclass, jobject, jbyteArray, jint, jint, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: createServerStreamSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;Z)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_createServerStreamSocketImpl
+ (JNIEnv *, jclass, jobject, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: createMulticastSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;Z)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_createMulticastSocketImpl
+ (JNIEnv *, jclass, jobject, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: receiveStreamImpl
+ * Signature: (Ljava/io/FileDescriptor;[BIII)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_receiveStreamImpl
+ (JNIEnv *, jclass, jobject, jbyteArray, jint, jint, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: sendStreamImpl
+ * Signature: (Ljava/io/FileDescriptor;[BII)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_sendStreamImpl
+ (JNIEnv *, jclass, jobject, jbyteArray, jint, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: shutdownInputImpl
+ * Signature: (Ljava/io/FileDescriptor;)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_shutdownInputImpl
+ (JNIEnv *, jobject, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: shutdownOutputImpl
+ * Signature: (Ljava/io/FileDescriptor;)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_shutdownOutputImpl
+ (JNIEnv *, jobject, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: acceptStreamSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;Ljava/net/SocketImpl;Ljava/io/FileDescriptor;I)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_acceptStreamSocketImpl
+ (JNIEnv *, jclass, jobject, jobject, jobject, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: createStreamSocketImpl
+ * Signature: (Ljava/io/FileDescriptor;Z)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_createStreamSocketImpl
+ (JNIEnv *, jclass, jobject, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: sendDatagramImpl2
+ * Signature: (Ljava/io/FileDescriptor;[BIIILjava/net/InetAddress;)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_sendDatagramImpl2
+ (JNIEnv *, jclass, jobject, jbyteArray, jint, jint, jint, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: selectImpl
+ * Signature: ([Ljava/io/FileDescriptor;[Ljava/io/FileDescriptor;II[IJ)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_selectImpl
+ (JNIEnv *, jclass, jobjectArray, jobjectArray, jint, jint, jintArray, jlong);
+
+ /*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: getSocketLocalAddressImpl
+ * Signature: (Ljava/io/FileDescriptor;Z)Ljava/net/InetAddress;
+ */
+JNIEXPORT jobject JNICALL Java_com_ibm_platform_OSNetworkSystem_getSocketLocalAddressImpl
+ (JNIEnv *, jclass, jobject, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: getSocketLocalPortImpl
+ * Signature: (Ljava/io/FileDescriptor;Z)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_getSocketLocalPortImpl
+ (JNIEnv *, jclass, jobject, jboolean);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: getSocketOptionImpl
+ * Signature: (Ljava/io/FileDescriptor;I)Ljava/lang/Object;
+ */
+JNIEXPORT jobject JNICALL Java_com_ibm_platform_OSNetworkSystem_getSocketOptionImpl
+ (JNIEnv *, jclass, jobject, jint);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: setSocketOptionImpl
+ * Signature: (Ljava/io/FileDescriptor;ILjava/lang/Object;)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_setSocketOptionImpl
+ (JNIEnv *, jclass, jobject, jint, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: getSocketFlags
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_getSocketFlagsImpl
+ (JNIEnv *, jclass);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: socketCloseImpl
+ * Signature: (Ljava/io/FileDescriptor;)V
+ */
+JNIEXPORT void JNICALL Java_com_ibm_platform_OSNetworkSystem_socketCloseImpl
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: getHostByAddrImpl
+ * Signature: ([B)Ljava/net/InetAddress;
+ */
+JNIEXPORT jobject JNICALL Java_com_ibm_platform_OSNetworkSystem_getHostByAddrImpl
+ (JNIEnv *, jclass, jbyteArray);
+
+JNIEXPORT jobject JNICALL Java_com_ibm_platform_OSNetworkSystem_getHostByNameImpl
+ (JNIEnv *, jclass,jstring,jboolean);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
Added: incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/OSNetworkSystemWin32.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/OSNetworkSystemWin32.c?rev=375249&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/OSNetworkSystemWin32.c (added)
+++ incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/OSNetworkSystemWin32.c Mon Feb 6 03:18:33 2006
@@ -0,0 +1,185 @@
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "OSNetworkSystem.h"
+#include "nethelp.h"
+#include "portsock.h"
+
+/*
+ * Class: com_ibm_platform_OSNetworkSystem
+ * Method: selectImpl
+ * Signature: ([Ljava/io/FileDescriptor;[Ljava/io/FileDescriptor;II[IJ)I
+ */
+JNIEXPORT jint JNICALL Java_com_ibm_platform_OSNetworkSystem_selectImpl
+ (JNIEnv * env, jclass thisClz, jobjectArray readFDArray, jobjectArray writeFDArray,
+ jint countReadC, jint countWriteC, jintArray outFlags, jlong timeout){
+ PORT_ACCESS_FROM_ENV (env);
+ hytimeval_struct timeP;
+ I_32 result = 0;
+ I_32 size = 0;
+ jobject gotFD;
+ hyfdset_t fdset_read,fdset_write;
+ hysocket_t hysocketP;
+ jboolean isCopy ;
+ jint *flagArray;
+ int val;
+
+ fdset_read = hymem_allocate_memory(sizeof (struct hyfdset_struct));
+ fdset_write = hymem_allocate_memory(sizeof (struct hyfdset_struct));
+
+ FD_ZERO (&fdset_read->handle);
+ FD_ZERO (&fdset_write->handle);
+ for (val = 0; val<countReadC; val++){
+ gotFD = (*env)->GetObjectArrayElement(env,readFDArray,val);
+ hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, gotFD);
+ if (!hysock_socketIsValid (hysocketP)){
+ continue;
+ }
+ if (hysocketP->flags & SOCKET_IPV4_OPEN_MASK)
+ {
+ FD_SET (hysocketP->ipv4, &fdset_read->handle);
+ if (0 > (size - hysocketP->ipv4))
+ size = hysocketP->ipv4;
+ }
+ if (hysocketP->flags & SOCKET_IPV6_OPEN_MASK)
+ {
+ FD_SET (hysocketP->ipv6, &fdset_read->handle);
+ if (0 > (size - hysocketP->ipv6))
+ size = hysocketP->ipv6;
+ }
+ }
+ for (val = 0; val<countWriteC; val++){
+ gotFD = (*env)->GetObjectArrayElement(env,writeFDArray,val);
+ hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, gotFD);
+ if (!hysock_socketIsValid (hysocketP)){
+ continue;
+ }
+ if (hysocketP->flags & SOCKET_IPV4_OPEN_MASK)
+ {
+ FD_SET (hysocketP->ipv4, &fdset_write->handle);
+ if (0 > (size - hysocketP->ipv4))
+ size = hysocketP->ipv4;
+ }
+ if (hysocketP->flags & SOCKET_IPV6_OPEN_MASK)
+ {
+ FD_SET (hysocketP->ipv6, &fdset_write->handle);
+ if (0 > (size - hysocketP->ipv6))
+ size = hysocketP->ipv6;
+ }
+ }
+ /* the size is the max_fd + 1 */
+ size =size + 1;
+
+ if (0 > size)
+ {
+ result = HYPORT_ERROR_SOCKET_FDSET_SIZEBAD;
+ }
+ else
+ {
+ /* only set when timeout >= 0 (non-block)*/
+ if (0 <= timeout){
+ hysock_timeval_init ( 0, (I_32)timeout, &timeP);
+ result = hysock_select (size, fdset_read, fdset_write, NULL,&timeP);
+ }
+ else{
+ result = hysock_select (size, fdset_read, fdset_write, NULL,NULL);
+ }
+ }
+
+ if (0 < result){
+ /*output the reslut to a int array*/
+ flagArray = (*env)->GetIntArrayElements(env,outFlags, &isCopy);
+ for (val=0;val<countReadC;val++){
+ gotFD = (*env)->GetObjectArrayElement(env,readFDArray,val);
+ hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, gotFD);
+ if (!hysock_socketIsValid (hysocketP)){
+ continue;
+ }
+ if (hysocketP->flags & SOCKET_IPV4_OPEN_MASK)
+ {
+ if (FD_ISSET(hysocketP->ipv4,fdset_read))
+ flagArray[val] = SOCKET_OP_READ;
+ else
+ flagArray[val] = SOCKET_OP_NONE;
+ }
+ else if (hysocketP->flags & SOCKET_IPV6_OPEN_MASK)
+ {
+ if (FD_ISSET(hysocketP->ipv6,fdset_read))
+ flagArray[val] = SOCKET_OP_READ;
+ else
+ flagArray[val] = SOCKET_OP_NONE;
+ }
+ }
+
+ for (val=0;val<countWriteC;val++){
+ gotFD = (*env)->GetObjectArrayElement(env,writeFDArray,val);
+ hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, gotFD);
+ if (!hysock_socketIsValid (hysocketP)){
+ continue;
+ }
+ if (hysocketP->flags & SOCKET_IPV4_OPEN_MASK)
+ {
+ if (FD_ISSET(hysocketP->ipv4,fdset_write))
+ flagArray[val+countReadC] = SOCKET_OP_WRITE;
+ else
+ flagArray[val+countReadC] = SOCKET_OP_NONE;
+ }
+ else if (hysocketP->flags & SOCKET_IPV6_OPEN_MASK)
+ {
+ if (FD_ISSET(hysocketP->ipv6,fdset_write))
+ flagArray[val+countReadC] = SOCKET_OP_WRITE;
+ else
+ flagArray[val+countReadC] = SOCKET_OP_NONE;
+ }
+
+ }
+ (*env)->ReleaseIntArrayElements(env,outFlags, flagArray, 0);
+ }
+ hymem_free_memory(fdset_read);
+ hymem_free_memory(fdset_write);
+ /* return both correct and error result, let java code handle the exception*/
+ return result;
+}
+
+/*Alternative Select function*/
+int
+selectRead (JNIEnv * env,hysocket_t hysocketP, I_32 uSecTime, BOOLEAN accept){
+ PORT_ACCESS_FROM_ENV (env);
+ hytimeval_struct timeP;
+ hyfdset_t fdset_read;
+ I_32 result = 0;
+ I_32 size = 0;
+ if (0 <= uSecTime)
+ hysock_timeval_init (0, uSecTime, &timeP);
+
+ fdset_read = hymem_allocate_memory(sizeof (struct hyfdset_struct));
+ FD_ZERO (&fdset_read->handle);
+ if (hysocketP->flags & SOCKET_IPV4_OPEN_MASK)
+ {
+ FD_SET (hysocketP->ipv4, &fdset_read->handle);
+ size =hysocketP->ipv4 + 1;
+ }
+ if (hysocketP->flags & SOCKET_IPV6_OPEN_MASK)
+ {
+ FD_SET (hysocketP->ipv6, &fdset_read->handle);
+ size =hysocketP->ipv6 + 1;
+ }
+ if (0 <= uSecTime)
+ result = hysock_select (size, fdset_read, NULL, NULL,&timeP);
+ else
+ result = hysock_select (size, fdset_read, NULL, NULL,NULL);
+ hymem_free_memory(fdset_read);
+ return result;
+}
Added: incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/helpers.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/helpers.c?rev=375249&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/helpers.c (added)
+++ incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/helpers.c Mon Feb 6 03:18:33 2006
@@ -0,0 +1,401 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Undefine the winsockapi because winsock2 defines it. Removes warnings. */
+#if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)
+#undef _WINSOCKAPI_
+#endif
+
+#include <winsock2.h>
+
+#include <windows.h>
+#include <winbase.h>
+#include <stdlib.h>
+#include <LMCONS.H>
+#include <direct.h>
+
+#include "jcl.h"
+#include "jclprots.h"
+#include "jclglob.h"
+
+#include "portsock.h"
+
+int platformReadLink (char *link);
+jbyteArray getPlatformPath (JNIEnv * env, jbyteArray path);
+void setDefaultServerSocketOptions (JNIEnv * env, hysocket_t socketP);
+jint getPlatformDatagramNominalSize (JNIEnv * env, hysocket_t socketP);
+I_32 getPlatformRoots (char *rootStrings);
+jstring getCustomTimeZoneInfo (JNIEnv * env, jintArray tzinfo,
+ jbooleanArray isCustomTimeZone);
+I_32 getPlatformIsHidden (JNIEnv * env, char *path);
+jint getPlatformDatagramMaxSize (JNIEnv * env, hysocket_t socketP);
+char *getCommports (JNIEnv * env);
+I_32 getPlatformIsWriteOnly (JNIEnv * env, char *path);
+I_32 setPlatformFileLength (JNIEnv * env, IDATA descriptor, jlong newLength);
+void platformCanonicalPath (char *pathCopy);
+I_32 getPlatformIsReadOnly (JNIEnv * env, char *path);
+void setPlatformBindOptions (JNIEnv * env, hysocket_t socketP);
+I_32 setPlatformLastModified (JNIEnv * env, char *path, I_64 time);
+I_32 setPlatformReadOnly (JNIEnv * env, char *path);
+
+UDATA platformFindfirst (char *path, char *resultbuf);
+int portCmp (const void **a, const void **b);
+static void unmangle (JNIEnv * env, LPWSTR data);
+I_32 getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute);
+static LPWSTR mangle (JNIEnv * env, char *path);
+
+/* This function converts a char array into a unicode wide string */
+static LPWSTR
+mangle (JNIEnv * env, char *path)
+{
+ PORT_ACCESS_FROM_ENV (env);
+ int convSize;
+ LPWSTR unicodeBuffer;
+
+ convSize = MultiByteToWideChar (CP_ACP, MB_PRECOMPOSED, path, -1, NULL, 0);
+ convSize = (convSize + 1) * 2;
+ unicodeBuffer = jclmem_allocate_memory (env, convSize);
+ if (!unicodeBuffer)
+ return NULL;
+ MultiByteToWideChar (CP_ACP, MB_PRECOMPOSED, path, -1, unicodeBuffer,
+ convSize);
+ return unicodeBuffer;
+}
+
+/* This function frees the memory allocated in mangle */
+static void
+unmangle (JNIEnv * env, LPWSTR data)
+{
+ PORT_ACCESS_FROM_ENV (env);
+ jclmem_free_memory (env, data);
+}
+
+/**
+ * It is the responsibility of #getPlatformRoots to return a char array
+ * with volume names separated by null with a trailing extra null, so for
+ * Unix it should be '\<null><null>' .
+ */
+I_32
+getPlatformRoots (char *rootStrings)
+{
+
+ I_32 result = GetLogicalDriveStrings (HyMaxPath, rootStrings);
+ return result / 4; /* Letter, colon, slash, null = 4 bytes */
+
+}
+
+/**
+ * Answer 1 if the path is hidden, 0 otherwise even in fail cases.
+ */
+I_32
+getPlatformIsHidden (JNIEnv * env, char *path)
+{
+ return getPlatformAttribute (env, path, FILE_ATTRIBUTE_HIDDEN);
+}
+
+/**
+ * Answer 1 if the file time was updated, 0 otherwise even in fail cases.
+ */
+I_32
+setPlatformLastModified (JNIEnv * env, char *path, I_64 time)
+{
+ PORT_ACCESS_FROM_ENV (env);
+ FILETIME fileTime;
+ I_32 result, dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
+ IDATA hFile;
+ I_64 tempLongLong;
+
+ char *unicodePath;
+ unicodePath = path;
+
+ /**
+ * Open the path ensuring GENERIC_WRITE and FILE_FLAG_BACKUP_SEMANTICS if it's a directory.
+ * The directory modification is only supported on some platforms (NT, Windows2000).
+ */
+ result = GetFileAttributes ((LPCTSTR) unicodePath);
+ if (result == 0xFFFFFFFF)
+ {
+ return 0;
+ }
+ if (result & FILE_ATTRIBUTE_DIRECTORY)
+ dwFlagsAndAttributes = FILE_FLAG_BACKUP_SEMANTICS;
+
+ hFile = (IDATA) CreateFile (unicodePath,
+ GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING, dwFlagsAndAttributes, NULL);
+ if ((IDATA) hFile == (IDATA) INVALID_HANDLE_VALUE)
+ {
+ return 0;
+ }
+
+ tempLongLong = (time * (I_64) 10000) + 116444736000000000;
+
+ fileTime.dwHighDateTime = (I_32) (tempLongLong >> 32);
+ fileTime.dwLowDateTime = (I_32) tempLongLong;
+ result =
+ SetFileTime ((HANDLE) hFile, (LPFILETIME) NULL, (LPFILETIME) NULL,
+ &fileTime);
+ hyfile_close (hFile);
+
+ return result;
+}
+
+/**
+ * Answer 1 if the path is now readOnly, 0 otherwise even in fail cases.
+ */
+I_32
+setPlatformReadOnly (JNIEnv * env, char *path)
+{
+ PORT_ACCESS_FROM_ENV (env);
+ I_32 attrs, result;
+
+ char *unicodePath;
+ unicodePath = path;
+
+ attrs = GetFileAttributes (unicodePath);
+ if (attrs == 0xFFFFFFFF)
+ {
+ return 0;
+ }
+ attrs = attrs | FILE_ATTRIBUTE_READONLY;
+ result = SetFileAttributes (unicodePath, attrs);
+
+ return result;
+}
+
+/**
+ * Answer 1 if the file length was set, 0 otherwise even in fail cases.
+ */
+I_32
+setPlatformFileLength (JNIEnv * env, IDATA descriptor, jlong newLength)
+{
+ I_32 result;
+ I_32 lowValue, highValue;
+ lowValue = (I_32) newLength;
+ highValue = (I_32) (newLength >> 32);
+ result =
+ SetFilePointer ((HANDLE) descriptor, lowValue, &highValue, FILE_BEGIN);
+ if (result == INVALID_FILE_SIZE && (GetLastError ()) != NO_ERROR)
+ return 0;
+ return SetEndOfFile ((HANDLE) descriptor);
+}
+
+jbyteArray
+getPlatformPath (JNIEnv * env, jbyteArray path)
+{
+ char buffer[256];
+ jbyteArray answer = NULL;
+ jsize length = (*env)->GetArrayLength (env, path);
+ jbyte *lpath = (*env)->GetByteArrayElements (env, path, 0);
+
+ if (lpath != NULL)
+ {
+ if (length >= 2 && lpath[1] == ':')
+ {
+ char next = lpath[2];
+ int drive = tolower (lpath[0]) - 'a' + 1;
+ if ((next == 0 || (lpath[2] != '/' && next != '\\')) && drive >= 1
+ && drive <= 26)
+ {
+ int buflen = 2, needSlash;
+ if (_getdcwd (drive, buffer, sizeof (buffer)) != NULL)
+ {
+ buflen = strlen (buffer);
+ if (buffer[buflen - 1] == '\\')
+ buflen--;
+ }
+ needSlash = length > 2 || buflen < 3;
+ answer =
+ (*env)->NewByteArray (env,
+ buflen + length - (needSlash ? 1 : 2));
+ if (answer != NULL)
+ {
+ /* Copy drive and colon */
+ (*env)->SetByteArrayRegion (env, answer, 0, 2, lpath);
+ if (buflen > 2)
+ (*env)->SetByteArrayRegion (env, answer, 2, buflen - 2,
+ buffer + 2);
+ if (needSlash)
+ (*env)->SetByteArrayRegion (env, answer, buflen, 1, "\\");
+ if (length > 2)
+ (*env)->SetByteArrayRegion (env, answer, buflen + 1,
+ length - 2, lpath + 2);
+ }
+ }
+ }
+ (*env)->ReleaseByteArrayElements (env, path, lpath, JNI_ABORT);
+ }
+ return answer;
+}
+
+UDATA
+platformFindfirst (char *path, char *resultbuf)
+{
+ /*
+ * Takes a path and a preallocated resultbuf. Answers a handle to be used
+ * in subsequent calls to hyfile_findnext and hyfile_findclose. Handle may
+ * be -1 if hyfile_findfirst fails.
+ * The parameter @path will only be a valid directory name, any info that must
+ * be added to it and passed to the os (c:\\) should be (c:\\*) for Win32
+ */
+ WIN32_FIND_DATA lpFindFileData;
+ HANDLE handle;
+
+ handle = FindFirstFile ((LPCTSTR) path, &lpFindFileData);
+
+ if (handle == INVALID_HANDLE_VALUE)
+ return (UDATA) - 1;
+
+ lstrcpy (resultbuf, lpFindFileData.cFileName);
+ FindClose (handle);
+ return 1;
+}
+
+void
+platformCanonicalPath (char *pathCopy)
+{
+ UDATA result;
+ U_32 pos, start, length, rpos, rlen;
+ char newpath[HyMaxPath], filename[HyMaxPath];
+
+ pos = 0;
+ length = strlen (pathCopy);
+ if (length >= 2 && pathCopy[1] == ':')
+ {
+ pathCopy[0] = toupper (pathCopy[0]);
+ pos = 2;
+ }
+ else if (pathCopy[0] == '\\')
+ {
+ pos++;
+ if (length >= 2 && pathCopy[1] == '\\')
+ {
+ pos++;
+ /* Found network path, skip server and volume */
+ while (pos < length && pathCopy[pos] != '\\')
+ pos++;
+ if (pathCopy[pos] == '\\')
+ pos++;
+ while (pos < length && pathCopy[pos] != '\\')
+ pos++;
+ if (pos == length)
+ return;
+ }
+ }
+ if (pathCopy[pos] == '\\')
+ pos++;
+ start = pos;
+ memcpy (newpath, pathCopy, pos);
+ rpos = pos;
+ while (pos <= length)
+ {
+ if (pathCopy[pos] == '\\' || pos == length)
+ {
+ if (pos == length && pathCopy[pos - 1] == '\\')
+ break;
+ pathCopy[pos] = 0;
+ result = platformFindfirst (pathCopy, filename);
+ if (pos != length)
+ pathCopy[pos] = '\\';
+ if (result == (UDATA) - 1)
+ {
+ break;
+ }
+ else
+ {
+ rlen = strlen (filename);
+ if (rpos + rlen + 2 >= HyMaxPath)
+ break;
+ strcpy (&newpath[rpos], filename);
+ rpos += rlen;
+ if (pos != length)
+ newpath[rpos++] = '\\';
+ else
+ newpath[rpos] = 0;
+ start = pos + 1;
+ }
+ }
+ else if (pathCopy[pos] == '*' || pathCopy[pos] == '?')
+ break;
+ pos++;
+ }
+ if (start <= length)
+ strncpy (&newpath[rpos], &pathCopy[start], HyMaxPath - 1 - rpos);
+ strcpy (pathCopy, newpath);
+
+}
+
+void
+setPlatformBindOptions (JNIEnv * env, hysocket_t socketP)
+{
+}
+
+/**
+ * Answer 1 if the path is hidded, 0 otherwise even in fail cases.
+ */
+I_32
+getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute)
+{
+ PORT_ACCESS_FROM_ENV (env);
+ I_32 attrs;
+
+ char *unicodePath;
+ unicodePath = path;
+
+ attrs = GetFileAttributes (unicodePath);
+
+ if (attrs == 0xFFFFFFFF)
+ return 0;
+ return (attrs & attribute) == attribute;
+}
+
+/**
+ * Answer 1 if the path is read-only, 0 otherwise even in fail cases.
+ */
+I_32
+getPlatformIsReadOnly (JNIEnv * env, char *path)
+{
+ return getPlatformAttribute (env, path, FILE_ATTRIBUTE_READONLY);
+}
+
+/**
+ * Answer 1 if the path is write-only, 0 otherwise even in fail cases.
+ */
+I_32
+getPlatformIsWriteOnly (JNIEnv * env, char *path)
+{
+ return 0;
+}
+
+/* Resolve link if it is a symbolic link and put the result in link. */
+int
+platformReadLink (char *link)
+{
+ return FALSE;
+}
+
+jstring
+getCustomTimeZoneInfo (JNIEnv * env, jintArray tzinfo,
+ jbooleanArray isCustomTimeZone)
+{
+ return NULL;
+}
+
+void
+setDefaultServerSocketOptions (JNIEnv * env, hysocket_t socketP)
+{
+}
Added: incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/helpers.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/helpers.h?rev=375249&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/helpers.h (added)
+++ incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/helpers.h Mon Feb 6 03:18:33 2006
@@ -0,0 +1,35 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if !defined(helpers_h)
+#define helpers_h
+int platformReadLink (char *link);
+jbyteArray getPlatformPath (JNIEnv * env, jbyteArray path);
+void setDefaultServerSocketOptions (JNIEnv * env, hysocket_t socketP);
+jint getPlatformDatagramNominalSize (JNIEnv * env, hysocket_t socketP);
+I_32 getPlatformRoots (char *rootStrings);
+jstring getCustomTimeZoneInfo (JNIEnv * env, jintArray tzinfo,
+ jbooleanArray isCustomTimeZone);
+I_32 getPlatformIsHidden (JNIEnv * env, char *path);
+jint getPlatformDatagramMaxSize (JNIEnv * env, hysocket_t socketP);
+char *getCommports (JNIEnv * env);
+I_32 getPlatformIsWriteOnly (JNIEnv * env, char *path);
+I_32 setPlatformFileLength (JNIEnv * env, IDATA descriptor, jlong newLength);
+void platformCanonicalPath (char *pathCopy);
+I_32 getPlatformIsReadOnly (JNIEnv * env, char *path);
+void setPlatformBindOptions (JNIEnv * env, hysocket_t socketP);
+I_32 setPlatformLastModified (JNIEnv * env, char *path, I_64 time);
+I_32 setPlatformReadOnly (JNIEnv * env, char *path);
+#endif /* helpers_h */
Modified: incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/hynio.def
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/hynio.def?rev=375249&r1=375248&r2=375249&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/hynio.def (original)
+++ incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/hynio.def Mon Feb 6 03:18:33 2006
@@ -36,3 +36,44 @@
Java_com_ibm_platform_OSMemory_setFloat
Java_com_ibm_platform_OSMemory_getDouble
Java_com_ibm_platform_OSMemory_setDouble
+ Java_com_ibm_platform_OSNetworkSystem_createSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_createDatagramSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_readSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_writeSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_setNonBlockingImpl
+ Java_com_ibm_platform_OSNetworkSystem_connectSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_connectWithTimeoutSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_connectStreamWithTimeoutSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_socketBindImpl
+ Java_com_ibm_platform_OSNetworkSystem_listenStreamSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_availableStreamImpl
+ Java_com_ibm_platform_OSNetworkSystem_acceptSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_supportsUrgentDataImpl
+ Java_com_ibm_platform_OSNetworkSystem_sendUrgentDataImpl
+ Java_com_ibm_platform_OSNetworkSystem_connectDatagramImpl2
+ Java_com_ibm_platform_OSNetworkSystem_disconnectDatagramImpl
+ Java_com_ibm_platform_OSNetworkSystem_socketBindImpl2
+ Java_com_ibm_platform_OSNetworkSystem_peekDatagramImpl
+ Java_com_ibm_platform_OSNetworkSystem_receiveDatagramImpl
+ Java_com_ibm_platform_OSNetworkSystem_recvConnectedDatagramImpl
+ Java_com_ibm_platform_OSNetworkSystem_sendDatagramImpl
+ Java_com_ibm_platform_OSNetworkSystem_sendConnectedDatagramImpl
+ Java_com_ibm_platform_OSNetworkSystem_createServerStreamSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_createMulticastSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_receiveStreamImpl
+ Java_com_ibm_platform_OSNetworkSystem_sendStreamImpl
+ Java_com_ibm_platform_OSNetworkSystem_shutdownInputImpl
+ Java_com_ibm_platform_OSNetworkSystem_shutdownOutputImpl
+ Java_com_ibm_platform_OSNetworkSystem_acceptStreamSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_createStreamSocketImpl
+ Java_com_ibm_platform_OSNetworkSystem_sendDatagramImpl2
+ Java_com_ibm_platform_OSNetworkSystem_selectImpl
+ Java_com_ibm_platform_OSNetworkSystem_getSocketLocalAddressImpl
+ Java_com_ibm_platform_OSNetworkSystem_getSocketLocalPortImpl
+ Java_com_ibm_platform_OSNetworkSystem_getSocketOptionImpl
+ Java_com_ibm_platform_OSNetworkSystem_setSocketOptionImpl
+ Java_com_ibm_platform_OSNetworkSystem_getSocketFlagsImpl
+ Java_com_ibm_platform_OSNetworkSystem_socketCloseImpl
+ Java_com_ibm_platform_OSNetworkSystem_getHostByAddrImpl
+ Java_com_ibm_platform_OSNetworkSystem_getHostByNameImpl
+ Java_com_ibm_platform_OSNetworkSystem_setInetAddressImpl
Modified: incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/makefile
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/makefile?rev=375249&r1=375248&r2=375249&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/makefile (original)
+++ incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/nio/makefile Mon Feb 6 03:18:33 2006
@@ -30,10 +30,10 @@
LIBPATH=..\lib\# declaration
.c.obj:
- $(cc) -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 $(cflags) -D_MT -D_DLL -MD -D_WINSOCKAPI_ -DWIN32 -Ogityb1 -Gs -GF -Zm400 -Zi -WX /I..\include /I..\nio /I..\zlib /I..\zip /I..\fdlibm $(VMDEBUG) $*.c
+ $(cc) -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 $(cflags) -D_MT -D_DLL -MD -D_WINSOCKAPI_ -DWIN32 -Ogityb1 -Gs -GF -Zm400 -Zi -WX /I..\include /I..\nio /I..\common /I..\zlib /I..\zip /I..\fdlibm $(VMDEBUG) $*.c
.cpp.obj:
- $(cc) -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 $(cflags) -D_MT -D_DLL -MD -D_WINSOCKAPI_ -DWIN32 -Ogityb1 -Gs -GF -Zm400 -Zi -WX /I..\include /I..\nio /I..\zlib /I..\zip /I..\fdlibm $(VMDEBUG) $*.cpp
+ $(cc) -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 $(cflags) -D_MT -D_DLL -MD -D_WINSOCKAPI_ -DWIN32 -Ogityb1 -Gs -GF -Zm400 -Zi -WX /I..\include /I..\nio /I..\common /I..\zlib /I..\zip /I..\fdlibm $(VMDEBUG) $*.cpp
.asm.obj:
ml /c /Cp /W3 /nologo /coff /Zm /Zd /Zi /Gd $(VMASMDEBUG) -DWIN32 $<
@@ -42,13 +42,14 @@
rc -I..\include $<
BUILDFILES1 = nio_copyright.obj OSFileSystemWin32.obj OSFileSystem.obj OSMemoryWin32.obj OSMemory.obj
+BUILDFILES2 = nethelp.obj helpers.obj socket.obj OSNetworkSystem.obj OSNetworkSystemWin32.obj
VIRTFILES1 = hynio.res
SYSLIBFILES1 = ws2_32.lib Iphlpapi.lib
-MDLLIBFILES1 = ..\lib\hysig.lib ..\lib\hycommon.lib
-MDLLIBFILES2 = ..\lib\hyfdlibm.lib ..\lib\hythr.lib ..\lib\vmi.lib
+MDLLIBFILES1 = ..\lib\hycommon.lib ..\lib\hysig.lib ..\lib\hyzip.lib ..\lib\hyzlib.lib
+MDLLIBFILES2 = ..\lib\hypool.lib ..\lib\hyfdlibm.lib ..\lib\hythr.lib ..\lib\vmi.lib
all: \
..\lib\$(LIBNAME).lib $(DLLNAME)
@@ -56,20 +57,20 @@
BUILDLIB: $(LIBPATH)$(LIBNAME).lib
$(LIBPATH)$(LIBNAME).lib:\
- $(BUILDFILES1) $(VIRTFILES1) \
+ $(BUILDFILES1) $(BUILDFILES2) $(VIRTFILES1) \
$(MDLLIBFILES1) $(MDLLIBFILES2)
$(implib) /NOLOGO -subsystem:windows -out:$(LIBPATH)$(LIBNAME).lib -def:$(LIBNAME).def -machine:$(CPU) \
- $(BUILDFILES1) $(VIRTFILES1) \
+ $(BUILDFILES1) $(BUILDFILES2) $(VIRTFILES1) \
$(MDLLIBFILES1) $(MDLLIBFILES2)
$(DLLNAME): $(LIBPATH)$(LIBNAME).lib \
- $(BUILDFILES1) $(VIRTFILES1) \
+ $(BUILDFILES1) $(BUILDFILES2) $(VIRTFILES1) \
$(MDLLIBFILES1) $(MDLLIBFILES2)
link $(VMLINK) /debug /opt:icf /opt:ref /INCREMENTAL:NO /NOLOGO -entry:_DllMainCRTStartup@12 -dll /BASE:0x13300000 -machine:$(CPU) \
/comment:"NIO component native code. (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable." \
-subsystem:windows -out:$(DLLNAME) -map:$(LIBNAME).map \
- $(BUILDFILES1) $(VIRTFILES1) \
+ $(BUILDFILES1) $(BUILDFILES2) $(VIRTFILES1) \
$(MDLLIBFILES1) $(MDLLIBFILES2) $(SYSLIBFILES1) \
kernel32.lib ws2_32.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib $(LIBPATH)$(LIBNAME).exp