You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ge...@apache.org on 2005/12/01 07:04:00 UTC
svn commit: r350181 [170/198] - in
/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core: ./ depends/
depends/files/ depends/jars/ depends/libs/ depends/libs/linux.IA32/
depends/libs/win.IA32/ depends/oss/ depends/oss/linux.IA32/
depends/oss/win....
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/iohelp.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/iohelp.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/iohelp.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/iohelp.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,522 @@
+/* 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.
+ */
+
+#include "iohelp.h"
+#include "jclglob.h"
+
+jfieldID getJavaIoFileDescriptorDescriptorFID (JNIEnv * env);
+
+/**
+ * Throw java.io.IOException with the message provided
+ */
+void
+throwJavaIoIOException (JNIEnv * env, char *message)
+{
+ jclass exceptionClass = (*env)->FindClass(env, "java/io/IOException");
+ if (0 == exceptionClass) {
+ /* Just return if we can't load the exception class. */
+ return;
+ }
+ (*env)->ThrowNew(env, exceptionClass, message);
+}
+
+/**
+ * This will convert all separators to the proper platform separator
+ * and remove duplicates on non POSIX platforms.
+ */
+void
+ioh_convertToPlatform (char *path)
+{
+ char *pathIndex;
+ int length = strlen (path);
+
+ /* Convert all separators to the same type */
+ pathIndex = path;
+ while (*pathIndex != '\0')
+ {
+ if ((*pathIndex == '\\' || *pathIndex == '/')
+ && (*pathIndex != jclSeparator))
+ *pathIndex = jclSeparator;
+ pathIndex++;
+ }
+
+ /* Remove duplicate separators */
+ if (jclSeparator == '/')
+ return; /* Do not do POSIX platforms */
+
+ /* Remove duplicate initial separators */
+ pathIndex = path;
+ while ((*pathIndex != '\0') && (*pathIndex == jclSeparator))
+ {
+ pathIndex++;
+ }
+ if ((pathIndex > path) && (length > (pathIndex - path))
+ && (*(pathIndex + 1) == ':'))
+ {
+ /* For Example '////c:/*' */
+ int newlen = length - (pathIndex - path);
+ memmove (path, pathIndex, newlen);
+ path[newlen] = '\0';
+ }
+ else
+ {
+ if ((pathIndex - path > 3) && (length > (pathIndex - path)))
+ {
+ /* For Example '////serverName/*' */
+ int newlen = length - (pathIndex - path) + 2;
+ memmove (path, pathIndex - 2, newlen);
+ path[newlen] = '\0';
+ }
+ }
+ /* This will have to handle extra \'s but currently doesn't */
+}
+
+/**
+ * Throw java.io.IOException with the "File closed" message
+ * Consolidate all through here so message is consistent.
+ */
+void
+throwJavaIoIOExceptionClosed (JNIEnv * env)
+{
+ throwJavaIoIOException (env, "File closed");
+}
+
+/**
+ * Throw java.lang.IndexOutOfBoundsException
+ */
+void
+throwIndexOutOfBoundsException (JNIEnv * env)
+{
+ jclass exceptionClass = (*env)->FindClass(env, "java/lang/IndexOutOfBoundsException");
+ if (0 == exceptionClass) {
+ /* Just return if we can't load the exception class. */
+ return;
+ }
+ (*env)->ThrowNew(env, exceptionClass, "");
+}
+
+/**
+ * This will write count bytes from buffer starting at offset
+ */
+void
+ioh_writebytesImpl (JNIEnv * env, jobject recv, jbyteArray buffer,
+ jint offset, jint count, IDATA descriptor)
+{
+ I_32 result = 0;
+ jbyte *buf;
+ PORT_ACCESS_FROM_ENV (env);
+ jsize len;
+ char *errorMessage;
+
+/* TODO: ARRAY PINNING */
+#define INTERNAL_MAX 512
+ U_8 internalBuffer[INTERNAL_MAX];
+
+ if (buffer == NULL)
+ {
+ throwNPException (env, "buffer is null");
+ return;
+ }
+
+ len = (*env)->GetArrayLength (env, buffer);
+
+ /**
+ * If offset is negative, or count is negative, or offset+count is greater
+ * than the length of the array b, then an IndexOutOfBoundsException is thrown.
+ * Must test offset > len, or len - offset < count to avoid int overflow caused
+ * by offset + count
+ */
+ if (offset < 0 || count < 0 || offset > len || (len - offset) < count)
+ {
+ throwIndexOutOfBoundsException (env);
+ return;
+ }
+
+ /* If len or count is zero, just return 0 */
+ if (len == 0 || count == 0)
+ return;
+
+ if (descriptor == -1)
+ {
+ throwJavaIoIOExceptionClosed (env);
+ return;
+ }
+ if (count > INTERNAL_MAX)
+ {
+ buf = jclmem_allocate_memory (env, count);
+ }
+ else
+ {
+ buf = internalBuffer;
+ }
+
+ if (buf == NULL)
+ {
+ throwNewOutOfMemoryError (env, "");
+ return;
+ }
+ ((*env)->GetByteArrayRegion (env, buffer, offset, count, buf));
+
+ result = hyfile_write (descriptor, buf, count);
+
+ /* if there is an error, find the error message before calling free in case hymem_free_memory changes the error code */
+ if (result < 0)
+ errorMessage = ioLookupErrorString (env, result);
+
+ if (buf != internalBuffer)
+ {
+ jclmem_free_memory (env, buf);
+ }
+#undef INTERNAL_MAX
+
+ if (result < 0)
+ throwJavaIoIOException (env, errorMessage);
+}
+
+/**
+ * This will write one byte
+ */
+void
+ioh_writecharImpl (JNIEnv * env, jobject recv, jint c, IDATA descriptor)
+{
+ I_32 result = 0;
+ char buf[1];
+ PORT_ACCESS_FROM_ENV (env);
+
+ if (descriptor == -1)
+ {
+ throwJavaIoIOExceptionClosed (env);
+ return;
+ }
+
+ buf[0] = (char) c;
+ result = hyfile_write (descriptor, buf, 1);
+
+ if (result < 0)
+ throwJavaIoIOException (env, ioLookupErrorString (env, result));
+}
+
+/**
+ * This will read a single character from the descriptor
+ */
+jint
+ioh_readcharImpl (JNIEnv * env, jobject recv, IDATA descriptor)
+{
+ I_32 result;
+ char buf[1];
+ PORT_ACCESS_FROM_ENV (env);
+
+ if (descriptor == -1)
+ {
+ throwJavaIoIOExceptionClosed (env);
+ return 0;
+ }
+
+ if (descriptor == 0)
+ {
+ result = hytty_get_chars (buf, 1);
+ }
+ else
+ {
+ result = hyfile_read (descriptor, buf, 1);
+ }
+
+ if (result <= 0)
+ return -1;
+
+ return (jint) buf[0] & 0xFF;
+}
+
+/**
+ * This will read a up to count bytes into buffer starting at offset
+ */
+jint
+ioh_readbytesImpl (JNIEnv * env, jobject recv, jbyteArray buffer, jint offset,
+ jint count, IDATA descriptor)
+{
+ I_32 result;
+ jsize len;
+ jbyte *buf;
+
+/* TODO: ARRAY PINNING */
+#define INTERNAL_MAX 2048
+ U_8 internalBuffer[INTERNAL_MAX];
+
+ PORT_ACCESS_FROM_ENV (env);
+
+ if (buffer == NULL)
+ {
+ throwNPException (env, "buffer is null");
+ return 0;
+ }
+
+ len = (*env)->GetArrayLength (env, buffer);
+ /* Throw IndexOutOfBoundsException according to spec. * Must test offset > len, or len - offset < count to avoid *
+ int overflow caused by offset + count */
+ if (offset < 0 || count < 0 || offset > len || (len - offset) < count)
+ {
+ throwIndexOutOfBoundsException (env);
+ return 0;
+ }
+ /* If len is 0, simply return 0 (even if it is closed) */
+ if (len == 0 || count == 0)
+ return 0;
+
+ if (descriptor == -1)
+ {
+ throwJavaIoIOExceptionClosed (env);
+ return 0;
+ }
+ if (len >= INTERNAL_MAX)
+ {
+ buf = jclmem_allocate_memory (env, len);
+ }
+ else
+ {
+ buf = internalBuffer;
+ }
+
+ if (buf == NULL)
+ {
+ throwNewOutOfMemoryError (env, "");
+ return 0;
+ }
+ /* Must FREE buffer before returning */
+
+ if (descriptor == 0)
+ {
+ if ((result = hytty_get_chars (buf, count)) == 0)
+ result = -1;
+ }
+ else
+ {
+ result = hyfile_read (descriptor, buf, count);
+ }
+ if (result > 0)
+ (*env)->SetByteArrayRegion (env, buffer, offset, result, buf);
+
+ if (buf != internalBuffer)
+ {
+ jclmem_free_memory (env, buf);
+ }
+#undef INTERNAL_MAX
+
+ return result;
+}
+
+/**
+ * Throw java.lang.NullPointerException with the message provided
+ * Note: This is not named throwNullPointerException because is conflicts
+ * with a VM function of that same name and this causes problems on
+ * some platforms.
+ */
+void
+throwNPException (JNIEnv * env, char *message)
+{
+ jclass exceptionClass = (*env)->FindClass(env, "java/lang/NullPointerException");
+ if (0 == exceptionClass) {
+ /* Just return if we can't load the exception class. */
+ return;
+ }
+ (*env)->ThrowNew(env, exceptionClass, message);
+}
+
+/**
+ * This will return the number of chars left in the file
+ */
+jint
+new_ioh_available (JNIEnv * env, jobject recv, jfieldID fdFID)
+{
+ jobject fd;
+ I_64 currentPosition, endOfFile;
+ IDATA descriptor;
+ PORT_ACCESS_FROM_ENV (env);
+
+ /* fetch the fd field from the object */
+ fd = (*env)->GetObjectField (env, recv, fdFID);
+
+ /* dereference the C pointer from the wrapper object */
+ descriptor = (IDATA) getJavaIoFileDescriptorContentsAsPointer (env, fd);
+ if (descriptor == -1)
+ {
+ throwJavaIoIOExceptionClosed (env);
+ return -1;
+ }
+
+ /**
+ * If the descriptor represents StdIn, call the hytty port library.
+ */
+ if (descriptor == 0)
+ {
+ return hytty_available ();
+ }
+
+ currentPosition = hyfile_seek (descriptor, 0, HySeekCur);
+ endOfFile = hyfile_seek (descriptor, 0, HySeekEnd);
+ hyfile_seek (descriptor, currentPosition, HySeekSet);
+ return (jint) (endOfFile - currentPosition);
+}
+
+/**
+ * This will close a file descriptor
+ */
+void
+new_ioh_close (JNIEnv * env, jobject recv, jfieldID fdFID)
+{
+ jobject fd;
+ jfieldID descriptorFID;
+ IDATA descriptor;
+ PORT_ACCESS_FROM_ENV (env);
+
+ descriptorFID = getJavaIoFileDescriptorDescriptorFID (env);
+ if (NULL == descriptorFID)
+ {
+ return;
+ }
+
+ /* fetch the fd field from the object */
+ fd = (*env)->GetObjectField (env, recv, fdFID);
+
+ /* dereference the C pointer from the wrapper object */
+ descriptor = (IDATA) getJavaIoFileDescriptorContentsAsPointer (env, fd);
+
+ /* Check for closed file, in, out, and err */
+ if (descriptor >= -1 && descriptor <= 2)
+ {
+ return;
+ }
+
+ hyfile_close (descriptor);
+ setJavaIoFileDescriptorContentsAsPointer (env, fd, (void *) -1);
+
+ return;
+}
+
+/**
+ * This will retrieve the 'descriptor' field value from a java.io.FileDescriptor
+ */
+void *
+getJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd)
+{
+ jfieldID descriptorFID = getJavaIoFileDescriptorDescriptorFID (env);
+ if (NULL == descriptorFID)
+ {
+ return (void *) -1;
+ }
+ return (void *) ((*env)->GetLongField (env, fd, descriptorFID));
+}
+
+/**
+ * This will set the 'descriptor' field value in the java.io.FileDescriptor
+ * @fd to the value @desc
+ */
+void
+setJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd,
+ void *value)
+{
+ jfieldID fid = getJavaIoFileDescriptorDescriptorFID (env);
+ if (NULL != fid)
+ {
+ (*env)->SetLongField (env, fd, fid, (jlong) value);
+ }
+}
+
+/**
+ * Throw java.lang.OutOfMemoryError
+ */
+void
+throwNewOutOfMemoryError (JNIEnv * env, char *message)
+{
+ jclass exceptionClass = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
+ if (0 == exceptionClass) {
+ /* Just return if we can't load the exception class. */
+ return;
+ }
+ (*env)->ThrowNew(env, exceptionClass, message);
+}
+
+/**
+ * Answer the errorString corresponding to the errorNumber, if available.
+ * This function will answer a default error string, if the errorNumber is not
+ * recognized.
+ *
+ * This function will have to be reworked to handle internationalization properly, removing
+ * the explicit strings.
+ *
+ * @param anErrorNum the error code to resolve to a human readable string
+ *
+ * @return a human readable error string
+ */
+char *
+ioLookupErrorString (JNIEnv * env, I_32 anErrorNum)
+{
+ PORT_ACCESS_FROM_ENV (env);
+ switch (anErrorNum)
+ {
+ case HYPORT_ERROR_FILE_NOTFOUND:
+ return "File not found";
+ case HYPORT_ERROR_FILE_NOPERMISSION:
+ return "Lacking proper permissions to perform the operation";
+ case HYPORT_ERROR_FILE_DISKFULL:
+ return "Disk is full";
+ case HYPORT_ERROR_FILE_NOENT:
+ return "A component of the path name does not exist";
+ case HYPORT_ERROR_FILE_NOTDIR:
+ return "A component of the path name is not a directory";
+ case HYPORT_ERROR_FILE_BADF:
+ return "File descriptor invalid";
+ case HYPORT_ERROR_FILE_EXIST:
+ return "File already exists";
+ case HYPORT_ERROR_FILE_INVAL:
+ return "A parameter is invalid";
+ case HYPORT_ERROR_FILE_LOOP:
+ return "Followed too many symbolic links, possibly stuck in loop";
+ case HYPORT_ERROR_FILE_NAMETOOLONG:
+ return "Filename exceeds maximum length";
+ default:
+ return (char *) hyfile_error_message ();
+ }
+}
+
+/**
+ * This will retrieve the 'descriptor' field value from a java.io.FileDescriptor
+ */
+jfieldID
+getJavaIoFileDescriptorDescriptorFID (JNIEnv * env)
+{
+ jclass descriptorCLS;
+ jfieldID descriptorFID;
+
+ descriptorFID = JCL_CACHE_GET (env, FID_java_io_FileDescriptor_descriptor);
+ if (NULL != descriptorFID)
+ {
+ return descriptorFID;
+ }
+
+ descriptorCLS = (*env)->FindClass (env, "java/io/FileDescriptor");
+ if (NULL == descriptorCLS)
+ {
+ return NULL;
+ }
+
+ descriptorFID = (*env)->GetFieldID (env, descriptorCLS, "descriptor", "J");
+ if (NULL == descriptorFID)
+ {
+ return NULL;
+ }
+ JCL_CACHE_SET (env, FID_java_io_FileDescriptor_descriptor, descriptorFID);
+
+ return descriptorFID;
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/iohelp.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/iohelp.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/iohelp.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/iohelp.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* 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(iohelp_h)
+#define iohelp_h
+
+#include <string.h>
+#include "jcl.h"
+
+/* DIR_SEPARATOR is defined in hycomp.h */
+#define jclSeparator DIR_SEPARATOR
+
+void *getJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd);
+void throwNewOutOfMemoryError (JNIEnv * env, char *message);
+jint ioh_readcharImpl (JNIEnv * env, jobject recv, IDATA descriptor);
+void throwJavaIoIOException (JNIEnv * env, char *message);
+void throwJavaIoIOExceptionClosed (JNIEnv * env);
+void ioh_convertToPlatform (char *path);
+jint new_ioh_available (JNIEnv * env, jobject recv, jfieldID fdFID);
+void throwNPException (JNIEnv * env, char *message);
+void setJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd,
+ void *value);
+void ioh_writebytesImpl (JNIEnv * env, jobject recv, jbyteArray buffer,
+ jint offset, jint count, IDATA descriptor);
+char *ioLookupErrorString (JNIEnv * env, I_32 anErrorNum);
+void ioh_writecharImpl (JNIEnv * env, jobject recv, jint c, IDATA descriptor);
+jint ioh_readbytesImpl (JNIEnv * env, jobject recv, jbyteArray buffer,
+ jint offset, jint count, IDATA descriptor);
+void new_ioh_close (JNIEnv * env, jobject recv, jfieldID fdFID);
+void throwIndexOutOfBoundsException (JNIEnv * env);
+
+#endif /* iohelp_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/jcl.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/jcl.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/jcl.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/jcl.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,22 @@
+/* Copyright 2004, 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(jcl_h)
+#define jcl_h
+
+#define USING_VMI
+#include "vmi.h"
+
+#endif /* jcl_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/jclglob.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/jclglob.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/jclglob.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/jclglob.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,36 @@
+/* Copyright 2004, 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(jclglob_h)
+#define jclglob_h
+
+#include "jcl.h"
+
+extern void *Lib_JCL_ID_CACHE;
+
+#define JCL_ID_CACHE Lib_JCL_ID_CACHE
+
+typedef struct LibJniIDCache
+{
+ jfieldID FID_java_io_FileDescriptor_descriptor;
+ int attachCount;
+} LibJniIDCache;
+
+#define JniIDCache LibJniIDCache
+
+/* Now that the module-specific defines are in place, include the shared file */
+#include "libglob.h"
+
+#endif /* jclglob_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/libglob.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/libglob.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/libglob.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/libglob.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,109 @@
+/* Copyright 2004, 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.
+ */
+
+/**
+ * @file
+ * @ingroup HarmonyNatives
+ * @brief Common helpers initialization API.
+ */
+
+#include "jcl.h"
+#include "jclglob.h"
+
+static UDATA keyInitCount = 0;
+
+void *JCL_ID_CACHE = NULL;
+
+static void freeReferences (JNIEnv * env);
+
+/**
+ * A DLL is attaching to the common code, do any initialization required.
+ * This may be called more than once.
+ */
+jint JNICALL
+ClearLibAttach (JNIEnv * env)
+{
+ void *keyInitCountPtr = GLOBAL_DATA (keyInitCount);
+ void **jclIdCache = GLOBAL_DATA (JCL_ID_CACHE);
+ JniIDCache *idCache;
+
+ PORT_ACCESS_FROM_ENV (env);
+
+ if (HY_VMLS_FNTBL (env)->
+ HYVMLSAllocKeys (env, keyInitCountPtr, jclIdCache, NULL))
+ {
+ goto fail;
+ }
+
+ idCache = (JniIDCache *) HY_VMLS_GET (env, *jclIdCache);
+ if (idCache == NULL)
+ {
+ idCache = (JniIDCache *) hymem_allocate_memory (sizeof (JniIDCache));
+ if (!idCache)
+ goto fail2;
+
+ memset (idCache, 0, sizeof (JniIDCache));
+ HY_VMLS_SET (env, *jclIdCache, idCache);
+ }
+
+ /* Increment the reference count. */
+ idCache->attachCount++;
+
+ return JNI_OK;
+
+fail2:
+ HY_VMLS_FNTBL (env)->HYVMLSFreeKeys (env, keyInitCountPtr, jclIdCache, NULL);
+fail:
+ return JNI_ERR;
+}
+
+/**
+ * A DLL is detaching from the common code, do any clean up required.
+ * This may be called more than once!!
+ */
+void JNICALL
+ClearLibDetach (JNIEnv * env)
+{
+ void *keyInitCountPtr = GLOBAL_DATA (keyInitCount);
+ void **jclIdCache = GLOBAL_DATA (JCL_ID_CACHE);
+ JniIDCache *idCache;
+
+ PORT_ACCESS_FROM_ENV (env);
+
+ idCache = (JniIDCache *) HY_VMLS_GET (env, *jclIdCache);
+ if (idCache)
+ {
+ /* Decrement the reference count and free if necessary. */
+ if (--idCache->attachCount < 1)
+ {
+ freeReferences (env);
+
+ /* Free VMLS keys */
+ idCache = (JniIDCache *) HY_VMLS_GET (env, *jclIdCache);
+ HY_VMLS_FNTBL (env)->HYVMLSFreeKeys (env, keyInitCountPtr,
+ jclIdCache, NULL);
+ hymem_free_memory (idCache);
+ }
+ }
+}
+
+/**
+ * @internal
+ */
+static void
+freeReferences (JNIEnv * env)
+{
+ /* empty */
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/libglob.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/libglob.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/libglob.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/libglob.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,37 @@
+/* Copyright 2004, 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(libglob_h)
+#define libglob_h
+
+#include "jcl.h"
+#include "hyvmls.h"
+
+#define JCL_CACHE_GET(env,x) \
+ (((JniIDCache*) HY_VMLS_GET((env), JCL_ID_CACHE))->x)
+
+#define JCL_CACHE_SET(env,x,v) \
+ (((JniIDCache*) HY_VMLS_GET((env), JCL_ID_CACHE))->x = (v))
+
+#define jclmem_allocate_memory(env, byteAmount) \
+ hymem_allocate_memory(byteAmount)
+
+#define jclmem_free_memory(env, buf) \
+ hymem_free_memory(buf)
+
+jint JNICALL ClearLibAttach (JNIEnv * env);
+void JNICALL ClearLibDetach (JNIEnv * env);
+
+#endif /* libglob_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/lock386.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/lock386.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/lock386.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/lock386.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,51 @@
+/* Copyright 1991, 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.
+ */
+
+#include <windows.h>
+#include "hycomp.h"
+extern U_8 *lockFixupBegin;
+extern U_8 *lockFixupEnd;
+void
+fixupLocks386 (void)
+{
+
+ SYSTEM_INFO aSysInfo;
+
+ GetSystemInfo (&aSysInfo);
+ if (aSysInfo.dwNumberOfProcessors == 1)
+ {
+ U_8 **fixup;
+ DWORD oldProtect, ignored;
+ U_8 *min = (U_8 *) - 1, *max = NULL;
+
+ for (fixup = &lockFixupBegin; fixup < &lockFixupEnd; fixup++)
+ {
+ if (*fixup < min)
+ min = *fixup;
+ if (*fixup > max)
+ max = *fixup;
+ }
+ if (VirtualProtect
+ (min, max - min, PAGE_EXECUTE_READWRITE, &oldProtect))
+ {
+ for (fixup = &lockFixupBegin; fixup < &lockFixupEnd; fixup++)
+ {
+ **fixup = 0x90; /* 0x90 == nop */
+ }
+ VirtualProtect (min, max - min, oldProtect, &ignored);
+ }
+
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/locklbl.asm
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/locklbl.asm?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/locklbl.asm (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/locklbl.asm Wed Nov 30 21:29:27 2005
@@ -0,0 +1,29 @@
+; Copyright 1991, 2004 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.
+
+.386p
+assume cs:flat,ds:flat,ss:flat
+
+public lockFixupEnd
+public lockFixupBegin
+
+CONST$_LOCKFIXUPS_A SEGMENT DWORD USE32 PUBLIC 'CONST'
+lockFixupBegin:
+CONST$_LOCKFIXUPS_A ends
+
+CONST$_LOCKFIXUPS_Z SEGMENT DWORD USE32 PUBLIC 'CONST'
+lockFixupEnd:
+CONST$_LOCKFIXUPS_Z ends
+
+end
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/makefile
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/makefile?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/makefile (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/makefile Wed Nov 30 21:29:27 2005
@@ -0,0 +1,53 @@
+# 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.
+
+#
+# Makefile for module 'common'
+#
+
+APPVER=4.0
+TARGETOS=WIN95
+_WIN32_IE=0x0500
+SEHMAP = TRUE
+!include <win32.mak>
+
+LIBNAME=hycommon.lib# declaration
+
+LIBPATH=..\lib\# declaration
+
+BUILDFILES1 = libglob.obj iohelp.obj locklbl.obj lock386.obj utf8decode.obj utf8encode.obj
+
+SYSLIBFILES1 = ws2_32.lib Iphlpapi.lib
+
+MDLLIBFILES1 = ..\lib\hysig.lib ..\lib\hypool.lib
+MDLLIBFILES2 = ..\lib\hyfdlibm.lib ..\lib\hythr.lib ..\lib\vmi.lib
+
+.c.obj:
+ $(cc) -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 $(cflags) -D_MT -D_DLL -MD -D_WINSOCKAPI_ -DWIN32 -Ogityb1 -Gs -GF -Zm400 -WX -Zi -Fd$(LIBPATH)hycommon.pdb /I..\include /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 -WX -Zi -Fd$(LIBPATH)hycommon.pdb /I..\include /I..\common /I..\zlib /I..\zip /I..\fdlibm $(VMDEBUG) $*.cpp
+
+.asm.obj:
+ ml /c /Cp /W3 /nologo /coff /Zm /Zd /Zi /Gd $(VMASMDEBUG) -DWIN32 $<
+
+all: $(LIBPATH)$(LIBNAME)
+
+$(LIBPATH)$(LIBNAME): $(BUILDFILES1)
+ $(implib) /NOLOGO -out:$(LIBPATH)$(LIBNAME) $(BUILDFILES1)
+
+clean:
+ -del *.obj
+ -del ..\lib\$(LIBNAME)
+ -del ..\lib\hycommon.pdb
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/utf8decode.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/utf8decode.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/utf8decode.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/utf8decode.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,134 @@
+/* Copyright 1991, 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.
+ */
+
+#include "hycomp.h"
+
+/* Prototypes */
+U_32 decodeUTF8Char (const U_8 * input, U_16 * result);
+U_32 decodeUTF8CharN (const U_8 * input, U_16 * result, U_32 bytesRemaining);
+
+/**
+ * Decode the UTF8 character.
+ *
+ * Decode the input UTF8 character and stores it into result.
+ *
+ * @param[in] input The UTF8 character
+ * @param[in,out] result buffer for unicode characters
+ *
+ * @return The number of UTF8 characters consumed (1,2,3) on success, 0 on failure
+ */
+U_32
+decodeUTF8Char (const U_8 * input, U_16 * result)
+{
+ /* a UTF8 character can't require more than 3 bytes */
+ return decodeUTF8CharN (input, result, 3);
+}
+
+/**
+ * Decode the UTF8 character.
+ *
+ * Decode the input UTF8 character and stores it into result.
+ *
+ * @param[in] input The UTF8 character
+ * @param[in,out] result buffer for unicode characters
+ * @param[in] bytesRemaining number of bytes remaining in input
+ *
+ * @return The number of UTF8 characters consumed (1,2,3) on success, 0 on failure
+ * @note Don't read more than bytesRemaining characters.
+ * @note If morecharacters are required to fully decode the character, return failure
+ */
+U_32
+decodeUTF8CharN (const U_8 * input, U_16 * result, U_32 bytesRemaining)
+{
+ U_8 c;
+ const U_8 *cursor = input;
+
+ if (bytesRemaining < 1)
+ {
+ return 0;
+ }
+
+ c = *cursor++;
+ if (c == 0x00)
+ {
+ /* illegal NUL encoding */
+
+ return 0;
+
+ }
+ else if ((c & 0x80) == 0x00)
+ {
+ /* one byte encoding */
+
+ *result = (U_16) c;
+ return 1;
+
+ }
+ else if ((c & 0xE0) == 0xC0)
+ {
+ /* two byte encoding */
+ U_16 unicodeC;
+
+ if (bytesRemaining < 2)
+ {
+ return 0;
+ }
+ unicodeC = ((U_16) c & 0x1F) << 6;
+
+ c = *cursor++;
+ unicodeC += (U_16) c & 0x3F;
+ if ((c & 0xC0) != 0x80)
+ {
+ return 0;
+ }
+
+ *result = unicodeC;
+ return 2;
+
+ }
+ else if ((c & 0xF0) == 0xE0)
+ {
+ /* three byte encoding */
+ U_16 unicodeC;
+
+ if (bytesRemaining < 3)
+ {
+ return 0;
+ }
+ unicodeC = ((U_16) c & 0x0F) << 12;
+
+ c = *cursor++;
+ unicodeC += ((U_16) c & 0x3F) << 6;
+ if ((c & 0xC0) != 0x80)
+ {
+ return 0;
+ }
+
+ c = *cursor++;
+ unicodeC += (U_16) c & 0x3F;
+ if ((c & 0xC0) != 0x80)
+ {
+ return 0;
+ }
+
+ *result = unicodeC;
+ return 3;
+ }
+ else
+ {
+ /* illegal encoding (i.e. would decode to a char > 0xFFFF) */
+ return 0;
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/utf8encode.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/utf8encode.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/utf8encode.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/common/utf8encode.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,102 @@
+/* Copyright 1991, 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.
+ */
+
+#include "hycomp.h"
+
+/* Prototypes */
+U_32 encodeUTF8CharN (UDATA unicode, U_8 * result, U_32 bytesRemaining);
+U_32 encodeUTF8Char (UDATA unicode, U_8 * result);
+
+/**
+ * Encode the Unicode character.
+ *
+ * Encodes the input Unicode character and stores it into result.
+ *
+ * @param[in] unicode The unicode character
+ * @param[in,out] result buffer for UTF8 character
+ * @param[in] bytesRemaining available space in result buffer
+ *
+ * @return Size of encoding (1,2,3) on success, 0 on failure
+ *
+ * @note Don't write more than bytesRemaining characters
+ * @note If result is NULL then bytesRemaining is ignored and the number
+ * of characters required to encode the unicode character is returned.
+ */
+U_32
+encodeUTF8CharN (UDATA unicode, U_8 * result, U_32 bytesRemaining)
+{
+ if (unicode >= 0x01 && unicode <= 0x7f)
+ {
+ if (result)
+ {
+ if (bytesRemaining < 1)
+ {
+ return 0;
+ }
+ *result = (U_8) unicode;
+ }
+ return 1;
+ }
+ else if (unicode == 0 || (unicode >= 0x80 && unicode <= 0x7ff))
+ {
+ if (result)
+ {
+ if (bytesRemaining < 2)
+ {
+ return 0;
+ }
+ *result++ = (U_8) (((unicode >> 6) & 0x1f) | 0xc0);
+ *result = (U_8) ((unicode & 0x3f) | 0x80);
+ }
+ return 2;
+ }
+ else if (unicode >= 0x800 && unicode <= 0xffff)
+ {
+ if (result)
+ {
+ if (bytesRemaining < 3)
+ {
+ return 0;
+ }
+ *result++ = (U_8) (((unicode >> 12) & 0x0f) | 0xe0);
+ *result++ = (U_8) (((unicode >> 6) & 0x3f) | 0x80);
+ *result = (U_8) ((unicode & 0x3f) | 0x80);
+ }
+ return 3;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/**
+ * Encode the Unicode character.
+ *
+ * Encodes the input Unicode character and stores it into result.
+ *
+ * @param[in] unicode The unicode character
+ * @param[in,out] result buffer for UTF8 character
+ *
+ * @return Size of encoding (1,2,3) on success, 0 on failure
+ *
+ * @note If result is NULL then the number of characters required to
+ * encode the character is returned.
+ */
+U_32
+encodeUTF8Char (UDATA unicode, U_8 * result)
+{
+ return encodeUTF8CharN (unicode, result, 3);
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/fdlibm.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/fdlibm.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/fdlibm.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/fdlibm.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,228 @@
+
+/* @(#)fdlibm.h 1.5 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include "hymagic.h"
+
+#ifdef __NEWVALID /* special setup for Sun test regime */
+#if defined(i386) || defined(i486) || \
+ defined(intel) || defined(x86) || defined(i86pc)
+#define HY_FDLIBM_LITTLE_ENDIAN
+#endif
+#endif
+
+#ifdef HY_FDLIBM_LITTLE_ENDIAN
+#define __HI(x) *(1+(int*)&x)
+#define __LO(x) *(int*)&x
+#define __HIp(x) *(1+(int*)x)
+#define __LOp(x) *(int*)x
+#else
+#define __HI(x) *(int*)&x
+#define __LO(x) *(1+(int*)&x)
+#define __HIp(x) *(int*)x
+#define __LOp(x) *(1+(int*)x)
+#endif
+
+#if defined(__STDC__) || defined(OS2)
+#define __P(p) p
+#else
+#define __P(p) ()
+#endif
+
+/*
+ * ANSI/POSIX
+ */
+
+extern int signgam;
+
+#define MAXFLOAT ((float)3.40282346638528860e+38)
+
+enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
+
+/* Local Change -- insist that only the IEEE version is built. See also s_lib_version.c */
+#ifndef HY_FIXED_VERSION
+
+#define _LIB_VERSION_TYPE enum fdversion
+#define _LIB_VERSION _fdlib_version
+
+/* if global variable _LIB_VERSION is not desirable, one may
+ * change the following to be a constant by:
+ * #define _LIB_VERSION_TYPE const enum version
+ * In that case, after one initializes the value _LIB_VERSION (see
+ * s_lib_version.c) during compile time, it cannot be modified
+ * in the middle of a program
+ */
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+
+#else
+#define _LIB_VERSION HY_FIXED_VERSION
+#endif
+
+#define _IEEE_ fdlibm_ieee
+#define _SVID_ fdlibm_svid
+#define _XOPEN_ fdlibm_xopen
+#define _POSIX_ fdlibm_posix
+
+struct exception {
+ int type;
+ char *name;
+ double arg1;
+ double arg2;
+ double retval;
+};
+
+#define HUGE MAXFLOAT
+
+/*
+ * set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
+ * (one may replace the following line by "#include <values.h>")
+ */
+
+#define X_TLOSS 1.41484755040568800000e+16
+
+#define DOMAIN 1
+#define SING 2
+#define OVERFLOW 3
+#define UNDERFLOW 4
+#define TLOSS 5
+#define PLOSS 6
+
+/*
+ * ANSI/POSIX
+ */
+extern double acos __P((double));
+extern double asin __P((double));
+extern double atan __P((double));
+extern double atan2 __P((double, double));
+extern double cos __P((double));
+extern double sin __P((double));
+extern double tan __P((double));
+
+extern double cosh __P((double));
+extern double sinh __P((double));
+extern double tanh __P((double));
+
+extern double exp __P((double));
+extern double frexp __P((double, int *));
+extern double ldexp __P((double, int));
+extern double log __P((double));
+extern double log10 __P((double));
+extern double modf __P((double, double *));
+
+extern double pow __P((double, double));
+extern double sqrt __P((double));
+
+extern double ceil __P((double));
+extern double fabs __P((double));
+extern double floor __P((double));
+extern double fmod __P((double, double));
+
+extern double erf __P((double));
+extern double erfc __P((double));
+extern double gamma __P((double));
+extern double hypot __P((double, double));
+extern int isnan __P((double));
+extern int finite __P((double));
+extern double j0 __P((double));
+extern double j1 __P((double));
+extern double jn __P((int, double));
+extern double lgamma __P((double));
+extern double y0 __P((double));
+extern double y1 __P((double));
+extern double yn __P((int, double));
+
+extern double acosh __P((double));
+extern double asinh __P((double));
+extern double atanh __P((double));
+extern double cbrt __P((double));
+extern double logb __P((double));
+extern double nextafter __P((double, double));
+extern double remainder __P((double, double));
+#ifdef _SCALB_INT
+extern double scalb __P((double, int));
+#else
+extern double scalb __P((double, double));
+#endif
+
+extern int matherr __P((struct exception *));
+
+/*
+ * IEEE Test Vector
+ */
+extern double significand __P((double));
+
+/*
+ * Functions callable from C, intended to support IEEE arithmetic.
+ */
+extern double copysign __P((double, double));
+extern int ilogb __P((double));
+extern double rint __P((double));
+extern double scalbn __P((double, int));
+
+/*
+ * BSD math library entry points
+ */
+extern double expm1 __P((double));
+extern double log1p __P((double));
+
+/*
+ * Reentrant version of gamma & lgamma; passes signgam back by reference
+ * as the second argument; user must allocate space for signgam.
+ */
+#ifdef _REENTRANT
+extern double gamma_r __P((double, int *));
+extern double lgamma_r __P((double, int *));
+#endif /* _REENTRANT */
+
+/* ieee style elementary functions */
+extern double __ieee754_sqrt __P((double));
+extern double __ieee754_acos __P((double));
+extern double __ieee754_acosh __P((double));
+extern double __ieee754_log __P((double));
+extern double __ieee754_atanh __P((double));
+extern double __ieee754_asin __P((double));
+extern double __ieee754_atan2 __P((double,double));
+extern double __ieee754_exp __P((double));
+extern double __ieee754_cosh __P((double));
+extern double __ieee754_fmod __P((double,double));
+extern double __ieee754_pow __P((double,double));
+extern double __ieee754_lgamma_r __P((double,int *));
+extern double __ieee754_gamma_r __P((double,int *));
+extern double __ieee754_lgamma __P((double));
+extern double __ieee754_gamma __P((double));
+extern double __ieee754_log10 __P((double));
+extern double __ieee754_sinh __P((double));
+extern double __ieee754_hypot __P((double,double));
+extern double __ieee754_j0 __P((double));
+extern double __ieee754_j1 __P((double));
+extern double __ieee754_y0 __P((double));
+extern double __ieee754_y1 __P((double));
+extern double __ieee754_jn __P((int,double));
+extern double __ieee754_yn __P((int,double));
+extern double __ieee754_remainder __P((double,double));
+extern int __ieee754_rem_pio2 __P((double,double*));
+#ifdef _SCALB_INT
+extern double __ieee754_scalb __P((double,int));
+#else
+extern double __ieee754_scalb __P((double,double));
+#endif
+
+/* fdlibm kernel function */
+extern double __kernel_standard __P((double,double,int));
+extern double __kernel_sin __P((double,double,int));
+extern double __kernel_cos __P((double,double));
+extern double __kernel_tan __P((double,double,int));
+#ifdef OS2
+extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,int*));
+#else
+extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));
+#endif
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/hymagic.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/hymagic.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/hymagic.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/hymagic.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,100 @@
+/* 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.
+ */
+
+/*
+ Define platform endianness
+ */
+
+#define HYVM_ENV_LITTLE_ENDIAN
+
+/* Insist that only the IEEE version is built. See also fdlibm.h */
+#define HY_FIXED_VERSION fdlibm_ieee
+
+/* FDLIBM only uses endian for word order, not byte order.
+ If this platform does not use the standard word order for doubles
+ then pretend we are the other endian.
+*/
+#ifdef HYVM_ENV_LITTLE_ENDIAN
+#ifdef HY_PLATFORM_DOUBLE_ORDER
+#define HY_FDLIBM_LITTLE_ENDIAN
+#endif
+#else
+#ifndef HY_PLATFORM_DOUBLE_ORDER
+#define HY_FDLIBM_LITTLE_ENDIAN
+#endif
+#endif
+
+
+#define acos fdlibm_acos
+#define asin fdlibm_asin
+#define atan fdlibm_atan
+#define atan2 fdlibm_atan2
+#define cos fdlibm_cos
+#define sin fdlibm_sin
+#define tan fdlibm_tan
+
+#define cosh fdlibm_cosh
+#define sinh fdlibm_sinh
+#define tanh fdlibm_tanh
+
+#define exp fdlibm_exp
+#define frexp fdlibm_frexp
+#define ldexp fdlibm_ldexp
+#define log fdlibm_log
+#define log10 fdlibm_log10
+#define modf fdlibm_modf
+
+#define pow fdlibm_pow
+#define sqrt fdlibm_sqrt
+
+#define ceil fdlibm_ceil
+#define fabs fdlibm_fabs
+#define floor fdlibm_floor
+#define fmod fdlibm_fmod
+
+#define erf fdlibm_erf
+#define erfc fdlibm_erfc
+#define gamma fdlibm_gamma
+#define hypot fdlibm_hypot
+#define isnan fdlibm_isnan
+#define finite fdlibm_finite
+#define j0 fdlibm_j0
+#define j1 fdlibm_j1
+#define jn fdlibm_jn
+#define lgamma fdlibm_lgamma
+#define y0 fdlibm_y0
+#define y1 fdlibm_y1
+#define yn fdlibm_yn
+
+#define acosh fdlibm_acosh
+#define asinh fdlibm_asinh
+#define atanh fdlibm_atanh
+#define cbrt fdlibm_cbrt
+#define logb fdlibm_logb
+#define nextafter fdlibm_nextafter
+#define remainder fdlibm_remainder
+#define scalb fdlibm_scalb
+
+#define matherr fdlibm_matherr
+#define significand fdlibm_significand
+#define copysign fdlibm_copysign
+#define ilogb fdlibm_ilogb
+#define rint fdlibm_rint
+#define scalbn fdlibm_scalbn
+#define expm1 fdlibm_expm1
+#define log1p fdlibm_log1p
+#define gamma_r fdlibm_gamma_r
+#define lgamma_r fdlibm_lgamma_r
+
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/makefile
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/makefile?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/makefile (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/makefile Wed Nov 30 21:29:27 2005
@@ -0,0 +1,84 @@
+# 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.
+
+#
+# Makefile for module 'fdlibm'
+#
+
+APPVER=4.0
+TARGETOS=WIN95
+SEHMAP=TRUE
+!include <win32.mak>
+
+LIBNAME=hyfdlibm.lib# declaration
+
+LIBPATH=..\lib\# declaration
+
+BUILDFILES1 = e_acos.obj e_acosh.obj e_asin.obj e_atan2.obj e_atanh.obj
+BUILDFILES2 = e_cosh.obj e_exp.obj e_fmod.obj e_gamma.obj e_gamma_r.obj
+BUILDFILES3 = e_hypot.obj e_j0.obj e_j1.obj e_jn.obj e_lgamma.obj
+BUILDFILES4 = e_lgamma_r.obj e_log.obj e_log10.obj e_pow.obj e_rem_pio2.obj
+BUILDFILES5 = e_remainder.obj e_scalb.obj e_sinh.obj e_sqrt.obj k_cos.obj
+BUILDFILES6 = k_rem_pio2.obj k_sin.obj k_standard.obj k_tan.obj s_asinh.obj
+BUILDFILES7 = s_atan.obj s_cbrt.obj s_ceil.obj s_copysign.obj s_cos.obj
+BUILDFILES8 = s_erf.obj s_expm1.obj s_fabs.obj s_finite.obj s_floor.obj
+BUILDFILES9 = s_frexp.obj s_ilogb.obj s_isnan.obj s_ldexp.obj s_lib_version.obj
+BUILDFILES10 = s_log1p.obj s_logb.obj s_matherr.obj s_modf.obj s_nextafter.obj
+BUILDFILES11 = s_rint.obj s_scalbn.obj s_signgam.obj s_significand.obj s_sin.obj
+BUILDFILES12 = s_tan.obj s_tanh.obj w_acos.obj w_acosh.obj w_asin.obj
+BUILDFILES13 = w_atan2.obj w_atanh.obj w_cosh.obj w_exp.obj w_fmod.obj
+BUILDFILES14 = w_gamma.obj w_gamma_r.obj w_hypot.obj w_j0.obj w_j1.obj
+BUILDFILES15 = w_jn.obj w_lgamma.obj w_lgamma_r.obj w_log.obj w_log10.obj
+BUILDFILES16 = w_pow.obj w_remainder.obj w_scalb.obj w_sinh.obj w_sqrt.obj
+
+.c.obj:
+ $(cc) -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 $(cflags) -D_MT -D_DLL -MD -D_WINSOCKAPI_ -DWIN32 -Oityb1 -Gs -GF -Zm400 -W3 -Zi -Fd$(LIBPATH)hyfdlibm.pdb -D_IEEE_LIBM -DHY_PLATFORM_DOUBLE_ORDER /I..\include $(VMDEBUG) $*.c
+
+.cpp.obj:
+ $(cc) -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 $(cflags) -D_MT -D_DLL -MD -D_WINSOCKAPI_ -DWIN32 -Oityb1 -Gs -GF -Zm400 -W3 -Zi -Fd$(LIBPATH)hyfdlibm.pdb -D_IEEE_LIBM -DHY_PLATFORM_DOUBLE_ORDER /I..\include $(VMDEBUG) $*.cpp
+
+.asm.obj:
+ ml /c /Cp /W3 /nologo /coff /Zm /Zd /Zi /Gd $(VMASMDEBUG) -DWIN32 $<
+
+all: $(LIBPATH)$(LIBNAME)
+
+$(LIBPATH)$(LIBNAME):\
+ $(BUILDFILES1) $(BUILDFILES2) $(BUILDFILES3) $(BUILDFILES4) $(BUILDFILES5) \
+ $(BUILDFILES6) $(BUILDFILES7) $(BUILDFILES8) $(BUILDFILES9) $(BUILDFILES10) \
+ $(BUILDFILES11) $(BUILDFILES12) $(BUILDFILES13) $(BUILDFILES14) $(BUILDFILES15) \
+ $(BUILDFILES16)
+ @echo /NOLOGO -out:$(LIBPATH)$(LIBNAME) >templrf
+ @echo $(BUILDFILES1) >>templrf
+ @echo $(BUILDFILES2) >>templrf
+ @echo $(BUILDFILES3) >>templrf
+ @echo $(BUILDFILES4) >>templrf
+ @echo $(BUILDFILES5) >>templrf
+ @echo $(BUILDFILES6) >>templrf
+ @echo $(BUILDFILES7) >>templrf
+ @echo $(BUILDFILES8) >>templrf
+ @echo $(BUILDFILES9) >>templrf
+ @echo $(BUILDFILES10) >>templrf
+ @echo $(BUILDFILES11) >>templrf
+ @echo $(BUILDFILES12) >>templrf
+ @echo $(BUILDFILES13) >>templrf
+ @echo $(BUILDFILES14) >>templrf
+ @echo $(BUILDFILES15) >>templrf
+ @echo $(BUILDFILES16) >>templrf
+ $(implib) @templrf
+ @del templrf
+
+clean:
+ -del *.obj
+ -del $(LIBPATH)$(LIBNAME)
+ -del $(LIBPATH)hyfdlibm.pdb
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/s_lib_version.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/s_lib_version.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/s_lib_version.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/fdlibm/s_lib_version.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,41 @@
+
+/* @(#)s_lib_version.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * MACRO for standards
+ */
+
+#include "fdlibm.h"
+
+/*
+ * define and initialize _LIB_VERSION
+ */
+
+/* Local Change -- insist that only the IEEE version is built. See also fdlibm.h */
+#ifndef HY_FIXED_VERSION
+
+#ifdef _POSIX_MODE
+_LIB_VERSION_TYPE _LIB_VERSION = _POSIX_;
+#else
+#ifdef _XOPEN_MODE
+_LIB_VERSION_TYPE _LIB_VERSION = _XOPEN_;
+#else
+#ifdef _SVID3_MODE
+_LIB_VERSION_TYPE _LIB_VERSION = _SVID_;
+#else /* default _IEEE_MODE */
+_LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
+#endif
+#endif
+#endif
+
+#endif
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/apache.ico
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/apache.ico?rev=350181&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/apache.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/fltconst.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/fltconst.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/fltconst.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/fltconst.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,135 @@
+/* Copyright 1991, 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(fltconst_h)
+#define fltconst_h
+
+#include "hycomp.h"
+/* IEEE floats consist of: sign bit, exponent field, significand field
+ single: 31 = sign bit, 30..23 = exponent (8 bits), 22..0 = significand (23 bits)
+ double: 63 = sign bit, 62..52 = exponent (11 bits), 51..0 = significand (52 bits)
+ inf == (all exponent bits set) and (all mantissa bits clear)
+ nan == (all exponent bits set) and (at least one mantissa bit set)
+ finite == (at least one exponent bit clear)
+ zero == (all exponent bits clear) and (all mantissa bits clear)
+ denormal == (all exponent bits clear) and (at least one mantissa bit set)
+ positive == sign bit clear
+ negative == sign bit set
+*/
+#define MAX_U32_DOUBLE (ESDOUBLE) (4294967296.0) /* 2^32 */
+#define MAX_U32_SINGLE (ESSINGLE) (4294967296.0) /* 2^32 */
+#define HY_POS_PI (ESDOUBLE)(3.141592653589793)
+#define DOUBLE_LO_OFFSET 0
+#define DOUBLE_HI_OFFSET 1
+
+#define LONG_LO_OFFSET 0
+#define LONG_HI_OFFSET 1
+#define RETURN_FINITE 0
+#define RETURN_NAN 1
+#define RETURN_POS_INF 2
+#define RETURN_NEG_INF 3
+#define DOUBLE_SIGN_MASK_HI 0x80000000
+#define DOUBLE_EXPONENT_MASK_HI 0x7FF00000
+#define DOUBLE_MANTISSA_MASK_LO 0xFFFFFFFF
+#define DOUBLE_MANTISSA_MASK_HI 0x000FFFFF
+#define SINGLE_SIGN_MASK 0x80000000
+#define SINGLE_EXPONENT_MASK 0x7F800000
+#define SINGLE_MANTISSA_MASK 0x007FFFFF
+#define SINGLE_NAN_BITS (SINGLE_EXPONENT_MASK | 0x00400000)
+typedef union u64u32dbl_tag
+{
+ U_64 u64val;
+ U_32 u32val[2];
+ I_32 i32val[2];
+ double dval;
+} U64U32DBL;
+
+/* Replace P_FLOAT_HI and P_FLOAT_LOW */
+/* These macros are used to access the high and low 32-bit parts of a double (64-bit) value. */
+#define LOW_U32_FROM_DBL_PTR(dblptr) (((U64U32DBL *)(dblptr))->u32val[DOUBLE_LO_OFFSET])
+#define HIGH_U32_FROM_DBL_PTR(dblptr) (((U64U32DBL *)(dblptr))->u32val[DOUBLE_HI_OFFSET])
+#define LOW_I32_FROM_DBL_PTR(dblptr) (((U64U32DBL *)(dblptr))->i32val[DOUBLE_LO_OFFSET])
+#define HIGH_I32_FROM_DBL_PTR(dblptr) (((U64U32DBL *)(dblptr))->i32val[DOUBLE_HI_OFFSET])
+#define LOW_U32_FROM_DBL(dbl) LOW_U32_FROM_DBL_PTR(&(dbl))
+#define HIGH_U32_FROM_DBL(dbl) HIGH_U32_FROM_DBL_PTR(&(dbl))
+#define LOW_I32_FROM_DBL(dbl) LOW_I32_FROM_DBL_PTR(&(dbl))
+#define HIGH_I32_FROM_DBL(dbl) HIGH_I32_FROM_DBL_PTR(&(dbl))
+#define LOW_U32_FROM_LONG64_PTR(long64ptr) (((U64U32DBL *)(long64ptr))->u32val[LONG_LO_OFFSET])
+#define HIGH_U32_FROM_LONG64_PTR(long64ptr) (((U64U32DBL *)(long64ptr))->u32val[LONG_HI_OFFSET])
+#define LOW_I32_FROM_LONG64_PTR(long64ptr) (((U64U32DBL *)(long64ptr))->i32val[LONG_LO_OFFSET])
+#define HIGH_I32_FROM_LONG64_PTR(long64ptr) (((U64U32DBL *)(long64ptr))->i32val[LONG_HI_OFFSET])
+#define LOW_U32_FROM_LONG64(long64) LOW_U32_FROM_LONG64_PTR(&(long64))
+#define HIGH_U32_FROM_LONG64(long64) HIGH_U32_FROM_LONG64_PTR(&(long64))
+#define LOW_I32_FROM_LONG64(long64) LOW_I32_FROM_LONG64_PTR(&(long64))
+#define HIGH_I32_FROM_LONG64(long64) HIGH_I32_FROM_LONG64_PTR(&(long64))
+#define IS_ZERO_DBL_PTR(dblptr) ((LOW_U32_FROM_DBL_PTR(dblptr) == 0) && ((HIGH_U32_FROM_DBL_PTR(dblptr) == 0) || (HIGH_U32_FROM_DBL_PTR(dblptr) == DOUBLE_SIGN_MASK_HI)))
+#define IS_ONE_DBL_PTR(dblptr) ((HIGH_U32_FROM_DBL_PTR(dblptr) == 0x3ff00000 || HIGH_U32_FROM_DBL_PTR(dblptr) == 0xbff00000) && (LOW_U32_FROM_DBL_PTR(dblptr) == 0))
+#define IS_NAN_DBL_PTR(dblptr) (((HIGH_U32_FROM_DBL_PTR(dblptr) & DOUBLE_EXPONENT_MASK_HI) == DOUBLE_EXPONENT_MASK_HI) && (LOW_U32_FROM_DBL_PTR(dblptr) | (HIGH_U32_FROM_DBL_PTR(dblptr) & DOUBLE_MANTISSA_MASK_HI)))
+#define IS_INF_DBL_PTR(dblptr) (((HIGH_U32_FROM_DBL_PTR(dblptr) & (DOUBLE_EXPONENT_MASK_HI|DOUBLE_MANTISSA_MASK_HI)) == DOUBLE_EXPONENT_MASK_HI) && (LOW_U32_FROM_DBL_PTR(dblptr) == 0))
+#define IS_DENORMAL_DBL_PTR(dblptr) (((HIGH_U32_FROM_DBL_PTR(dblptr) & DOUBLE_EXPONENT_MASK_HI) == 0) && ((HIGH_U32_FROM_DBL_PTR(dblptr) & DOUBLE_MANTISSA_MASK_HI) != 0 || (LOW_U32_FROM_DBL_PTR(dblptr) != 0)))
+#define IS_FINITE_DBL_PTR(dblptr) ((HIGH_U32_FROM_DBL_PTR(dblptr) & DOUBLE_EXPONENT_MASK_HI) < DOUBLE_EXPONENT_MASK_HI)
+#define IS_POSITIVE_DBL_PTR(dblptr) ((HIGH_U32_FROM_DBL_PTR(dblptr) & DOUBLE_SIGN_MASK_HI) == 0)
+#define IS_NEGATIVE_DBL_PTR(dblptr) ((HIGH_U32_FROM_DBL_PTR(dblptr) & DOUBLE_SIGN_MASK_HI) != 0)
+#define IS_NEGATIVE_MAX_DBL_PTR(dblptr) ((HIGH_U32_FROM_DBL_PTR(dblptr) == 0xFFEFFFFF) && (LOW_U32_FROM_DBL_PTR(dblptr) == 0xFFFFFFFF))
+#define IS_ZERO_DBL(dbl) IS_ZERO_DBL_PTR(&(dbl))
+#define IS_ONE_DBL(dbl) IS_ONE_DBL_PTR(&(dbl))
+#define IS_NAN_DBL(dbl) IS_NAN_DBL_PTR(&(dbl))
+#define IS_INF_DBL(dbl) IS_INF_DBL_PTR(&(dbl))
+#define IS_DENORMAL_DBL(dbl) IS_DENORMAL_DBL_PTR(&(dbl))
+#define IS_FINITE_DBL(dbl) IS_FINITE_DBL_PTR(&(dbl))
+#define IS_POSITIVE_DBL(dbl) IS_POSITIVE_DBL_PTR(&(dbl))
+#define IS_NEGATIVE_DBL(dbl) IS_NEGATIVE_DBL_PTR(&(dbl))
+#define IS_NEGATIVE_MAX_DBL(dbl) IS_NEGATIVE_MAX_DBL_PTR(&(dbl))
+#define IS_ZERO_SNGL_PTR(fltptr) ((*U32P((fltptr)) & (U_32)~SINGLE_SIGN_MASK) == (U_32)0)
+#define IS_ONE_SNGL_PTR(fltptr) ((*U32P((fltptr)) == 0x3f800000) || (*U32P((fltptr)) == 0xbf800000))
+#define IS_NAN_SNGL_PTR(fltptr) ((*U32P((fltptr)) & (U_32)~SINGLE_SIGN_MASK) > (U_32)SINGLE_EXPONENT_MASK)
+#define IS_INF_SNGL_PTR(fltptr) ((*U32P((fltptr)) & (U_32)~SINGLE_SIGN_MASK) == (U_32)SINGLE_EXPONENT_MASK)
+#define IS_DENORMAL_SNGL_PTR(fltptr) (((*U32P((fltptr)) & (U_32)~SINGLE_SIGN_MASK)-(U_32)1) < (U_32)SINGLE_MANTISSA_MASK)
+#define IS_FINITE_SNGL_PTR(fltptr) ((*U32P((fltptr)) & (U_32)~SINGLE_SIGN_MASK) < (U_32)SINGLE_EXPONENT_MASK)
+#define IS_POSITIVE_SNGL_PTR(fltptr) ((*U32P((fltptr)) & (U_32)SINGLE_SIGN_MASK) == (U_32)0)
+#define IS_NEGATIVE_SNGL_PTR(fltptr) ((*U32P((fltptr)) & (U_32)SINGLE_SIGN_MASK) != (U_32)0)
+#define IS_ZERO_SNGL(flt) IS_ZERO_SNGL_PTR(&(flt))
+#define IS_ONE_SNGL(flt) IS_ONE_SNGL_PTR(&(flt))
+#define IS_NAN_SNGL(flt) IS_NAN_SNGL_PTR(&(flt))
+#define IS_INF_SNGL(flt) IS_INF_SNGL_PTR(&(flt))
+#define IS_DENORMAL_SNGL(flt) IS_DENORMAL_SNGL_PTR(&(flt))
+#define IS_FINITE_SNGL(flt) IS_FINITE_SNGL_PTR(&(flt))
+#define IS_POSITIVE_SNGL(flt) IS_POSITIVE_SNGL_PTR(&(flt))
+#define IS_NEGATIVE_SNGL(flt) IS_NEGATIVE_SNGL_PTR(&(flt))
+#define SET_NAN_DBL_PTR(dblptr) HIGH_U32_FROM_DBL_PTR(dblptr) = (DOUBLE_EXPONENT_MASK_HI | 0x00080000); LOW_U32_FROM_DBL_PTR(dblptr) = 0
+#define SET_PZERO_DBL_PTR(dblptr) HIGH_U32_FROM_DBL_PTR(dblptr) = 0; LOW_U32_FROM_DBL_PTR(dblptr) = 0
+#define SET_NZERO_DBL_PTR(dblptr) HIGH_U32_FROM_DBL_PTR(dblptr) = DOUBLE_SIGN_MASK_HI; LOW_U32_FROM_DBL_PTR(dblptr) = 0
+#define SET_PINF_DBL_PTR(dblptr) HIGH_U32_FROM_DBL_PTR(dblptr) = DOUBLE_EXPONENT_MASK_HI; LOW_U32_FROM_DBL_PTR(dblptr) = 0
+#define SET_NINF_DBL_PTR(dblptr) HIGH_U32_FROM_DBL_PTR(dblptr) = (DOUBLE_EXPONENT_MASK_HI | DOUBLE_SIGN_MASK_HI); LOW_U32_FROM_DBL_PTR(dblptr) = 0
+#define SET_NAN_SNGL_PTR(fltptr) *U32P((fltptr)) = ((U_32)SINGLE_NAN_BITS)
+#define SET_PZERO_SNGL_PTR(fltptr) *U32P((fltptr)) = 0
+#define SET_NZERO_SNGL_PTR(fltptr) *U32P((fltptr)) = SINGLE_SIGN_MASK
+#define SET_PINF_SNGL_PTR(fltptr) *U32P((fltptr)) = SINGLE_EXPONENT_MASK
+#define SET_NINF_SNGL_PTR(fltptr) *U32P((fltptr)) = (SINGLE_EXPONENT_MASK | SINGLE_SIGN_MASK)
+
+/* on some platforms we cannot reference an unaligned float. Build them by hand, one U_32 at a time. */
+#if defined(ATOMIC_FLOAT_ACCESS)
+#define PTR_DOUBLE_STORE(dstPtr, aDoublePtr) HIGH_U32_FROM_DBL_PTR(dstPtr) = HIGH_U32_FROM_DBL_PTR(aDoublePtr); LOW_U32_FROM_DBL_PTR(dstPtr) = LOW_U32_FROM_DBL_PTR(aDoublePtr)
+#define PTR_DOUBLE_VALUE(dstPtr, aDoublePtr) HIGH_U32_FROM_DBL_PTR(aDoublePtr) = HIGH_U32_FROM_DBL_PTR(dstPtr); LOW_U32_FROM_DBL_PTR(aDoublePtr) = LOW_U32_FROM_DBL_PTR(dstPtr)
+#else
+#define PTR_DOUBLE_STORE(dstPtr, aDoublePtr) (*(dstPtr) = *(aDoublePtr))
+#define PTR_DOUBLE_VALUE(dstPtr, aDoublePtr) (*(aDoublePtr) = *(dstPtr))
+#endif
+
+#define STORE_LONG(dstPtr, hi, lo) HIGH_U32_FROM_LONG64_PTR(dstPtr) = (hi); LOW_U32_FROM_LONG64_PTR(dstPtr) = (lo)
+#define PTR_SINGLE_VALUE(dstPtr, aSinglePtr) (*U32P(aSinglePtr) = *U32P(dstPtr))
+#define PTR_SINGLE_STORE(dstPtr, aSinglePtr) *((U_32 *)(dstPtr)) = (*U32P(aSinglePtr))
+
+#endif /* fltconst_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/gp.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/gp.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/gp.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/gp.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,30 @@
+/* Copyright 1991, 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(gp_h)
+#define gp_h
+
+struct HySigContext;
+
+typedef UDATA (*protected_fn) (void *);
+typedef void (*handler_fn) (UDATA gpType, void *gpInfo, void *userData,
+ struct HySigContext * gpContext);
+#define HyPrimErrGPF 0
+#define HyPrimErrGPFInvalidRead 1
+#define HyPrimErrGPFInvalidWrite 2
+#define HyPrimErrGPFInvalidInstruction 3
+#define HyPrimErrGPFFloat 4
+
+#endif /* gp_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/harmony.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/harmony.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/harmony.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/harmony.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,22 @@
+/* Copyright 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(harmony_h)
+#define harmony_h
+
+#define USING_VMI
+#include "vmi.h"
+
+#endif /* harmony_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hycomp.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hycomp.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hycomp.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hycomp.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,324 @@
+/* Copyright 1991, 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(hycomp_h)
+#define hycomp_h
+
+/*
+USE_PROTOTYPES: Use full ANSI prototypes.
+CLOCK_PRIMS: We want the timer/clock prims to be used
+LITTLE_ENDIAN: This is for the intel machines or other
+ little endian processors. Defaults to big endian.
+NO_LVALUE_CASTING: This is for compilers that don't like the left side
+ of assigns to be cast. It hacks around to do the
+ right thing.
+ATOMIC_FLOAT_ACCESS: So that float operations will work.
+LINKED_USER_PRIMITIVES: Indicates that user primitives are statically linked
+ with the VM executeable.
+OLD_SPACE_SIZE_DIFF: The 68k uses a different amount of old space.
+ This "legitimizes" the change.
+SIMPLE_SIGNAL: For machines that don't use real signals in C.
+ (eg: PC, 68k)
+OS_NAME_LOOKUP: Use nlist to lookup user primitive addresses.
+VMCALL: Tag for all functions called by the VM.
+VMAPICALL: Tag for all functions called via the PlatformFunction
+ callWith: mechanism.
+
+SYS_FLOAT: For some math functions where extended types (80 or 96 bits) are returned
+ Most platforms return as a double
+FLOAT_EXTENDED: If defined, the type name for extended precision floats.
+PLATFORM_IS_ASCII: Must be defined if the platform is ASCII
+EXE_EXTENSION_CHAR: the executable has a delimiter that we want to stop at as part of argv[0].
+*/
+/* By default order doubles in the native (i.e. big/little endian) ordering. */
+#define HY_PLATFORM_DOUBLE_ORDER
+#if defined(LINUX)
+/* NOTE: Linux supports different processors -- do not assume 386 */
+#if defined(LINUXPPC64)
+#define DATA_TYPES_DEFINED
+typedef unsigned long int UDATA; /* 64bits */
+typedef unsigned long int U_64;
+typedef unsigned int U_32;
+typedef unsigned short U_16;
+typedef unsigned char U_8;
+typedef signed long int IDATA; /* 64bits */
+typedef long int I_64;
+typedef signed int I_32;
+typedef signed short I_16;
+typedef signed char I_8;
+typedef U_32 BOOLEAN;
+#if defined(LINUXPPC64)
+#define TOC_UNWRAP_ADDRESS(wrappedPointer) ((void *) (wrappedPointer)[0])
+#define TOC_STORE_TOC(dest,wrappedPointer) (dest = ((UDATA*)wrappedPointer)[1])
+#endif
+#else
+typedef long long I_64;
+typedef unsigned long long U_64;
+#endif
+typedef double SYS_FLOAT;
+#define HYCONST64(x) x##LL
+#define NO_LVALUE_CASTING
+#define FLOAT_EXTENDED long double
+#define PLATFORM_IS_ASCII
+#define PLATFORM_LINE_DELIMITER "\012"
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_STR "/"
+
+/* no priorities on Linux */
+#define HY_PRIORITY_MAP {0,0,0,0,0,0,0,0,0,0,0,0}
+
+#if (defined(LINUXPPC) && !defined(LINUXPPC64))
+#define VA_PTR(valist) (&valist[0])
+#endif
+#endif
+
+#define GLOBAL_DATA(symbol) ((void*)&(symbol))
+#define GLOBAL_TABLE(symbol) GLOBAL_DATA(symbol)
+
+/* Win32 - Windows 3.1 & NT using Win32 */
+#if defined(WIN32)
+
+typedef __int64 I_64;
+typedef unsigned __int64 U_64;
+
+typedef double SYS_FLOAT;
+#define NO_LVALUE_CASTING
+#define VMAPICALL _stdcall
+#define VMCALL _cdecl
+#define EXE_EXTENSION_CHAR '.'
+
+#define DIR_SEPARATOR '\\'
+#define DIR_SEPARATOR_STR "\\"
+
+/* Modifications for the Alpha running WIN-NT */
+#if defined(_ALPHA_)
+#undef small /* defined as char in rpcndr.h */
+typedef double FLOAT_EXTENDED;
+#endif
+
+#define HY_PRIORITY_MAP { \
+ THREAD_PRIORITY_IDLE, /* 0 */\
+ THREAD_PRIORITY_LOWEST, /* 1 */\
+ THREAD_PRIORITY_BELOW_NORMAL, /* 2 */\
+ THREAD_PRIORITY_BELOW_NORMAL, /* 3 */\
+ THREAD_PRIORITY_BELOW_NORMAL, /* 4 */\
+ THREAD_PRIORITY_NORMAL, /* 5 */\
+ THREAD_PRIORITY_ABOVE_NORMAL, /* 6 */\
+ THREAD_PRIORITY_ABOVE_NORMAL, /* 7 */\
+ THREAD_PRIORITY_ABOVE_NORMAL, /* 8 */\
+ THREAD_PRIORITY_ABOVE_NORMAL, /* 9 */\
+ THREAD_PRIORITY_HIGHEST, /*10 */\
+ THREAD_PRIORITY_TIME_CRITICAL /*11 */}
+#endif
+
+#if !defined(VMCALL)
+#define VMCALL
+#define VMAPICALL
+#endif
+#define PVMCALL VMCALL *
+/* Provide some reasonable defaults for the VM "types":
+ UDATA unsigned data, can be used as an integer or pointer storage.
+ IDATA signed data, can be used as an integer or pointer storage.
+ U_64 / I_64 unsigned/signed 64 bits.
+ U_32 / I_32 unsigned/signed 32 bits.
+ U_16 / I_16 unsigned/signed 16 bits.
+ U_8 / I_8 unsigned/signed 8 bits (bytes -- not to be confused with char)
+ BOOLEAN something that can be zero or non-zero.
+*/
+#if !defined(DATA_TYPES_DEFINED)
+typedef unsigned int UDATA;
+typedef unsigned int U_32;
+typedef unsigned short U_16;
+typedef unsigned char U_8;
+/* no generic U_64 or I_64 */
+typedef int IDATA;
+typedef int I_32;
+typedef short I_16;
+typedef char I_8;
+/* don't typedef BOOLEAN since it's already def'ed on Win32 */
+
+#define BOOLEAN UDATA
+#endif
+
+#if !defined(HYCONST64)
+#define HYCONST64(x) x##L
+#endif
+
+#if !defined(HY_DEFAULT_SCHED)
+/* by default, pthreads platforms use the SCHED_OTHER thread scheduling policy */
+#define HY_DEFAULT_SCHED SCHED_OTHER
+#endif
+
+#if !defined(HY_PRIORITY_MAP)
+/* if no priority map if provided, priorities will be determined algorithmically */
+#endif
+
+#if !defined(FALSE)
+#define FALSE ((BOOLEAN) 0)
+#if !defined(TRUE)
+#define TRUE ((BOOLEAN) (!FALSE))
+#endif
+#endif
+
+#if !defined(NULL)
+#if defined(__cplusplus)
+#define NULL (0)
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+#define USE_PROTOTYPES
+#if defined(USE_PROTOTYPES)
+#define PROTOTYPE(x) x
+#define VARARGS , ...
+#else
+#define PROTOTYPE(x) ()
+#define VARARGS
+#endif
+/* Assign the default line delimiter if it was not set */
+#if !defined(PLATFORM_LINE_DELIMITER)
+#define PLATFORM_LINE_DELIMITER "\015\012"
+#endif
+/* Set the max path length if it was not set */
+#if !defined(MAX_IMAGE_PATH_LENGTH)
+#define MAX_IMAGE_PATH_LENGTH (2048)
+#endif
+typedef double ESDOUBLE;
+typedef float ESSINGLE;
+/* helpers for U_64s */
+#define CLEAR_U64(u64) (u64 = (U_64)0)
+#define LOW_LONG(l) (*((U_32 *) &(l)))
+#define HIGH_LONG(l) (*(((U_32 *) &(l)) + 1))
+#define I8(x) ((I_8) (x))
+#define I8P(x) ((I_8 *) (x))
+#define U16(x) ((U_16) (x))
+#define I16(x) ((I_16) (x))
+#define I16P(x) ((I_16 *) (x))
+#define U32(x) ((U_32) (x))
+#define I32(x) ((I_32) (x))
+#define I32P(x) ((I_32 *) (x))
+#define U16P(x) ((U_16 *) (x))
+#define U32P(x) ((U_32 *) (x))
+#define OBJP(x) ((HyObject *) (x))
+#define OBJPP(x) ((HyObject **) (x))
+#define OBJPPP(x) ((HyObject ***) (x))
+#define CLASSP(x) ((Class *) (x))
+#define CLASSPP(x) ((Class **) (x))
+#define BYTEP(x) ((BYTE *) (x))
+/* Test - was conflicting with OS2.h */
+#define ESCHAR(x) ((CHARACTER) (x))
+#define FLT(x) ((FLOAT) x)
+#define FLTP(x) ((FLOAT *) (x))
+#if defined(NO_LVALUE_CASTING)
+#define LI8(x) (*((I_8 *) &(x)))
+#define LI8P(x) (*((I_8 **) &(x)))
+#define LU16(x) (*((U_16 *) &(x)))
+#define LI16(x) (*((I_16 *) &(x)))
+#define LU32(x) (*((U_32 *) &(x)))
+#define LI32(x) (*((I_32 *) &(x)))
+#define LI32P(x) (*((I_32 **) &(x)))
+#define LU16P(x) (*((U_16 **) &(x)))
+#define LU32P(x) (*((U_32 **) &(x)))
+#define LOBJP(x) (*((HyObject **) &(x)))
+#define LOBJPP(x) (*((HyObject ***) &(x)))
+#define LOBJPPP(x) (*((HyObject ****) &(x))
+#define LCLASSP(x) (*((Class **) &(x)))
+#define LBYTEP(x) (*((BYTE **) &(x)))
+#define LCHAR(x) (*((CHARACTER) &(x)))
+#define LFLT(x) (*((FLOAT) &x))
+#define LFLTP(x) (*((FLOAT *) &(x)))
+#else
+#define LI8(x) I8((x))
+#define LI8P(x) I8P((x))
+#define LU16(x) U16((x))
+#define LI16(x) I16((x))
+#define LU32(x) U32((x))
+#define LI32(x) I32((x))
+#define LI32P(x) I32P((x))
+#define LU16P(x) U16P((x))
+#define LU32P(x) U32P((x))
+#define LOBJP(x) OBJP((x))
+#define LOBJPP(x) OBJPP((x))
+#define LOBJPPP(x) OBJPPP((x))
+#define LIOBJP(x) IOBJP((x))
+#define LCLASSP(x) CLASSP((x))
+#define LBYTEP(x) BYTEP((x))
+#define LCHAR(x) CHAR((x))
+#define LFLT(x) FLT((x))
+#define LFLTP(x) FLTP((x))
+#endif
+/* Macros for converting between words and longs and accessing bits */
+#define HIGH_WORD(x) U16(U32((x)) >> 16)
+#define LOW_WORD(x) U16(U32((x)) & 0xFFFF)
+#define LOW_BIT(o) (U32((o)) & 1)
+#define LOW_2_BITS(o) (U32((o)) & 3)
+#define LOW_3_BITS(o) (U32((o)) & 7)
+#define LOW_4_BITS(o) (U32((o)) & 15)
+#define MAKE_32(h, l) ((U32((h)) << 16) | U32((l)))
+#define MAKE_64(h, l) ((((I_64)(h)) << 32) | (l))
+#if defined(__cplusplus)
+#define HY_CFUNC "C"
+#define HY_CDATA "C"
+#else
+#define HY_CFUNC
+#define HY_CDATA
+#endif
+/* Macros for tagging functions which read/write the vm thread */
+#define READSVMTHREAD
+#define WRITESVMTHREAD
+#define REQUIRESSTACKFRAME
+/* macro for tagging functions which never return */
+#if defined(__GNUC__)
+/* on GCC, we can actually pass this information on to the compiler */
+#define NORETURN __attribute__((noreturn))
+#else
+#define NORETURN
+#endif
+/* on some systems va_list is an array type. This is probably in
+ * violation of the ANSI C spec, but it's not entirely clear. Because of this, we end
+ * up with an undesired extra level of indirection if we take the address of a
+ * va_list argument.
+ *
+ * To get it right ,always use the VA_PTR macro
+ */
+#if !defined(VA_PTR)
+#define VA_PTR(valist) (&valist)
+#endif
+#if !defined(TOC_UNWRAP_ADDRESS)
+#define TOC_UNWRAP_ADDRESS(wrappedPointer) (wrappedPointer)
+#endif
+
+#if !defined(TOC_STORE_TOC)
+#define TOC_STORE_TOC(dest,wrappedPointer)
+#endif
+/* Macros for accessing I_64 values */
+#if defined(ATOMIC_LONG_ACCESS)
+#define PTR_LONG_STORE(dstPtr, aLongPtr) ((*U32P(dstPtr) = *U32P(aLongPtr)), (*(U32P(dstPtr)+1) = *(U32P(aLongPtr)+1)))
+#define PTR_LONG_VALUE(dstPtr, aLongPtr) ((*U32P(aLongPtr) = *U32P(dstPtr)), (*(U32P(aLongPtr)+1) = *(U32P(dstPtr)+1)))
+#else
+#define PTR_LONG_STORE(dstPtr, aLongPtr) (*(dstPtr) = *(aLongPtr))
+#define PTR_LONG_VALUE(dstPtr, aLongPtr) (*(aLongPtr) = *(dstPtr))
+#endif
+/* Macro used when declaring tables which require relocations.
+ */
+#if !defined(HYCONST_TABLE)
+#define HYCONST_TABLE const
+#endif
+/* ANSI qsort is not always available */
+#if !defined(HY_SORT)
+#define HY_SORT(base, nmemb, size, compare) qsort((base), (nmemb), (size), (compare))
+#endif
+
+#endif /* escomp_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hylib.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hylib.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hylib.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hylib.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,30 @@
+/* Copyright 1991, 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(HYLIB_H)
+#define HYLIB_H
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+#define HY_ZIP_DLL_NAME "hyzlib"
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* HYLIB_H */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hymutex.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hymutex.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hymutex.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hymutex.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1991, 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(hymutex_h)
+#define hymutex_h
+
+/* windows.h defined UDATA. Ignore its definition */
+#define UDATA UDATA_win32_
+#include <windows.h>
+#undef UDATA /* this is safe because our UDATA is a typedef, not a macro */
+typedef CRITICAL_SECTION MUTEX;
+
+/* MUTEX_INIT */
+#define MUTEX_INIT(mutex) (InitializeCriticalSection(&(mutex)), 1)
+
+/* MUTEX_DESTROY */
+#define MUTEX_DESTROY(mutex) DeleteCriticalSection(&(mutex))
+
+/* MUTEX_ENTER */
+#define MUTEX_ENTER(mutex) EnterCriticalSection(&(mutex))
+
+/*
+ * MUTEX_TRY_ENTER
+ * returns 0 on success
+ * Beware: you may not have support for TryEnterCriticalSection
+ */
+#define MUTEX_TRY_ENTER(mutex) (!(TryEnterCriticalSection(&(mutex))))
+
+/* MUTEX_EXIT */
+#define MUTEX_EXIT(mutex) LeaveCriticalSection(&(mutex))
+
+#endif /* hymutex_h */
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hypool.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hypool.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hypool.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/hypool.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,101 @@
+/* Copyright 1991, 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.
+ */
+
+/**
+ * @file
+ * @ingroup Pool
+ * @brief Pool Header
+ */
+
+#if !defined(HYPOOL_H)
+#define HYPOOL_H
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+#include "hycomp.h"
+#include "hyport.h"
+
+typedef void *(VMCALL * hymemAlloc_fptr_t) (void *, U_32);
+typedef void (VMCALL * hymemFree_fptr_t) (void *, void *);
+
+typedef struct HyPool
+ {
+ UDATA elementSize;
+ UDATA numberOfElements;
+ UDATA usedElements;
+ void *firstElementAddress;
+ UDATA *firstFreeSlot;
+ struct HyPool *activePuddle;
+ struct HyPool *nextPool;
+ void *(PVMCALL memAlloc) (void *userData, U_32 byteAmount);
+ void (PVMCALL memFree) (void *userData, void *ptr);
+ void *userData;
+ U_16 alignment;
+ U_16 flags;
+ } HyPool;
+
+#define POOL_FOR_PORT(portLib) (hymemAlloc_fptr_t)(portLib)->mem_allocate_memory, (hymemFree_fptr_t)(portLib)->mem_free_memory, portLib
+#define POOL_ALWAYS_KEEP_SORTED 4
+#define POOL_NEVER_FREE_PUDDLES 2
+#define POOL_SORTED 1
+#define HYSIZEOF_HyPool 44
+
+typedef struct HyPoolState
+ {
+ UDATA leftToDo;
+ struct HyPool *currPool;
+ UDATA *lastAddr;
+ UDATA **nextFree;
+ } HyPoolState;
+
+#define HYSIZEOF_HyPoolState 16
+#define pool_state HyPoolState
+
+/* HySourcePool*/
+extern HY_CFUNC void VMCALL pool_do
+ PROTOTYPE ((HyPool * aPool,
+ void (*aFunction) (void *anElement, void *userData),
+ void *userData));
+extern HY_CFUNC HyPool *VMCALL pool_new
+ PROTOTYPE ((U_32 structSize, U_32 minNumberElements,
+ U_32 elementAlignment, UDATA poolFlags,
+ void *(VMCALL * memAlloc) (void *, U_32),
+ void (VMCALL * memFree) (void *, void *), void *userData));
+extern HY_CFUNC void *VMCALL pool_startDo
+ PROTOTYPE ((HyPool * aPool, pool_state * lastHandle));
+extern HY_CFUNC void VMCALL pool_removeElement
+ PROTOTYPE ((HyPool * aPool, void *anElement));
+extern HY_CFUNC UDATA VMCALL pool_numElements PROTOTYPE ((HyPool * aPool));
+extern HY_CFUNC void *VMCALL pool_nextDo
+ PROTOTYPE ((pool_state * lastHandle));
+extern HY_CFUNC void *VMCALL pool_newElement PROTOTYPE ((HyPool * aPool));
+extern HY_CFUNC HyPool *VMCALL pool_forPortLib
+ PROTOTYPE ((U_32 structSize, HyPortLibrary * portLibrary));
+extern HY_CFUNC void VMCALL pool_kill PROTOTYPE ((HyPool * aPool));
+extern HY_CFUNC void VMCALL pool_sortFree PROTOTYPE ((HyPool * aPool));
+extern HY_CFUNC void VMCALL pool_clear PROTOTYPE ((HyPool * aPool));
+
+/* HySourcePoolCapacity*/
+extern HY_CFUNC UDATA VMCALL pool_capacity PROTOTYPE ((HyPool * aPool));
+extern HY_CFUNC UDATA VMCALL pool_ensureCapacity
+ PROTOTYPE ((HyPool * aPool, UDATA newCapacity));
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* HYPOOL_H */