axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r331205 - in /webservices/axis2/trunk/c: include/axis2.h modules/core/description/src/operation.c modules/core/description/src/param_container.c modules/core/description/src/svc.c
Date Mon, 07 Nov 2005 05:04:21 GMT
Author: damitha
Date: Sun Nov  6 21:04:13 2005
New Revision: 331205

URL: http://svn.apache.org/viewcvs?rev=331205&view=rev
Log:
Global replace ment for AXIS2_ERROR_SET AND AXIS2_PARAM_CHECK

Modified:
    webservices/axis2/trunk/c/include/axis2.h
    webservices/axis2/trunk/c/modules/core/description/src/operation.c
    webservices/axis2/trunk/c/modules/core/description/src/param_container.c
    webservices/axis2/trunk/c/modules/core/description/src/svc.c

Modified: webservices/axis2/trunk/c/include/axis2.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2.h?rev=331205&r1=331204&r2=331205&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2.h (original)
+++ webservices/axis2/trunk/c/include/axis2.h Sun Nov  6 21:04:13 2005
@@ -42,16 +42,16 @@
  * @return If function return a status code return AXIS2_SUCCESS. Else if
  *         function return a type pointer return NULL
  */
-#define AXIS2_PARAM_CHECK(object, env, error_return) \
+#define AXIS2_PARAM_CHECK(error, object, error_return) \
     if (!object) \
     { \
-        AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_INVALID_NULL_PARAM); \
-        AXIS2_ERROR_SET_STATUS_CODE((*env)->error, AXIS2_FAILURE); \
+        AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
+        AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE); \
         return error_return; \
     } \
     else \
     { \
-        AXIS2_ERROR_SET_STATUS_CODE((*env)->error, AXIS2_SUCCESS); \
+        AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); \
     } 
 
 /**This macro is used to handle error situation. 
@@ -62,7 +62,7 @@
  * @return If function return a status code return AXIS2_SUCCESS. Else if
  *         function return a type pointer return NULL
  */    
-#define AXIS2_ERROR_SET(error_number, error, error_return) \
+#define AXIS2_ERROR_SET(error, error_number, error_return) \
     { \
         AXIS2_ERROR_SET_ERROR_NUMBER(error, error_number); \
         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE); \

Modified: webservices/axis2/trunk/c/modules/core/description/src/operation.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/operation.c?rev=331205&r1=331204&r2=331205&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/operation.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/operation.c Sun Nov  6 21:04:13
2005
@@ -100,7 +100,7 @@
      
 	if(NULL == operation_impl)
 	{
-		AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
 	}
 	
 	operation_impl->ops->free = axis2_operation_free;
@@ -121,7 +121,7 @@
 		axis2_param_container_create(env);		
 	if(NULL == param_container)
 	{
-        AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);		
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);		
 	}
 
 	operation_impl->param_container = param_container;
@@ -145,9 +145,9 @@
     
 	if(NULL == operation_impl)
 	{
-		AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
 	}
-    AXIS2_PARAM_CHECK(env, qname, AXIS2_FAILURE);	
+    AXIS2_PARAM_CHECK((*env)->error, qname, AXIS2_FAILURE);	
 	
     operation_impl->qname = qname;    
 	return &(operation_impl->operation);	
@@ -191,9 +191,9 @@
 		                        axis2_param_t *param)
 {
     AXIS2_FUNC_PARAM_CHECK(operation, env, AXIS2_FALSE);
-    AXIS2_PARAM_CHECK(env, AXIS2_INTF_TO_IMPL(operation)->param_container, 
+    AXIS2_PARAM_CHECK((*env)->error, AXIS2_INTF_TO_IMPL(operation)->param_container,

         AXIS2_FALSE);
-    AXIS2_PARAM_CHECK(env, param, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK((*env)->error, param, AXIS2_FALSE);
 	
 	axis2_hash_set 
         (AXIS2_PARAM_CONTAINER_GET_PARAMS(AXIS2_INTF_TO_IMPL(operation)->
@@ -209,12 +209,12 @@
 		                        const axis2_char_t *name)
 {
 	AXIS2_FUNC_PARAM_CHECK(operation, env, AXIS2_FALSE);
-    AXIS2_PARAM_CHECK(env, AXIS2_INTF_TO_IMPL(operation)->param_container, 
+    AXIS2_PARAM_CHECK((*env)->error, AXIS2_INTF_TO_IMPL(operation)->param_container,

         AXIS2_FALSE);
 	
 	axis2_char_t *tempname = axis2_strdup(name);
 	if(NULL == tempname)
-        AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FALSE);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FALSE);
 		
 	return (axis2_param_t *)(axis2_hash_get (
         AXIS2_PARAM_CONTAINER_GET_PARAMS(AXIS2_INTF_TO_IMPL(operation)->
@@ -226,7 +226,7 @@
                                 axis2_env_t **env)
 {
 	AXIS2_FUNC_PARAM_CHECK(operation, env, AXIS2_FALSE);
-    AXIS2_PARAM_CHECK(env, AXIS2_INTF_TO_IMPL(operation)->param_container, 
+    AXIS2_PARAM_CHECK((*env)->error, AXIS2_INTF_TO_IMPL(operation)->param_container,

         AXIS2_FALSE);
 	
 	return AXIS2_PARAM_CONTAINER_GET_PARAMS
@@ -239,12 +239,12 @@
 		                            const axis2_char_t *param_name)
 {
     AXIS2_FUNC_PARAM_CHECK(operation, env, AXIS2_FALSE);
-    AXIS2_PARAM_CHECK(env, AXIS2_INTF_TO_IMPL(operation)->param_container, 
+    AXIS2_PARAM_CHECK((*env)->error, AXIS2_INTF_TO_IMPL(operation)->param_container,

         AXIS2_FALSE);
 	
 	axis2_char_t *tempname = axis2_strdup(param_name);
 	if(NULL == tempname)
-        AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FALSE); 
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FALSE); 
 		
 	return AXIS2_PARAM_CONTAINER_IS_PARAM_LOCKED
 		(AXIS2_INTF_TO_IMPL(operation)->param_container, env, tempname); 
@@ -257,7 +257,7 @@
 		                        axis2_svc_t *svc)
 {
     AXIS2_FUNC_PARAM_CHECK(operation, env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env, msg_recv, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, msg_recv, AXIS2_FAILURE);
     AXIS2_INTF_TO_IMPL(operation)->parent = svc;
 	return AXIS2_SUCCESS;
 }
@@ -287,7 +287,7 @@
     AXIS2_FUNC_PARAM_CHECK(operation, env, AXIS2_FAILURE);
 	AXIS2_INTF_TO_IMPL(operation)->msg_exchange_pattern = axis2_strdup(pattern);
 	if(NULL == AXIS2_INTF_TO_IMPL(operation)->msg_exchange_pattern)
-        AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
 		
 	return AXIS2_SUCCESS;
 }
@@ -306,7 +306,7 @@
 		                        axis2_engine_msg_recv_t *msg_recv)
 {
     AXIS2_FUNC_PARAM_CHECK(operation, env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env, msg_recv, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, msg_recv, AXIS2_FAILURE);
 	AXIS2_INTF_TO_IMPL(operation)->msg_recv = msg_recv;
 	
 	return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/modules/core/description/src/param_container.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/param_container.c?rev=331205&r1=331204&r2=331205&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/param_container.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/param_container.c Sun Nov  6 21:04:13
2005
@@ -67,12 +67,12 @@
 	
 	
 	if(NULL == param_container_impl)
-        AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL); 
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL); 
 	
 	axis2_param_container_ops_t *ops = 
 		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_param_container_ops_t));
 	if(NULL == ops)
-		AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
 	ops->free =  axis2_param_container_free;
 	ops->add_param =  axis2_param_container_add_param;
 	ops->get_param =  axis2_param_container_get_param;
@@ -83,7 +83,7 @@
 				
 	param_container_impl->params = axis2_hash_make (env);
 	if(NULL == param_container_impl->params)
-		AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);	
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);	
 	
 	return &(param_container_impl->param_container);
 }
@@ -111,7 +111,7 @@
 					axis2_param_t *param)
 {
 	AXIS2_FUNC_PARAM_CHECK(param_container, env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env, param, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, param, AXIS2_FAILURE);
 	
 	if (NULL == (AXIS2_INTF_TO_IMPL(param_container)->params))
 	{                    
@@ -156,7 +156,7 @@
 		(axis2_hash_get (AXIS2_INTF_TO_IMPL(param_container)->params
 			, axis2_strdup(param_name), AXIS2_HASH_KEY_STRING));
 	
-    AXIS2_PARAM_CHECK(env, param, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, param, AXIS2_FAILURE);
 	
 	return AXIS2_PARAM_IS_LOCKED(param, env);
 }

Modified: webservices/axis2/trunk/c/modules/core/description/src/svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/svc.c?rev=331205&r1=331204&r2=331205&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/svc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/svc.c Sun Nov  6 21:04:13 2005
@@ -72,7 +72,7 @@
 		AXIS2_MALLOC (env->allocator, sizeof(axis2_svc_impl_t));
     if(NULL == svc_impl)
 	{
-		AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
 	}
 	
 	svc_impl->ops->free = axis2_svc_free;
@@ -94,7 +94,7 @@
 		axis2_param_container_create(env);		
 	if(NULL == param_container)
 	{
-        AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);		
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);		
 	}
 
 	svc_impl->param_container = param_container;
@@ -104,7 +104,7 @@
 	svc_impl->wasaction_opeartionmap = axis2_hash_make (env);				
 	if(NULL == svc_impl->wasaction_opeartionmap)
 	{
-		AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);		
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);		
 	}
 	svc_impl->name = NULL;
 
@@ -118,10 +118,10 @@
 	axis2_svc_impl_t *svc_impl = axis2_svc_create(env);
 	if(NULL == svc_impl)
 	{
-		AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, NULL);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
 	}
     
-    AXIS2_PARAM_CHECK(env, qname, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, qname, AXIS2_FAILURE);
     
 	svc_impl->name = qname;
 	
@@ -163,7 +163,7 @@
 		                    axis2_operation_t *operation)
 {
     AXIS2_FUNC_PARAM_CHECK(svc, env, AXIS2_FALSE);
-    AXIS2_PARAM_CHECK(env, operation, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK((*env)->error, operation, AXIS2_FALSE);
 	
 	if (NULL == (AXIS2_INTF_TO_IMPL(svc)->wasaction_opeartionmap))
 	{                    
@@ -177,7 +177,7 @@
 	axis2_char_t *tempname = tempqname->localpart;
 	
     if(NULL == tempname)
-        AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
 	
 	axis2_hash_set (AXIS2_INTF_TO_IMPL(svc)->wasaction_opeartionmap		
 		, tempname
@@ -192,10 +192,10 @@
 		                                axis2_qname_t *operation_name)
 {
     AXIS2_FUNC_PARAM_CHECK(svc, env, NULL);
-    AXIS2_PARAM_CHECK(env, operation_name, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, operation_name, NULL);
 	if(NULL == AXIS2_INTF_TO_IMPL(svc)->wasaction_opeartionmap)
 	{
-		AXIS2_ERROR_HANDLE(env, AXIS2_ERROR_INVALID_NULL_PARAM, NULL);	
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_NULL_PARAM, NULL);	
 	}
     
 	return (axis2_operation_t *) (axis2_hash_get (AXIS2_INTF_TO_IMPL(svc)->
@@ -208,10 +208,10 @@
                                     axis2_env_t **env,
 		                            const axis2_char_t* name)
 {
-    AXIS2_FUNC_PARAM_CHECK(env, svc, NULL);
-    AXIS2_PARAM_CHECK(env, name, NULL);
+    AXIS2_FUNC_PARAM_CHECK(svc, env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, name, NULL);
 	axis2_char_t temp_name = axis2_strdup(name);
-    AXIS2_PARAM_CHECK(env, temp_name, NULL); 
+    AXIS2_PARAM_CHECK((*env)->error, temp_name, NULL); 
     
 	return (axis2_operation_t *) (axis2_hash_get 
 		(AXIS2_INTF_TO_IMPL(svc)->wasaction_opeartionmap
@@ -222,12 +222,9 @@
 axis2_svc_get_operations (axis2_svc_t *svc, 
                             axis2_env_t **env)
 {
-	if(!svc)
-	{
-		env->error->error_number = AXIS2_ERROR_INVALID_NULL_PARAM;
-		return NULL;		
-	}
-	return svc->wasaction_opeartionmap;
+    AXIS2_FUNC_PARAM_CHECK(svc, env, NULL);
+	
+	return AXIS2_INTF_TO_IMPL(svc)->wasaction_opeartionmap;
 }
 	
 axis2_status_t AXIS2_CALL
@@ -235,6 +232,8 @@
                         axis2_env_t **env,
 		                axis2_svc_grp_t *svc_grp)
 {
+    AXIS2_FUNC_PARAM_CHECK(svc, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(
 	if(!svc || !svc_grp)
 	{
 		return AXIS2_ERROR_INVALID_NULL_PARAM;	



Mime
View raw message