ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject svn commit: r384494 - in /webservices/axis/trunk/c: include/axis/Axis.h src/cbindings/AxisC.cpp
Date Thu, 09 Mar 2006 11:33:06 GMT
Author: prestonf
Date: Thu Mar  9 03:33:03 2006
New Revision: 384494

URL: http://svn.apache.org/viewcvs?rev=384494&view=rev
Log:
Modifications to these two files as the in-line prototype definition was causing trace to
fail.

Modified:
    webservices/axis/trunk/c/include/axis/Axis.h
    webservices/axis/trunk/c/src/cbindings/AxisC.cpp

Modified: webservices/axis/trunk/c/include/axis/Axis.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/include/axis/Axis.h?rev=384494&r1=384493&r2=384494&view=diff
==============================================================================
--- webservices/axis/trunk/c/include/axis/Axis.h (original)
+++ webservices/axis/trunk/c/include/axis/Axis.h Thu Mar  9 03:33:03 2006
@@ -81,8 +81,12 @@
   * 
   * @param fp - pointer to exception handler function.
   */
-AXISC_STORAGE_CLASS_INFO 
-void axiscRegisterExceptionHandler(void (*fp)(int errorCode, const char *errorString));
+
+// Create prototype for globalExceptionHandler.  This is to get round the
+// problems introduced by trace which cannot handle in-line prototyping.
+typedef void * __stdcall GlobalExceptionHandlerPrototype( int errorCode, const char * errorString);
+
+AXISC_STORAGE_CLASS_INFO void axiscRegisterExceptionHandler( void * fp);
 
 /**
   * Invokes the registered exception handler. If an exception handler was not

Modified: webservices/axis/trunk/c/src/cbindings/AxisC.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/cbindings/AxisC.cpp?rev=384494&r1=384493&r2=384494&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/cbindings/AxisC.cpp (original)
+++ webservices/axis/trunk/c/src/cbindings/AxisC.cpp Thu Mar  9 03:33:03 2006
@@ -16,104 +16,101 @@
  */
  
 #include <iostream>
-
 #include <axis/Axis.hpp>
 #include <axis/AxisException.hpp>
 
 AXIS_CPP_NAMESPACE_USE
 
 extern "C" {
-#include <axis/GDefine.h>
-#include <axis/AxisUserAPI.h>
-#include <axis/TypeMapping.h>
-#include <axis/Axis.h>
-
-static void (*global_exceptionHandler)(int errorCode, const char *errorString) = NULL;
-
-STORAGE_CLASS_INFO 
-int axiscInitializeAxis(AxiscBool bIsServer) 
-{
-    int rc = AXISC_SUCCESS;
-    
-    try 
-    {
-        Axis::initialize(0==bIsServer);
-    }
-    catch ( AxisException& e  )
-    {
-        axiscInvokeExceptionHandler(e.getExceptionCode(), e.what());
-        rc = AXISC_FAIL;    
-    }
-    catch ( ... )
-    {
-        axiscInvokeExceptionHandler(-1, "Unrecognized exception thrown.");
-        rc = AXISC_FAIL;
-    }
-    
-    return rc;
-} 
-
-STORAGE_CLASS_INFO 
-int axiscTerminate() 
-{
-    int rc = AXISC_SUCCESS;
-    
-    try 
-    {
-        Axis::terminate();
-    }
-    catch ( AxisException& e  )
-    {
-        axiscInvokeExceptionHandler(e.getExceptionCode(), e.what());
-        rc = AXISC_FAIL;    
-    }
-    catch ( ... )
-    {
-        axiscInvokeExceptionHandler(-1, "Unrecognized exception thrown.");
-        rc = AXISC_FAIL;
-    }
-    
-    return rc;
-}
-
-AXISC_STORAGE_CLASS_INFO 
-int axiscAxisDelete(void * pValue,  
-                    AXISC_XSDTYPE type)
-{
-    int rc = AXISC_SUCCESS;
-    
-    try 
-    {
-        Axis::AxisDelete(pValue, (XSDTYPE) type);
-    }
-    catch ( AxisException& e  )
-    {
-        axiscInvokeExceptionHandler(e.getExceptionCode(), e.what());
-        rc = AXISC_FAIL;    
-    }
-    catch ( ... )
-    {
-        axiscInvokeExceptionHandler(-1, "Unrecognized exception thrown.");
-        rc = AXISC_FAIL;
-    }    
-    
-    return rc;
-}
-
-AXISC_STORAGE_CLASS_INFO 
-void axiscRegisterExceptionHandler(void (*fp)(int errorCode, const char *errorString))
-{
-    global_exceptionHandler = fp;
-}
-
-
-AXISC_STORAGE_CLASS_INFO 
-void axiscInvokeExceptionHandler(int errorCode, const char *errorString)
-{
-    if (global_exceptionHandler)
-        global_exceptionHandler(errorCode, errorString);
-    else
-        cerr <<  "AXIS EXCEPTION: (" << errorCode << ") " << errorString
<< endl;
-}
-
+	#include <axis/GDefine.h>
+	#include <axis/AxisUserAPI.h>
+	#include <axis/TypeMapping.h>
+	#include <axis/Axis.h>
+
+// Create an object using the GlobalExceptionHandlerPrototype prototype.
+	static GlobalExceptionHandlerPrototype * global_exceptionHandler = NULL;
+
+	STORAGE_CLASS_INFO int axiscInitializeAxis( AxiscBool bIsServer) 
+	{
+		int rc = AXISC_SUCCESS;
+	    
+		try 
+		{
+			Axis::initialize( 0 == bIsServer);
+		}
+		catch( AxisException& e)
+		{
+			axiscInvokeExceptionHandler( e.getExceptionCode(), e.what());
+
+			rc = AXISC_FAIL;    
+		}
+		catch( ...)
+		{
+			rc = AXISC_FAIL;
+		}
+	    
+		return rc;
+	} 
+
+	STORAGE_CLASS_INFO int axiscTerminate() 
+	{
+		int rc = AXISC_SUCCESS;
+	    
+		try 
+		{
+			Axis::terminate();
+		}
+		catch( AxisException& e)
+		{
+			axiscInvokeExceptionHandler( e.getExceptionCode(), e.what());
+
+			rc = AXISC_FAIL;    
+		}
+		catch( ...)
+		{
+			rc = AXISC_FAIL;
+		}
+	    
+		return rc;
+	}
+
+	AXISC_STORAGE_CLASS_INFO int axiscAxisDelete( void * pValue, AXISC_XSDTYPE type)
+	{
+		int rc = AXISC_SUCCESS;
+	    
+		try 
+		{
+			Axis::AxisDelete(pValue, (XSDTYPE) type);
+		}
+		catch( AxisException& e)
+		{
+			axiscInvokeExceptionHandler( e.getExceptionCode(), e.what());
+
+			rc = AXISC_FAIL;    
+		}
+		catch( ...)
+		{
+			rc = AXISC_FAIL;
+		}    
+	    
+		return rc;
+	}
+
+	AXISC_STORAGE_CLASS_INFO void axiscRegisterExceptionHandler( void * fp)
+	{
+		global_exceptionHandler = (GlobalExceptionHandlerPrototype *) fp;
+	}
+
+	AXISC_STORAGE_CLASS_INFO void axiscInvokeExceptionHandler( int errorCode, const char * errorString)
+	{
+		if( global_exceptionHandler)
+		{
+			(global_exceptionHandler) (errorCode, errorString);
+// Try?			(*global_exceptionHandler) (errorCode, errorString);
+		}
+		else
+		{
+			cerr <<  "AXIS EXCEPTION: (" << errorCode << ") " << errorString
<< endl;
+		}
+	}
 }



Mime
View raw message