harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r350181 [176/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....
Date Thu, 01 Dec 2005 06:04:00 GMT
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/ute_pd.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/ute_pd.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/ute_pd.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/ute_pd.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,94 @@
+/* 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.
+ */
+
+/* =============================================================================
+* DESCRIPTION: Universal trace engine platform dependent header file.
+* =============================================================================
+*/
+
+#if !defined(_UTE_PD_H)
+#define _UTE_PD_H
+#include "hycomp.h"
+#include "jni.h"
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+/*
+ * =============================================================================
+ *  Platform dependent primitives
+ * =============================================================================
+ */
+  typedef I_64 UT_I64;          /* Signed 64bit integer        */
+  typedef I_32 UT_I32;          /* Signed 32bit integer        */
+  typedef I_16 UT_I16;          /* Signed 16bit integer        */
+  typedef I_8 UT_I8;            /* Signed 8bit integer         */
+  typedef IDATA UT_IPTR;        /* Signed ptr-sized integer    */
+  typedef U_64 UT_U64;          /* Unsigned 64bit integer      */
+  typedef U_32 UT_U32;          /* Unsigned 32bit integer      */
+  typedef U_16 UT_U16;          /* Unsigned 16bit integer      */
+  typedef U_8 UT_U8;            /* Unsigned 8bit integer       */
+  typedef UDATA UT_UPTR;        /* Unsigned ptr-sized integer  */
+  typedef I_32 UT_BOOL;         /* Boolean                     */
+  typedef I_32 UT_FD;           /* File descriptor             */
+/*
+ * =============================================================================
+ *  Platform dependent return codes - Use JNI return codes for this application
+ *  Note that all error codes must be negative
+ * =============================================================================
+ */
+#define UTE_OK          JNI_OK
+#define UTE_ERROR       JNI_ERR
+#define UTE_BADVERSION  JNI_EVERSION
+#define UTE_OUTOFMEMORY JNI_ENOMEM
+#define UTE_INVALID     JNI_EINVAL
+/*
+ * =============================================================================
+ *  Platform dependent calling conventions
+ * =============================================================================
+ */
+#define UTECALL     JNICALL
+#define UTEEXPORT   JNIEXPORT
+/*
+ * =============================================================================
+ *  RAS event semaphore - platform dependent portion
+ * =============================================================================
+ */
+#if !defined(UT_EVENT_SEM)
+#define UT_EVENT_SEM void *
+#endif
+  typedef struct utEventSem_pd
+  {
+    UT_EVENT_SEM sem;
+    volatile int flags;
+  } UtEventSem_pd;
+#define UT_SEM_WAITING 1
+#define UT_SEM_POSTED  2
+/*
+ * =============================================================================
+ * Constants for CPU type etc
+ * =============================================================================
+ */
+#define UT_HASTSC       0x0010
+#define UT_FAMILY       0x0F00
+#define UT_IS586        0x0500
+#define UT_FAMILY_MODEL 0x0FF0
+#define UT_PIII_MODEL7  0x0670
+#define UT_P4_MODEL     0x0F00
+#define UT_EXT_FAMILY   0x0F00000
+#if defined(__cplusplus)
+}
+#endif
+#endif  /* !_UTE_PD_H */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/vmi.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/vmi.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/vmi.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/vmi.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,279 @@
+/* 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 VMInterface
+ * @brief VM interface specification
+ */
+
+#if !defined(vmi_h)
+#define vmi_h
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+#include "jni.h"
+#include "hyport.h"
+#include "hyvmls.h"
+
+#include "zipsup.h"
+/**
+ * @enum vmiError
+ * Enumeration of all possible return codes from VM interface functions
+ */
+  typedef enum
+  {
+    VMI_ERROR_NONE = 0,                 /**< Success */
+    VMI_ERROR_UNKNOWN = 1,              /**< Unknown error */
+    VMI_ERROR_UNIMPLEMENTED = 2,        /**< Function has not been implemented */
+    VMI_ERROR_UNSUPPORTED_VERSION = 3,  /**< The requested VM interface version is not supported */
+    VMI_ERROR_OUT_OF_MEMORY = 4,        /**< Not enough memory was available to complete the request */
+    VMI_ERROR_NOT_FOUND = 5,            /**< The requested system property was not found */
+    VMI_ERROR_READ_ONLY = 6,            /**< An attempt was made to modify a read-only item */
+    vmiErrorEnsureWideEnum = 0x1000000  /* ensure 4-byte enum */
+  } vmiError;
+
+/**
+ * @enum vmiVersion
+ * VM interface version identifier
+ */
+  typedef enum
+  {
+    VMI_VERSION_UNKNOWN = 0x00000000,     /**< Unknown VMInterface version */
+    VMI_VERSION_1_0 = 0x00010000,         /**< VMInterface version 1.0 */
+    vmiVersionEnsureWideEnum = 0x1000000  /* ensure 4-byte enum */
+  } vmiVersion;
+
+/**
+ * @typedef vmiSystemPropertyIterator
+ * Specification of the iterator function to provide to IterateSystemProperties
+ *
+ * @code void iterator(char* key, char* value, void* userData); @endcode
+ */
+  typedef void (JNICALL * vmiSystemPropertyIterator) (char *key, char *value,
+                                                      void *userData);
+
+  struct VMInterface_;
+  struct VMInterfaceFunctions_;
+
+/**
+ * @typedef VMInterface
+ * The VM interface structure. Points to the @ref VMInterfaceFunctions_ "VM interface function table". 
+ * Implementations will likely choose to store opaque data off this structure.
+ */
+  typedef const struct VMInterfaceFunctions_ *VMInterface;
+
+/**
+ * @struct VMInterfaceFunctions_ 
+ * The VM interface function table.
+ * 
+ * Example usage:
+ * @code
+ * JavaVM* vm = (*vmi)->GetJavaVM(vmi);
+ * @endcode
+ */
+  struct VMInterfaceFunctions_
+  {
+    vmiError (JNICALL * CheckVersion) (VMInterface * vmi,
+      vmiVersion * version);
+    JavaVM *(JNICALL * GetJavaVM) (VMInterface * vmi);
+    HyPortLibrary *(JNICALL * GetPortLibrary) (VMInterface * vmi);
+    HyVMLSFunctionTable *(JNICALL * GetVMLSFunctions) (VMInterface * vmi);
+
+    HyZipCachePool *(JNICALL * GetZipCachePool) (VMInterface * vmi);
+    JavaVMInitArgs *(JNICALL * GetInitArgs) (VMInterface * vmi);
+    vmiError (JNICALL * GetSystemProperty) (VMInterface * vmi, char *key,
+      char **valuePtr);
+    vmiError (JNICALL * SetSystemProperty) (VMInterface * vmi, char *key,
+      char *value);
+    vmiError (JNICALL * CountSystemProperties) (VMInterface * vmi,
+      int *countPtr);
+    vmiError (JNICALL * IterateSystemProperties) (VMInterface * vmi,
+      vmiSystemPropertyIterator
+      iterator, void *userData);
+  };
+
+  /**
+  * Extract the VM interface from a JNIEnv
+  */
+  VMInterface *JNICALL VMI_GetVMIFromJNIEnv (JNIEnv * env);
+
+  /**
+  * Extract the VM interface from a JNI JavaVM
+  */
+  VMInterface *JNICALL VMI_GetVMIFromJavaVM (JavaVM * vm);
+
+/** 
+ *  Convenience macros for acquiring a VMInterface
+ */
+#define VMI_ACCESS_FROM_ENV(env) VMInterface* privateVMI = VMI_GetVMIFromJNIEnv(env)
+#define VMI_ACCESS_FROM_JAVAVM(javaVM) VMInterface* privateVMI = VMI_GetVMIFromJavaVM(javaVM)
+#define VMI privateVMI
+
+/**
+ * @fn VMInterfaceFunctions_::CheckVersion(VMInterface * vmi, vmiVersion * version)
+ * Check the version of the VM interface
+ *
+ * @code vmiError JNICALL CheckVersion(VMInterface* vmi, vmiVersion* version); @endcode
+ *
+ * @param[in] vmi  The VM interface pointer
+ * @param[in,out] version  Pass in the version to check, or @ref VMI_VERSION_UNKNOWN. Returns the current version.
+ *
+ * @return a @ref vmiError "VMI error code"
+ *
+ * @note The CheckVersion function allows a class library to verify that the VM provides the required interface functions.
+ * If the version requested is @ref VMI_VERSION_UNKNOWN, then the function will reply with the current version and not return an error.
+ * If a specific version is passed, it will be compatibility checked against the current, and @ref VMI_ERROR_UNSUPPORTED_VERSION
+ * may be returned.
+ */
+  vmiError JNICALL CheckVersion (VMInterface * vmi, vmiVersion * version);
+
+/**
+ * @fn VMInterfaceFunctions_::GetJavaVM(VMInterface * vmi)
+ * Return the JNI JavaVM associated with the VM interface
+ *
+ * @code JavaVM* JNICALL GetJavaVM(VMInterface* vmi); @endcode
+ *
+ * @param[in] vmi  The VM interface pointer
+ *
+ * @return a JavaVM pointer
+ */
+  JavaVM *JNICALL GetJavaVM (VMInterface * vmi);
+
+/**
+ * @fn VMInterfaceFunctions_::GetPortLibrary(VMInterface * vmi)
+ * Return a pointer to an initialized HyPortLibrary structure.
+ * @code HyPortLibrary* JNICALL GetPortLibrary(VMInterface* vmi); @endcode
+ *
+ * The @ref hyport.h "port library" is a table of functions that implement useful platform specific
+ * capability. For example, file and socket manipulation, memory management, etc.
+ * It is the responsibility of the VM to create the port library.
+ *
+ * @param[in] vmi  The VM interface pointer
+ *
+ * @return the HyPortLibrary associated with the VMI
+ * 
+ * @see hyport.c
+ */
+  HyPortLibrary *JNICALL GetPortLibrary (VMInterface * vmi);
+
+/**
+ * @fn VMInterfaceFunctions_::GetVMLSFunctions(VMInterface * vmi)
+ * Return a pointer to a HyVMLSFunctionTable. This is a table of functions for allocating,
+ * freeing, getting, and setting thread local storage.
+ *
+ * @code HyVMLSFunctionTable* JNICALL GetVMLSFunctions(VMInterface* vmi); @endcode
+ *
+ * @param[in] vmi  The VM interface pointer
+ *
+ * @return the VM local storage function table
+ */
+  HyVMLSFunctionTable *JNICALL GetVMLSFunctions (VMInterface * vmi);
+
+/**
+ * @fn VMInterfaceFunctions_::GetZipCachePool(VMInterface * vmi)
+ * Return a pointer to the HyZipCachePool structure used by the VM. It is the
+ * responsibility of the vm to allocate the pool using zipCachePool_new().
+ *
+ * @code HyZipCachePool* JNICALL GetZipCachePool(VMInterface* vmi); @endcode
+ * 
+ * @param[in] vmi  The VM interface pointer
+ *
+ * @return a HyZipCachePool pointer
+ */
+  HyZipCachePool *JNICALL GetZipCachePool (VMInterface * vmi);
+
+/**
+ * @fn VMInterfaceFunctions_::GetInitArgs(VMInterface * vmi)
+ * Return a pointer to a JavaVMInitArgs structure as defined by the 1.2 JNI
+ * specification. This structure contains the arguments used to invoke the vm.
+ *
+ * @code JavaVMInitArgs* JNICALL GetInitArgs(VMInterface* vmi); @endcode
+ *
+ * @param[in] vmi  The VM interface pointer
+ *
+ * @return the VM invocation arguments
+ */
+  JavaVMInitArgs *JNICALL GetInitArgs (VMInterface * vmi);
+
+  /**
+  * Retrieve the value of a VM system property. 
+  * 
+  * @note The returned string is owned by the VM, and should not be freed.
+  */
+  vmiError JNICALL GetSystemProperty (VMInterface * vmi, char *key,
+    char **valuePtr);
+
+/**
+ * @fn VMInterfaceFunctions_::SetSystemProperty(VMInterface * vmi, char *key, char *value)
+ * Override the value of a VM system property
+ *
+ * @code vmiError JNICALL SetSystemProperty(VMInterface* vmi, char* key, char* value); @endcode
+ * 
+ * @param[in] vmi  The VM interface pointer
+ * @param[in] key  The system property to override
+ * @param[in] value  The value of the system property
+ *
+ * @return a @ref vmiError "VMI error code"
+ *
+ * @note Only existing properties can be overridden. New properties cannot be added by this mechanism.
+ *
+ * @note See  GetSystemProperty() for the list of properties that must be defined
+ * by the vm.
+ */
+  vmiError JNICALL SetSystemProperty (VMInterface * vmi, char *key,
+                                      char *value);
+
+/**
+ * @fn VMInterfaceFunctions_::CountSystemProperties(VMInterface * vmi, int *countPtr)
+ * Return the number of VM system properties
+ * 
+ * @code vmiError JNICALL CountSystemProperties(VMInterface* vmi, int* countPtr); @endcode
+ *
+ * @param[in] vmi  The VM interface pointer
+ * @param[out] countPtr The location to store the number of system properties
+ *
+ * @return a @ref vmiError "VMI error code"
+ *
+ * @note See  GetSystemProperty() for the list of properties that must be defined
+ * by the vm.
+ */
+  vmiError JNICALL CountSystemProperties (VMInterface * vmi, int *countPtr);
+
+/**
+ * @fn VMInterfaceFunctions_::IterateSystemProperties(VMInterface * vmi, vmiSystemPropertyIterator iterator, void *userData)
+ * Iterate over the VM system properties calling a function.
+ *
+ * 
+ * @param[in] vmi  The VM interface pointer
+ * @param[in] iterator  The iterator function to call with each property
+ * @param[in] userData  Opaque data to pass to the iterator function
+ *
+ * @return a @ref vmiError "VMI error code"
+ *
+ * @note The returned strings are owned by the VM, and should not be freed.
+ *
+ * @note See  GetSystemProperty() for the list of properties that must be defined
+ * by the vm.
+ */
+  vmiError JNICALL IterateSystemProperties (VMInterface * vmi,
+                                            vmiSystemPropertyIterator
+                                            iterator, void *userData);
+
+#if defined(__cplusplus)
+}
+#endif
+#endif  /* vmi_h */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/zipsup.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/zipsup.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/zipsup.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/include/zipsup.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,206 @@
+/* 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.
+ */
+
+/**
+* Zip Support Header
+*/
+
+#if !defined(ZIPSUP_H)
+#define ZIPSUP_H
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+#include "hyport.h"
+  typedef struct HyZipCachePool HyZipCachePool;
+
+#define ZIP_INTERNAL_MAX  80
+#define ZIP_CM_Reduced1  2
+#define ZIP_Unknown  0
+#define ZIP_GZIP  2
+#define ZIP_ERR_OUT_OF_MEMORY  -3
+#define ZIP_ERR_FILE_CORRUPT  -6
+#define ZIP_ERR_INTERNAL_ERROR  -11
+#define ZIP_CM_Imploded  6
+#define ZIP_CM_Reduced4  5
+#define ZIP_CM_Shrunk  1
+#define ZIP_CM_Reduced2  3
+#define ZIP_ERR_FILE_READ_ERROR  -1
+#define ZIP_CentralHeader  0x2014B50
+#define ZIP_ERR_FILE_CLOSE_ERROR  -10
+#define ZIP_ERR_BUFFER_TOO_SMALL  -7
+#define ZIP_CM_Reduced3  4
+#define ZIP_CM_Deflated  8
+#define ZIP_LocalHeader  0x4034B50
+#define ZIP_CM_Tokenized  7
+#define ZIP_PKZIP  1
+#define ZIP_CM_Stored  0
+#define ZIP_ERR_UNSUPPORTED_FILE_TYPE  -5
+#define ZIP_ERR_NO_MORE_ENTRIES  -2
+#define ZIP_CentralEnd  0x6054B50
+#define ZIP_ERR_FILE_OPEN_ERROR  -9
+#define ZIP_ERR_UNKNOWN_FILE_TYPE  -4
+#define ZIP_ERR_ENTRY_NOT_FOUND  -8
+#define ZIP_DataDescriptor  0x8074B50
+
+  typedef struct HyZipCache
+  {
+    U_8 *zipFileName;
+    IDATA zipFileSize;
+    I_64 zipTimeStamp;
+    IDATA startCentralDir;
+    struct HyPortLibrary *portLib;
+    void *cachePool;
+    void *cachePoolEntry;
+  } HyZipCache;
+
+#define HYSIZEOF_HyZipCache 32
+
+  typedef struct HyZipCentralEnd
+  {
+    U_16 diskNumber;
+    U_16 dirStartDisk;
+    U_16 thisDiskEntries;
+    U_16 totalEntries;
+    U_32 dirSize;
+    U_32 dirOffset;
+    U_16 commentLength;
+    char _hypadding0012[2];   /* 2 bytes of automatic padding */
+    U_8 *comment;
+  } HyZipCentralEnd;
+
+#define HYSIZEOF_HyZipCentralEnd 24
+
+  typedef struct HyZipDataDescriptor
+  {
+    U_32 crc32;
+    U_32 compressedSize;
+    U_32 uncompressedSize;
+  } HyZipDataDescriptor;
+
+#define HYSIZEOF_HyZipDataDescriptor 12
+
+  typedef struct HyZipEntry
+  {
+    U_8 *data;
+    U_8 *filename;
+    U_8 *extraField;
+    U_8 *fileComment;
+    I_32 dataPointer;
+    I_32 filenamePointer;
+    I_32 extraFieldPointer;
+    I_32 fileCommentPointer;
+    U_32 compressedSize;
+    U_32 uncompressedSize;
+    U_32 crc32;
+    U_16 filenameLength;
+    U_16 extraFieldLength;
+    U_16 fileCommentLength;
+    U_16 internalAttributes;
+    U_16 versionCreated;
+    U_16 versionNeeded;
+    U_16 flags;
+    U_16 compressionMethod;
+    U_16 lastModTime;
+    U_16 lastModDate;
+    U_8 internalFilename[80];
+  } HyZipEntry;
+
+#define HYSIZEOF_HyZipEntry 144
+
+  typedef struct HyZipFile
+  {
+    U_8 *filename;
+    struct HyZipCache *cache;
+    void *cachePool;
+    I_32 fd;
+    I_32 pointer;
+    U_8 internalFilename[80];
+    U_8 type;
+    char _hypadding0065[3];  /* 3 bytes of automatic padding */
+  } HyZipFile;
+
+#define HYSIZEOF_HyZipFile 104
+/* HySourceZipSupport*/
+  extern HY_CFUNC I_32 zip_getZipEntryData
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
+                HyZipEntry * entry, U_8 * buffer, U_32 bufferSize));
+  extern HY_CFUNC I_32 zip_getZipEntryFromOffset
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
+                HyZipEntry * entry, IDATA offset));
+  extern HY_CFUNC I_32 zip_establishCache
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile));
+  extern HY_CFUNC void zip_resetZipFile
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
+                IDATA * nextEntryPointer));
+  extern HY_CFUNC I_32 zip_getNextZipEntry
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
+                HyZipEntry * zipEntry, IDATA * nextEntryPointer));
+  extern HY_CFUNC I_32 zip_getZipEntry
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
+                HyZipEntry * entry, const char *filename,
+                BOOLEAN findDirectory));
+  extern HY_CFUNC I_32 zip_getZipEntryExtraField
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
+                HyZipEntry * entry, U_8 * buffer, U_32 bufferSize));
+  extern HY_CFUNC void zip_initZipEntry
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipEntry * entry));
+  extern HY_CFUNC I_32 zip_openZipFile
+    PROTOTYPE ((HyPortLibrary * portLib, char *filename, HyZipFile * zipFile,
+                HyZipCachePool * cachePool));
+  extern HY_CFUNC void zip_freeZipEntry
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipEntry * entry));
+  struct HyZipFile;
+  extern HY_CFUNC I_32 VMCALL zip_closeZipFile
+    PROTOTYPE ((HyPortLibrary * portLib, struct HyZipFile * zipFile));
+  extern HY_CFUNC I_32 zip_getZipEntryComment
+    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
+                HyZipEntry * entry, U_8 * buffer, U_32 bufferSize));
+/* HySourceZipCache*/
+  extern HY_CFUNC UDATA zipCache_findElement
+    PROTOTYPE ((HyZipCache * zipCache, const char *elementName,
+                BOOLEAN searchDirList));
+  extern HY_CFUNC void zipCache_kill PROTOTYPE ((HyZipCache * zipCache));
+  extern HY_CFUNC IDATA zipCache_enumGetDirName
+    PROTOTYPE ((void *handle, char *nameBuf, UDATA nameBufSize));
+  extern HY_CFUNC HyZipCache *zipCache_new
+    PROTOTYPE ((HyPortLibrary * portLib, char *zipName, IDATA zipNameLength));
+  extern HY_CFUNC IDATA zipCache_enumNew
+    PROTOTYPE ((HyZipCache * zipCache, char *directoryName, void **handle));
+  extern HY_CFUNC IDATA zipCache_enumElement
+    PROTOTYPE ((void *handle, char *nameBuf, UDATA nameBufSize,
+                UDATA * offset));
+  extern HY_CFUNC void zipCache_enumKill PROTOTYPE ((void *handle));
+  extern HY_CFUNC BOOLEAN zipCache_addElement
+    PROTOTYPE ((HyZipCache * zipCache, char *elementName,
+                UDATA elementOffset));
+/* HySourceZipCachePool*/
+  extern HY_CFUNC BOOLEAN zipCachePool_release
+    PROTOTYPE ((HyZipCachePool * zcp, HyZipCache * zipCache));
+  extern HY_CFUNC void zipCachePool_kill PROTOTYPE ((HyZipCachePool * zcp));
+  extern HY_CFUNC HyZipCache *zipCachePool_findCache
+    PROTOTYPE ((HyZipCachePool * zcp, char const *zipFileName,
+                IDATA zipFileNameLength, IDATA zipFileSize,
+                I_64 zipTimeStamp));
+  extern HY_CFUNC HyZipCachePool *zipCachePool_new
+    PROTOTYPE ((HyPortLibrary * portLib));
+  extern HY_CFUNC BOOLEAN zipCachePool_addCache
+    PROTOTYPE ((HyZipCachePool * zcp, HyZipCache * zipCache));
+  extern HY_CFUNC BOOLEAN zipCachePool_addRef
+    PROTOTYPE ((HyZipCachePool * zcp, HyZipCache * zipCache));
+#if defined(__cplusplus)
+}
+#endif
+#endif /* ZIPSUP_H */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/cmain.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/cmain.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/cmain.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/cmain.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,118 @@
+/* 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"
+#include "hyport.h"
+#include "hythread.h" /* TPE */
+#include <stdlib.h>     /* for malloc for atoe and abort */
+
+struct haCmdlineOptions
+{
+  int argc;
+  char **argv;
+  char **envp;
+  HyPortLibrary *portLibrary;
+};
+extern UDATA VMCALL gpProtectedMain (void *arg);
+
+static UDATA VMCALL
+genericSignalHandler (struct HyPortLibrary *portLibrary, U_32 gpType,
+              void *gpInfo, void *userData)
+{
+  PORT_ACCESS_FROM_PORT (portLibrary);
+  U_32 category;
+
+  hytty_printf (PORTLIB, "\nAn unhandled error (%d) has occurred.\n", gpType);
+
+  for (category = 0; category < HYPORT_SIG_NUM_CATEGORIES; category++)
+    {
+      U_32 infoCount = hysig_info_count (gpInfo, category);
+      U_32 infoKind, index;
+      void *value;
+      const char *name;
+
+      for (index = 0; index < infoCount; index++)
+        {
+          infoKind = hysig_info (gpInfo, category, index, &name, &value);
+
+          switch (infoKind)
+            {
+              case HYPORT_SIG_VALUE_32:
+                hytty_printf (PORTLIB, "%s=%08.8x\n", name, *(U_32 *) value);
+                break;
+              case HYPORT_SIG_VALUE_64:
+              case HYPORT_SIG_VALUE_FLOAT_64:
+                hytty_printf (PORTLIB, "%s=%016.16llx\n", name,
+                  *(U_64 *) value);
+                break;
+              case HYPORT_SIG_VALUE_STRING:
+                hytty_printf (PORTLIB, "%s=%s\n", name, (const char *) value);
+                break;
+              case HYPORT_SIG_VALUE_ADDRESS:
+                hytty_printf (PORTLIB, "%s=%p\n", name, *(void **) value);
+                break;
+            }
+        }
+    }
+
+  abort ();
+
+  /* UNREACHABLE */
+  return 0;
+}
+
+static UDATA VMCALL
+signalProtectedMain (HyPortLibrary * portLibrary, void *arg)
+{
+  return gpProtectedMain (arg);
+}
+
+int
+main (int argc, char **argv, char **envp)
+{
+  HyPortLibrary hyportLibrary;
+  HyPortLibraryVersion portLibraryVersion;
+  struct haCmdlineOptions options;
+  int rc = 257;
+  UDATA result;
+
+  /* Use portlibrary version which we compiled against, and have allocated space
+   * for on the stack.  This version may be different from the one in the linked DLL.
+   */
+  HYPORT_SET_VERSION (&portLibraryVersion, HYPORT_CAPABILITY_MASK);
+  if (0 ==
+      hyport_init_library (&hyportLibrary, &portLibraryVersion,
+               sizeof (HyPortLibrary)))
+    {
+      options.argc = argc;
+      options.argv = argv;
+      options.envp = envp;
+      options.portLibrary = &hyportLibrary;
+
+      if (hyportLibrary.sig_protect (&hyportLibrary,
+                     signalProtectedMain, &options,
+                     genericSignalHandler, NULL,
+                     HYPORT_SIG_FLAG_SIGALLSYNC,
+                     &result) == 0)
+    {
+      rc = result;
+    }
+
+	  hythread_attach(NULL); /* TPE */
+      hyportLibrary.port_shutdown_library (&hyportLibrary);
+    }
+
+  return rc;
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/hyexelibnls.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/hyexelibnls.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/hyexelibnls.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/hyexelibnls.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,61 @@
+/* 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.
+ */
+
+#if !defined(hyexelibnls_h)
+#define hyexelibnls_h
+#include "hyport.h"
+/* 0x4558454c = EXEL */
+
+#define HYNLS_EXELIB_VERSION__MODULE 0x4558454c
+#define HYNLS_EXELIB_VERSION__ID 50
+#define HYNLS_EXELIB_VERSION HYNLS_EXELIB_VERSION__MODULE, HYNLS_EXELIB_VERSION__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY__ID 51
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_TO_FIND_JLS__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_TO_FIND_JLS__ID 52
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_TO_FIND_JLS HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_TO_FIND_JLS__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_TO_FIND_JLS__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BA__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BA__ID 53
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BA HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BA__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BA__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_CLASSNAME__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_CLASSNAME__ID 54
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_CLASSNAME HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_CLASSNAME__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_CLASSNAME__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY_CONVERTING__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY_CONVERTING__ID 55
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY_CONVERTING HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY_CONVERTING__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY_CONVERTING__ID
+#define HYNLS_EXELIB_CLASS_DOES_NOT_IMPL_MAIN__MODULE 0x4558454c
+#define HYNLS_EXELIB_CLASS_DOES_NOT_IMPL_MAIN__ID 56
+#define HYNLS_EXELIB_CLASS_DOES_NOT_IMPL_MAIN HYNLS_EXELIB_CLASS_DOES_NOT_IMPL_MAIN__MODULE, HYNLS_EXELIB_CLASS_DOES_NOT_IMPL_MAIN__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_ARG_ARRAY__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_ARG_ARRAY__ID 57
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_ARG_ARRAY HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_ARG_ARRAY__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_ARG_ARRAY__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BYTE_ARRAY__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BYTE_ARRAY__ID 58
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BYTE_ARRAY HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BYTE_ARRAY__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_BYTE_ARRAY__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_ARG__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_ARG__ID 59
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_ARG HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_ARG__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JLS_FOR_ARG__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_SET_ARRAY_ELEM__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_SET_ARRAY_ELEM__ID 60
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_SET_ARRAY_ELEM HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_SET_ARRAY_ELEM__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_SET_ARRAY_ELEM__ID
+#define HYNLS_EXELIB_VM_STARTUP_ERR_OUT_OF_MEMORY__MODULE 0x4558454c
+#define HYNLS_EXELIB_VM_STARTUP_ERR_OUT_OF_MEMORY__ID 61
+#define HYNLS_EXELIB_VM_STARTUP_ERR_OUT_OF_MEMORY HYNLS_EXELIB_VM_STARTUP_ERR_OUT_OF_MEMORY__MODULE, HYNLS_EXELIB_VM_STARTUP_ERR_OUT_OF_MEMORY__ID
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JAVA_VM__MODULE 0x4558454c
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JAVA_VM__ID 62
+#define HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JAVA_VM HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JAVA_VM__MODULE, HYNLS_EXELIB_INTERNAL_VM_ERR_FAILED_CREATE_JAVA_VM__ID
+
+#endif // hyexelibnls_h

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/java.rc
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/java.rc?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/java.rc (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/java.rc Wed Nov 30 21:29:27 2005
@@ -0,0 +1,49 @@
+;
+; 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 <windows.h>
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 0,1,0,0
+ PRODUCTVERSION 0,1,0,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS VOS_NT_WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE 0x0L
+BEGIN
+	BLOCK "StringFileInfo"
+	BEGIN
+		BLOCK "040904b0"
+		BEGIN
+			VALUE "CompanyName", "The Apache Software Foundation.\0"
+			VALUE "FileDescription", "VM launcher\0"
+			VALUE "FileVersion", "0.1\0"
+			VALUE "InternalName", "launcher\0"
+			VALUE "LegalCopyright", "(c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.\0"
+			VALUE "OriginalFilename", "java.exe\0"
+			VALUE "ProductName", "Apache Harmony\0"
+			VALUE "ProductVersion", "0.1\0"
+		END
+	END
+	BLOCK "VarFileInfo"
+	BEGIN
+		VALUE "Translation", 0x0409, 1200
+	END
+END
+
+100	ICON	DISCARDABLE	"../include/apache.ico"

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/javaw.rc
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/javaw.rc?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/javaw.rc (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/javaw.rc Wed Nov 30 21:29:27 2005
@@ -0,0 +1,49 @@
+;
+; Copyright 2003, 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 <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 0,1,0,0
+ PRODUCTVERSION 0,1,0,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS VOS_NT_WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE 0x0L
+BEGIN
+	BLOCK "StringFileInfo"
+	BEGIN
+		BLOCK "040904b0"
+		BEGIN
+			VALUE "CompanyName", "The Apache Software Foundation.\0"
+			VALUE "FileDescription", "VM launcher\0"
+			VALUE "FileVersion", "0.1\0"
+			VALUE "InternalName", "launcher\0"
+			VALUE "LegalCopyright", "(c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.\0"
+			VALUE "OriginalFilename", "javaw.exe\0"
+			VALUE "ProductName", "Apache Harmony\0"
+			VALUE "ProductVersion", "0.1\0"
+		END
+	END
+	BLOCK "VarFileInfo"
+	BEGIN
+		VALUE "Translation", 0x0409, 1200
+	END
+END
+
+100	ICON	DISCARDABLE	"../include/apache.ico"

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/launcher_copyright.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/launcher_copyright.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/launcher_copyright.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/launcher_copyright.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,19 @@
+/* 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.
+ */
+
+/* A copyright string included in each DLL and executable */
+
+const char hyCopyright[] =
+  "(c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.";

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/libhlp.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/libhlp.c?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/libhlp.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/libhlp.c Wed Nov 30 21:29:27 2005
@@ -0,0 +1,309 @@
+/* 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 <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "hyport.h"
+#include "libhlp.h"
+
+#define HY_PATH_SLASH DIR_SEPARATOR
+
+I_32
+main_appendToClassPath (HyPortLibrary * portLib, U_16 sep,
+            HyStringBuffer ** classPath, char *toAppend)
+{
+
+  /* append a separator, first */
+  if (*classPath && (*classPath)->data[strlen ((*classPath)->data)] != sep)
+    {
+      char separator[2];
+      separator[0] = (char) sep;
+      separator[1] = '\0';
+      *classPath = strBufferCat (portLib, *classPath, separator);
+      if (*classPath == NULL)
+        return -1;
+    }
+
+  *classPath = strBufferCat (portLib, *classPath, toAppend);
+  if (*classPath == NULL)
+    return -1;
+
+  return 0;
+}
+
+/* Allocates and retrieves initial value of the classPath. */
+
+I_32
+main_initializeClassPath (HyPortLibrary * portLib,
+              HyStringBuffer ** classPath)
+{
+  PORT_ACCESS_FROM_PORT (portLib);
+  I_32 rc;
+  char *envvars = "CLASSPATH\0classpath\0";
+  char *envvar;
+
+  for (envvar = envvars; *envvar; envvar += strlen (envvar) + 1)
+    {
+      rc = hysysinfo_get_env (envvar, NULL, 0);
+      if (rc > 0)
+        {
+          *classPath = strBufferEnsure (portLib, *classPath, rc);
+          if (*classPath == NULL)
+            return -1;
+          hysysinfo_get_env (envvar,
+            (*classPath)->data + strlen ((*classPath)->data),
+            rc);
+          (*classPath)->remaining -= rc;
+          break;
+        }
+    }
+
+  return 0;
+}
+
+IDATA
+main_initializeJavaHome (HyPortLibrary * portLib,
+             HyStringBuffer ** finalJavaHome, int argc,
+             char **argv)
+{
+  char *javaHome = NULL;
+  char *javaHomeModifiablePart = NULL;
+  char *p;
+  IDATA retval = -1;
+  I_32 rc;
+  UDATA isUpper = TRUE;
+  char *envvars = "JAVA_HOME\0java_home\0";
+  char *envvar;
+
+  PORT_ACCESS_FROM_PORT (portLib);
+
+  for (envvar = envvars; *envvar; envvar += strlen (envvar) + 1)
+    {
+      rc = hysysinfo_get_env (envvar, NULL, 0);
+    if (rc > 0)
+      {
+        *finalJavaHome = strBufferEnsure (portLib, *finalJavaHome, rc);
+        if (*finalJavaHome == NULL)
+          return -1;
+        hysysinfo_get_env (envvar,
+          (*finalJavaHome)->data +
+          strlen ((*finalJavaHome)->data), rc);
+        (*finalJavaHome)->remaining -= rc;
+        return 0;
+      }
+    }
+
+  /* Compute the proper value for the var. */
+
+  if ((argc < 1) || !argv)
+    return -1;
+
+  retval = hysysinfo_get_executable_name (argv[0], &javaHome);
+  if (retval)
+    {
+      /* guess.  How about ".."? */
+      *finalJavaHome = strBufferCat (portLib, *finalJavaHome, "..");
+      return 0;
+    }
+
+  javaHomeModifiablePart = javaHome;
+#if defined(WIN32)
+  /* Make sure we don't modify a drive specifier in a pathname. */
+  if ((strlen (javaHome) > 2) && (javaHome[1] == ':'))
+    {
+      javaHomeModifiablePart = javaHome + 2;
+      if (javaHome[2] == HY_PATH_SLASH)
+        javaHomeModifiablePart++;
+    }
+#endif
+
+#if defined(WIN32)
+  /* Make sure we don't modify the root of a UNC pathname. */
+  if ((strlen (javaHome) > 2) && (javaHome[0] == HY_PATH_SLASH)
+    && (javaHome[1] == HY_PATH_SLASH))
+    {
+      javaHomeModifiablePart = javaHome + 2;
+      /* skip over the machine name */
+      while (*javaHomeModifiablePart
+        && (*javaHomeModifiablePart != HY_PATH_SLASH))
+        {
+          javaHomeModifiablePart++;
+        }
+      if (*javaHomeModifiablePart)
+        javaHomeModifiablePart++;
+      /* skip over the share name */
+      while (*javaHomeModifiablePart
+        && (*javaHomeModifiablePart != HY_PATH_SLASH))
+        {
+          javaHomeModifiablePart++;
+        }
+    }
+#endif
+
+  if ((javaHomeModifiablePart == javaHome) && javaHome[0] == HY_PATH_SLASH)
+    {
+      /* make sure we don't modify a root slash. */
+      javaHomeModifiablePart++;
+    }
+
+  /* Note: if sysinfo_get_executable_name claims we were invoked from a root directory, */
+  /* then this code will return that root directory for java.home also. */
+  p = strrchr (javaHomeModifiablePart, HY_PATH_SLASH);
+  if (!p)
+    {
+      javaHomeModifiablePart[0] = '\0'; /* chop off whole thing! */
+    }
+  else
+    {
+      p[0] = '\0';      /* chop off trailing slash and executable name. */
+      p = strrchr (javaHomeModifiablePart, HY_PATH_SLASH);
+      if (!p)
+        {
+          javaHomeModifiablePart[0] = '\0'; /* chop off the rest */
+        }
+      else
+        {
+          p[0] = '\0';      /* chop off trailing slash and deepest subdirectory. */
+        }
+    }
+
+  *finalJavaHome = strBufferCat (portLib, *finalJavaHome, javaHome);
+
+  hymem_free_memory (javaHome);
+
+  return 0;
+}
+
+IDATA
+main_initializeJavaLibraryPath (HyPortLibrary * portLib,
+                HyStringBuffer ** finalJavaLibraryPath,
+                char *argv0)
+{
+#if defined(WIN32)
+#define ENV_PATH "PATH"
+#else
+#define ENV_PATH "LD_LIBRARY_PATH"
+#endif
+
+  HyStringBuffer *javaLibraryPath = NULL;
+  char *exeName = NULL;
+  IDATA rc = -1;
+  char *p;
+  char *envResult;
+  int envSize;
+#define ENV_BUFFER_SIZE 80
+  char envBuffer[ENV_BUFFER_SIZE];
+  char sep[2];
+  PORT_ACCESS_FROM_PORT (portLib);
+
+  sep[0] = (char) hysysinfo_get_classpathSeparator ();
+  sep[1] = '\0';
+
+  if (hysysinfo_get_executable_name (argv0, &exeName))
+    {
+      goto done;
+    }
+  p = strrchr (exeName, HY_PATH_SLASH);
+  if (p)
+    {
+      p[1] = '\0';
+    }
+  else
+    {
+      hymem_free_memory (exeName);
+      exeName = NULL;
+    }
+
+  envSize = hysysinfo_get_env (ENV_PATH, NULL, 0);
+  if (envSize > 0)
+    {
+      if (envSize >= ENV_BUFFER_SIZE)
+        {
+          envResult = hymem_allocate_memory (envSize + 1);
+          if (!envResult)
+            goto done;
+          hysysinfo_get_env (ENV_PATH, envResult, envSize);
+        }
+      else
+        {
+          envSize = -1;     /* make it -1 so we don't free the buffer */
+          hysysinfo_get_env (ENV_PATH, envBuffer, ENV_BUFFER_SIZE);
+          envResult = envBuffer;
+        }
+    }
+  else
+    {
+      envResult = NULL;
+    }
+
+  /* Add one to each length to account for the separator character.  Add 2 at the end for the "." and NULL terminator */
+
+  if (exeName)
+    {
+      javaLibraryPath = strBufferCat (portLib, javaLibraryPath, exeName);
+      javaLibraryPath = strBufferCat (portLib, javaLibraryPath, sep);
+    }
+  javaLibraryPath = strBufferCat (portLib, javaLibraryPath, ".");
+  if (envResult)
+    {
+      javaLibraryPath = strBufferCat (portLib, javaLibraryPath, sep);
+      javaLibraryPath = strBufferCat (portLib, javaLibraryPath, envResult);
+      if (envSize != -1)
+        {
+          hymem_free_memory (envResult);
+        }
+    }
+
+  rc = 0;
+
+done:
+  if (exeName)
+    {
+      hymem_free_memory (exeName);
+    }
+  *finalJavaLibraryPath = javaLibraryPath;
+  return rc;
+
+}
+
+IDATA
+convertString (JNIEnv * env, HyPortLibrary * hyportLibrary,
+           jclass stringClass, jmethodID stringMid, char *chars,
+           jstring * str)
+{
+  UDATA strLength;
+  jarray bytearray;
+  jstring string;
+
+  strLength = strlen (chars);
+  bytearray = (*env)->NewByteArray (env, strLength);
+  if (((*env)->ExceptionCheck (env)))
+    return 1;
+
+  (*env)->SetByteArrayRegion (env, bytearray, (UDATA) 0, strLength, chars);
+
+  string =
+    (*env)->NewObject (env, stringClass, stringMid, bytearray, (UDATA) 0,
+               strLength);
+  if (!string)
+    return 2;
+
+  (*env)->DeleteLocalRef (env, bytearray);
+
+  *str = string;
+  return 0;
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/libhlp.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/libhlp.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/libhlp.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/win.IA32/launcher/libhlp.h Wed Nov 30 21:29:27 2005
@@ -0,0 +1,68 @@
+/* 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(LIBHLP_H)
+#define LIBHLP_H
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+#include "hycomp.h"
+#include "hyport.h"
+#include "jni.h"
+
+  typedef struct HyStringBuffer
+  {
+    UDATA remaining;
+    U_8 data[4];
+  } HyStringBuffer;
+#define HYSIZEOF_HyStringBuffer 8
+  struct haCmdlineOptions
+  {
+    int argc;
+    char **argv;
+    char **envp;
+    HyPortLibrary *portLibrary;
+  };
+  struct HyPortLibrary;
+  extern HY_CFUNC HyStringBuffer *strBufferCat
+    PROTOTYPE ((struct HyPortLibrary * portLibrary, HyStringBuffer * buffer,
+    const char *string));
+  extern HY_CFUNC char *strBufferData PROTOTYPE ((HyStringBuffer * buffer));
+  struct HyPortLibrary;
+  extern HY_CFUNC HyStringBuffer *strBufferPrepend
+    PROTOTYPE ((struct HyPortLibrary * portLibrary, HyStringBuffer * buffer,
+    char *string));
+  struct HyPortLibrary;
+  extern HY_CFUNC HyStringBuffer *strBufferEnsure
+    PROTOTYPE ((struct HyPortLibrary * portLibrary, HyStringBuffer * buffer,
+    UDATA len));
+  extern HY_CFUNC void dumpVersionInfo PROTOTYPE ((HyPortLibrary * portLib));
+  extern HY_CFUNC int main_runJavaMain
+    PROTOTYPE ((JNIEnv * env, char *mainClassName, int nameIsUTF,
+    int java_argc, char **java_argv,
+    HyPortLibrary * hyportLibrary));
+  extern HY_CFUNC IDATA main_initializeJavaLibraryPath
+    PROTOTYPE ((HyPortLibrary * portLib,
+    HyStringBuffer ** finalJavaLibraryPath, char *argv0));
+  extern HY_CFUNC I_32 main_initializeClassPath
+    PROTOTYPE ((HyPortLibrary * portLib, HyStringBuffer ** classPath));
+  extern HY_CFUNC IDATA main_initializeJavaHome
+    PROTOTYPE ((HyPortLibrary * portLib, HyStringBuffer ** finalJavaHome,
+    int argc, char **argv));
+#if defined(__cplusplus)
+}
+#endif
+#endif        /* LIBHLP_H */



Mime
View raw message