You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2005/06/01 20:18:38 UTC

svn commit: r179393 [5/5] - in /xerces/c/branches/jberry/3.0-unstable: ./ lib/ m4/ obj/ samples/ src/ src/xercesc/util/ src/xercesc/util/AtomicOpManagers/ src/xercesc/util/FileManagers/ src/xercesc/util/MutexManagers/ src/xercesc/util/NetAccessors/WinSock/ src/xercesc/util/Transcoders/Win32/

Added: xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/MutexManagers/WindowsMutexMgr.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/MutexManagers/WindowsMutexMgr.cpp?rev=179393&view=auto
==============================================================================
--- xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/MutexManagers/WindowsMutexMgr.cpp (added)
+++ xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/MutexManagers/WindowsMutexMgr.cpp Wed Jun  1 11:18:35 2005
@@ -0,0 +1,70 @@
+/*
+ * Copyright 1999-2000,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.
+ */
+
+/*
+ * $Id: WindowsMutexMgr.cpp 179230 2005-05-31 16:09:28Z amassari $
+ */
+
+#include <windows.h>
+
+#include <xercesc/util/MutexManagers/WindowsMutexMgr.hpp>
+#include <xercesc/framework/MemoryManager.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+WindowsMutexMgr::WindowsMutexMgr()
+{
+}
+
+
+WindowsMutexMgr::~WindowsMutexMgr()
+{
+}
+
+
+XMLMutexHandle
+WindowsMutexMgr::create(MemoryManager* const manager)
+{
+    CRITICAL_SECTION* newCS=(CRITICAL_SECTION*)manager->allocate(sizeof(CRITICAL_SECTION));
+    InitializeCriticalSection(newCS);
+    return newCS;
+}
+
+
+void
+WindowsMutexMgr::destroy(XMLMutexHandle mtx, MemoryManager* const manager)
+{
+    ::DeleteCriticalSection((LPCRITICAL_SECTION)mtx);
+    manager->deallocate(mtx);
+}
+
+
+void
+WindowsMutexMgr::lock(XMLMutexHandle mtx)
+{
+    ::EnterCriticalSection((LPCRITICAL_SECTION)mtx);
+}
+
+
+void
+WindowsMutexMgr::unlock(XMLMutexHandle mtx)
+{
+    ::LeaveCriticalSection((LPCRITICAL_SECTION)mtx);
+}
+
+
+XERCES_CPP_NAMESPACE_END
+

Added: xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/MutexManagers/WindowsMutexMgr.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/MutexManagers/WindowsMutexMgr.hpp?rev=179393&view=auto
==============================================================================
--- xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/MutexManagers/WindowsMutexMgr.hpp (added)
+++ xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/MutexManagers/WindowsMutexMgr.hpp Wed Jun  1 11:18:35 2005
@@ -0,0 +1,48 @@
+/*
+ * Copyright 1999-2000,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.
+ */
+
+/*
+ * $Id: $
+ */
+
+#ifndef WINDOWSMUTEXMGR_HPP
+#define WINDOWSMUTEXMGR_HPP
+
+#include <xercesc/util/XMLMutexMgr.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+/*
+	The mutex manager to use on MS Windows platforms
+*/
+class WindowsMutexMgr : public XMLMutexMgr
+{
+    public:
+        WindowsMutexMgr();
+        virtual ~WindowsMutexMgr();
+
+		// Mutex operations
+		virtual XMLMutexHandle	create(MemoryManager* const manager);
+		virtual void			destroy(XMLMutexHandle mtx, MemoryManager* const manager);
+		virtual void			lock(XMLMutexHandle mtx);
+		virtual void			unlock(XMLMutexHandle mtx);
+};
+
+XERCES_CPP_NAMESPACE_END
+
+
+#endif
+

Propchange: xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/NetAccessors/WinSock/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jun  1 11:18:35 2005
@@ -0,0 +1 @@
+.deps

Modified: xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp?rev=179393&r1=179392&r2=179393&view=diff
==============================================================================
--- xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp (original)
+++ xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp Wed Jun  1 11:18:35 2005
@@ -100,8 +100,6 @@
  *
  */
 
-
-#define INCL_WINSOCK_API_TYPEDEFS 1
 #include <winsock2.h>
 #include <windows.h>
 #include <tchar.h>
@@ -119,6 +117,19 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
+
+typedef struct hostent *(WSAAPI * LPFN_GETHOSTBYNAME)(const char* name);
+typedef unsigned long(WSAAPI * LPFN_INET_ADDR)(const char* cp);
+typedef struct hostent *(WSAAPI * LPFN_GETHOSTBYADDR)(const char* addr, int len, int type);
+typedef u_short (WSAAPI * LPFN_HTONS)(u_short hostshort);
+typedef SOCKET (WSAAPI * LPFN_SOCKET)(int af, int type, int protocol);
+typedef int (WSAAPI * LPFN_CONNECT)(SOCKET s, const struct sockaddr* name, int namelen);
+typedef int (WSAAPI * LPFN_SEND)(SOCKET s, const char* buf, int len, int flags);
+typedef int (WSAAPI * LPFN_RECV)(SOCKET s, char* buf, int len, int flags);
+typedef int (WSAAPI * LPFN_SHUTDOWN)(SOCKET s, int how);
+typedef int (WSAAPI * LPFN_CLOSESOCKET)(SOCKET s);
+typedef int (WSAAPI * LPFN_WSACLEANUP)();
+typedef int (WSAAPI * LPFN_WSASTARTUP)(WORD wVersionRequested, LPWSADATA lpWSAData);
 
 static HMODULE gWinsockLib = NULL;
 static LPFN_GETHOSTBYNAME gWSgethostbyname = NULL;

Modified: xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp?rev=179393&r1=179392&r2=179393&view=diff
==============================================================================
--- xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp (original)
+++ xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp Wed Jun  1 11:18:35 2005
@@ -55,6 +55,9 @@
 #if XERCES_USE_FILEMGR_POSIX
 #	include <xercesc/util/FileManagers/PosixFileMgr.hpp>
 #endif
+#if XERCES_USE_FILEMGR_WINDOWS
+#	include <xercesc/util/FileManagers/WindowsFileMgr.hpp>
+#endif
 
 #include <xercesc/util/XMLMutexMgr.hpp>
 #if XERCES_USE_MUTEXMGR_NOTHREAD
@@ -63,6 +66,9 @@
 #if XERCES_USE_MUTEXMGR_POSIX
 #	include <xercesc/util/MutexManagers/PosixMutexMgr.hpp>
 #endif
+#if XERCES_USE_MUTEXMGR_WINDOWS
+#	include <xercesc/util/MutexManagers/WindowsMutexMgr.hpp>
+#endif
 
 #include <xercesc/util/XMLAtomicOpMgr.hpp>
 #if XERCES_USE_ATOMICOPMGR_NOTHREAD
@@ -74,6 +80,9 @@
 #if XERCES_USE_ATOMICOPMGR_MACOS
 #	include <xercesc/util/AtomicOpManagers/MacOSAtomicOpMgr.hpp>
 #endif
+#if XERCES_USE_ATOMICOPMGR_WINDOWS
+#	include <xercesc/util/AtomicOpManagers/WindowsAtomicOpMgr.hpp>
+#endif
 
 #include <xercesc/util/XMLNetAccessor.hpp>
 #if XERCES_USE_NETACCESSOR_CURL
@@ -114,6 +123,9 @@
 #if XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER
 #	include <xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp>
 #endif
+#if XERCES_USE_TRANSCODER_WINDOWS
+#	include <xercesc/util/Transcoders/Win32/Win32TransService.hpp>
+#endif
 
 XERCES_CPP_NAMESPACE_BEGIN
 
@@ -449,7 +461,9 @@
 	#elif defined (XERCES_USE_TRANSCODER_ICONV)
 		tc = new IconvTransService;
 	#elif defined (XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER)
-		tc = new MacOSUnicodeConverter();
+		tc = new MacOSUnicodeConverter;
+	#elif defined (XERCES_USE_TRANSCODER_WINDOWS)
+		tc = new Win32TransService;
 	#else
 		#error No Transcoder configured for platform! You must configure it.
 	#endif
@@ -468,6 +482,8 @@
 	
 	#if XERCES_USE_FILEMGR_POSIX
 		mgr = new (memmgr) PosixFileMgr;
+	#elif XERCES_USE_FILEMGR_WINDOWS
+		mgr = new (memmgr) WindowsFileMgr;
 	#else
 		#error No File Manager configured for platform! You must configure it.
 	#endif
@@ -678,6 +694,8 @@
 		mgr = new (memmgr) NoThreadMutexMgr;
 	#elif XERCES_USE_MUTEXMGR_POSIX
 		mgr = new (memmgr) PosixMutexMgr;
+	#elif XERCES_USE_MUTEXMGR_WINDOWS
+		mgr = new (memmgr) WindowsMutexMgr;
 	#else
 		#error No Mutex Manager configured for platform! You must configure it.
 	#endif
@@ -735,6 +753,8 @@
 		mgr = new (memmgr) PosixAtomicOpMgr;
 	#elif XERCES_USE_ATOMICOPMGR_MACOS
 		mgr = new (memmgr) MacOSAtomicOpMgr;
+	#elif XERCES_USE_ATOMICOPMGR_WINDOWS
+		mgr = new (memmgr) WindowsAtomicOpMgr;
 	#else
 		#error No AtomicOp Manager configured for platform! You must configure it.
 	#endif

Propchange: xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/Transcoders/Win32/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jun  1 11:18:35 2005
@@ -0,0 +1 @@
+.deps



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org