You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2006/01/02 07:02:54 UTC

svn commit: r365299 - in /webservices/axis2/trunk/c/modules/platforms/windows: ./ axis2_windows.c axis2_windows.h

Author: nandika
Date: Sun Jan  1 22:02:48 2006
New Revision: 365299

URL: http://svn.apache.org/viewcvs?rev=365299&view=rev
Log: (empty)

Added:
    webservices/axis2/trunk/c/modules/platforms/windows/
    webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.c
    webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.h

Added: webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.c?rev=365299&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.c (added)
+++ webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.c Sun Jan  1 22:02:48 2006
@@ -0,0 +1,52 @@
+/*
+ *   Copyright 2004-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+ *
+ *   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/axis2_windows.h>
+#include <stdio.h>
+
+/*
+
+std::string* getPlatformErrorMessage(long errorNumber)
+{
+	std::string* returningString = new std::string();
+    LPVOID lpMsgBuf;
+
+	FormatMessage(
+	FORMAT_MESSAGE_ALLOCATE_BUFFER | 
+	FORMAT_MESSAGE_FROM_SYSTEM,
+	NULL,
+	errorNumber,
+	MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+	(LPTSTR) &lpMsgBuf,
+	0, NULL );
+
+	returningString->append((LPTSTR)lpMsgBuf);
+    LocalFree(lpMsgBuf);
+		    
+    return returningString;
+}
+*/
+HMODULE callLoadLib(LPCTSTR lib)
+{
+
+        SetErrorMode(SEM_FAILCRITICALERRORS); //Disable display of the critical-error-handler message box
+        return LoadLibrary(lib);
+}
+
+
+

Added: webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.h?rev=365299&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.h (added)
+++ webservices/axis2/trunk/c/modules/platforms/windows/axis2_windows.h Sun Jan  1 22:02:48 2006
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+
+
+#ifndef AXIS2_WINDOWS_H
+#define AXIS2_WINDOWS_H
+
+/**
+  * @file axis2_unix.h
+  * @brief axis2 unix platform specific interface
+  */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_unix Platform Specific 
+ * @ingroup axis2_platforms_unix
+ * @{
+ */
+
+#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
+#include <windows.h>
+
+/***************************************************************
+ * Default paths to shared library/DLLs and files
+ ***************************************************************
+ */
+ 
+#define AXIS2_PLATFORM_DEFAULT_DEPLOY_PATH ""
+
+#define AXIS2_PLATFORM_XMLPARSER_PATH      "axis2_parser.dll"
+#define AXIS2_PLATFORM_TRANSPORTHTTP_PATH  "http_transport.dll"
+#define AXIS2_PLATFORM_CHANNEL_PATH        "http_channel.dll"
+#define AXIS2_PLATFORM_SSLCHANNEL_PATH     "Unknown"
+
+#define AXIS2_PLATFORM_LOG_PATH            ""
+#define AXIS2_PLATFORM_CLIENTLOG_PATH      ""
+#define AXIS2_PLATFORM_CONFIG_PATH         ""
+#define AXIS2_PLATFORM_SECUREINFO			 ""
+
+
+// =============================================================
+// Library loading and procedure resolution
+// =============================================================
+#define DLHandler HINSTANCE
+#define RTLD_LAZY 0    // not sure this is needed?
+
+#define AXIS2_PLATFORM_LOADLIBINIT()
+#define AXIS2_PLATFORM_LOADLIB(_lib)     callLoadLib(_lib)
+#define AXIS2_PLATFORM_UNLOADLIB         FreeLibrary
+#define AXIS2_PLATFORM_GETPROCADDR       GetProcAddress
+#define AXIS2_PLATFORM_LOADLIBEXIT()
+#define AXIS2_PLATFORM_LOADLIB_ERROR     ""
+
+// =============================================================
+// National Language Support
+// =============================================================
+
+// STRTOASC is to translate single byte 'native' character representation to ASCII
+// ASCTOSTR is to translate single byte ascii representation to 'native' character
+// CANNOT be used with constants
+#define AXIS2_PLATFORM_STRTOASC( x ) ( x )
+#define AXIS2_PLATFORM_ASCTOSTR( x ) ( x )
+
+// =============================================================
+// Miscellaneous
+// =============================================================
+#define AXIS2_PLATFORM_SLEEP(x) Sleep(0);
+
+/**
+ * Get the last error code from the system.
+ * Please ensure that this is a thread safe implementation
+ * and that it returns a long
+ * @return long the lsat error message for this thread
+ */
+#define AXIS2_GETLASTERROR GetLastError();
+
+/**
+ * From the last error number get a sensible std::string representing it
+ * @param errorNumber the error Number you are trying to get a message for
+ * @return the error message. NOTE: The caller is responsible for deleting the returned string
+ */
+#define AXIS2_PLATFORM_GET_ERROR_MESSAGE(errorNumber) getPlatformErrorMessage(errorNumber);
+
+/**
+ * type to be used for 64bit integers
+ */
+#define AXIS2_LONGLONG __int64
+
+/**
+ * Format string to be used in printf for 64bit integers
+ */
+#define AXIS2_PRINTF_LONGLONG_FORMAT_SPECIFIER "%I64d"
+#define AXIS2_PRINTF_LONGLONG_FORMAT_SPECIFIER_CHARS "I64d"
+
+HMODULE callLoadLib(LPCTSTR lib);
+
+/**
+ * Platform specific path separator char
+ */
+#define AXIS2_PATH_SEP_CHAR "/"
+
+/**
+ * Platform specific time
+ */
+#define AXIS2_TIME_T time_t
+
+/**
+ * Platform specific file handling
+ */
+#define AXIS2_R_OK R_OK /* test for read permission */
+#define AXIS2_W_OK W_OK /* test for write permission */
+#define AXIS2_X_OK X_OK /* test for execute or search permission */
+#define AXIS2_F_OK F_OK /* test whether the directories leading to the file can be 
+                      searched and the file exists */
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+#endif /*  AXIS2_WINDOWS_H */
+
+