You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sh...@apache.org on 2009/08/18 12:15:53 UTC

svn commit: r805347 [10/31] - in /webservices/axis2/trunk/c/src: core/addr/ core/clientapi/ core/context/ core/deployment/ core/description/ core/engine/ core/phaseresolver/ core/receivers/ core/transport/amqp/receiver/ core/transport/amqp/receiver/qpi...

Modified: webservices/axis2/trunk/c/src/core/description/handler_desc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/description/handler_desc.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/description/handler_desc.c (original)
+++ webservices/axis2/trunk/c/src/core/description/handler_desc.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -51,7 +50,7 @@
     axis2_handler_desc_t *handler_desc = NULL;
 
     handler_desc = AXIS2_MALLOC(env->allocator, sizeof(axis2_handler_desc_t));
-    if (!handler_desc)
+    if(!handler_desc)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
@@ -66,7 +65,7 @@
     handler_desc->parent = NULL;
 
     handler_desc->param_container = axutil_param_container_create(env);
-    if (!handler_desc->param_container)
+    if(!handler_desc->param_container)
     {
 
         /** error code is already set by last param container create */
@@ -75,7 +74,7 @@
     }
 
     handler_desc->rules = axis2_phase_rule_create(env, NULL);
-    if (!handler_desc->rules)
+    if(!handler_desc->rules)
     {
 
         /** error code is already set by last param container create */
@@ -83,7 +82,7 @@
         return NULL;
     }
 
-    if (name)
+    if(name)
     {
         handler_desc->name = axutil_string_clone(name, env);
     }
@@ -105,13 +104,13 @@
     const axutil_env_t * env,
     axutil_string_t * name)
 {
-    if (handler_desc->name)
+    if(handler_desc->name)
     {
         axutil_string_free(handler_desc->name, env);
         handler_desc->name = NULL;
     }
 
-    if (name)
+    if(name)
     {
         handler_desc->name = axutil_string_clone(name, env);
     }
@@ -133,20 +132,19 @@
     const axutil_env_t * env,
     axis2_phase_rule_t * phase_rule)
 {
-    const axutil_string_t *str_name = axis2_handler_desc_get_name(handler_desc, 
-        env);
+    const axutil_string_t *str_name = axis2_handler_desc_get_name(handler_desc, env);
     const axis2_char_t *name = axutil_string_get_buffer(str_name, env);
-    if (handler_desc->rules)
+    if(handler_desc->rules)
     {
         axis2_phase_rule_free(handler_desc->rules, env);
     }
 
-    if (phase_rule)
+    if(phase_rule)
     {
         handler_desc->rules = axis2_phase_rule_clone(phase_rule, env);
-        if (!(handler_desc->rules))
+        if(!(handler_desc->rules))
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                 "Phase rule cloning failed for handler description %s", name);
             return AXIS2_FAILURE;
         }
@@ -161,8 +159,7 @@
     const axutil_env_t * env,
     const axis2_char_t * name)
 {
-    return axutil_param_container_get_param(handler_desc->param_container, env,
-                                            name);
+    return axutil_param_container_get_param(handler_desc->param_container, env, name);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -171,23 +168,18 @@
     const axutil_env_t * env,
     axutil_param_t * param)
 {
-    const axutil_string_t *str_name = axis2_handler_desc_get_name(handler_desc, 
-        env);
+    const axutil_string_t *str_name = axis2_handler_desc_get_name(handler_desc, env);
     const axis2_char_t *name = axutil_string_get_buffer(str_name, env);
     axis2_char_t *param_name = axutil_param_get_name(param, env);
-    if (axutil_param_container_is_param_locked(handler_desc->parent, env, 
-        param_name))
+    if(axutil_param_container_is_param_locked(handler_desc->parent, env, param_name))
     {
-        AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE,
-                        AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Parameter %s is locked for handler %s", param_name, name);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Parameter %s is locked for handler %s",
+            param_name, name);
         return AXIS2_FAILURE;
     }
 
-    return axutil_param_container_add_param(handler_desc->param_container,
-                                            env, param);
+    return axutil_param_container_add_param(handler_desc->param_container, env, param);
 }
 
 AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
@@ -195,8 +187,7 @@
     const axis2_handler_desc_t * handler_desc,
     const axutil_env_t * env)
 {
-    return axutil_param_container_get_params(handler_desc->param_container,
-                                             env);
+    return axutil_param_container_get_params(handler_desc->param_container, env);
 }
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
@@ -206,14 +197,12 @@
     const axis2_char_t * param_name)
 {
     /* See if it is locked in parent */
-    if (axutil_param_container_is_param_locked(handler_desc->parent, env,
-                                               param_name))
+    if(axutil_param_container_is_param_locked(handler_desc->parent, env, param_name))
     {
         return AXIS2_TRUE;
     }
 
-    return axutil_param_container_is_param_locked(handler_desc->param_container,
-                                                  env, param_name);
+    return axutil_param_container_is_param_locked(handler_desc->param_container, env, param_name);
 }
 
 AXIS2_EXTERN axis2_handler_t *AXIS2_CALL
@@ -231,16 +220,16 @@
     axis2_handler_t * handler)
 {
     /* Handler description is the place where the handler really lives.
-       Hence this is a deep copy and should be freed by the free function. */
+     Hence this is a deep copy and should be freed by the free function. */
 
-    if (handler_desc->handler && (handler_desc->handler != handler))
+    if(handler_desc->handler && (handler_desc->handler != handler))
     {
         axis2_handler_free(handler_desc->handler, env);
     }
 
-    if (handler)
-        handler_desc->handler = handler;    /* Shallow copy, but free method
-                                               should free this */
+    if(handler)
+        handler_desc->handler = handler; /* Shallow copy, but free method
+         should free this */
 
     return AXIS2_SUCCESS;
 }
@@ -259,15 +248,15 @@
     const axutil_env_t * env,
     const axis2_char_t * class_name)
 {
-    if (handler_desc->class_name)
+    if(handler_desc->class_name)
     {
         AXIS2_FREE(env->allocator, handler_desc->class_name);
     }
 
-    if (class_name)
+    if(class_name)
     {
         handler_desc->class_name = axutil_strdup(env, class_name);
-        if (!handler_desc->class_name)
+        if(!handler_desc->class_name)
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
@@ -292,8 +281,8 @@
     const axutil_env_t * env,
     axutil_param_container_t * parent)
 {
-    handler_desc->parent = parent;  /* Shallow copy, because
-                                       the parent lives somewhere else */
+    handler_desc->parent = parent; /* Shallow copy, because
+     the parent lives somewhere else */
     return AXIS2_SUCCESS;
 }
 
@@ -302,31 +291,31 @@
     axis2_handler_desc_t * handler_desc,
     const axutil_env_t * env)
 {
-    if (handler_desc->param_container)
+    if(handler_desc->param_container)
     {
         axutil_param_container_free(handler_desc->param_container, env);
     }
 
-    if (handler_desc->name)
+    if(handler_desc->name)
     {
         axutil_string_free(handler_desc->name, env);
     }
 
-    if (handler_desc->rules)
+    if(handler_desc->rules)
     {
         axis2_phase_rule_free(handler_desc->rules, env);
     }
 
-    if (handler_desc->handler)
+    if(handler_desc->handler)
     {
         axis2_handler_free(handler_desc->handler, env);
     }
 
-    if (handler_desc->class_name)
+    if(handler_desc->class_name)
     {
         AXIS2_FREE(env->allocator, handler_desc->class_name);
     }
-    if (handler_desc)
+    if(handler_desc)
     {
         AXIS2_FREE(env->allocator, handler_desc);
     }

Modified: webservices/axis2/trunk/c/src/core/description/module_desc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/description/module_desc.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/description/module_desc.c (original)
+++ webservices/axis2/trunk/c/src/core/description/module_desc.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -52,11 +51,9 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    module_desc = (axis2_module_desc_t *) AXIS2_MALLOC(env->allocator,
-                                                       sizeof
-                                                       (axis2_module_desc_t));
+    module_desc = (axis2_module_desc_t *)AXIS2_MALLOC(env->allocator, sizeof(axis2_module_desc_t));
 
-    if (!module_desc)
+    if(!module_desc)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -70,7 +67,7 @@
     module_desc->ops = NULL;
 
     module_desc->params = axutil_param_container_create(env);
-    if (!module_desc->params)
+    if(!module_desc->params)
     {
         axis2_module_desc_free(module_desc, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -78,22 +75,22 @@
     }
 
     module_desc->flow_container = axis2_flow_container_create(env);
-    if (!module_desc->flow_container)
+    if(!module_desc->flow_container)
     {
         axis2_module_desc_free(module_desc, env);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE)
-            return NULL;
-    }
+AXIS2_ERROR_SET    (env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE)
+    return NULL;
+}
 
-    module_desc->ops = axutil_hash_make(env);
-    if (!module_desc->ops)
-    {
-        axis2_module_desc_free(module_desc, env);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
+module_desc->ops = axutil_hash_make(env);
+if (!module_desc->ops)
+{
+    axis2_module_desc_free(module_desc, env);
+    AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+    return NULL;
+}
 
-    return module_desc;
+return module_desc;
 }
 
 AXIS2_EXTERN axis2_module_desc_t *AXIS2_CALL
@@ -106,13 +103,13 @@
     AXIS2_PARAM_CHECK(env->error, qname, NULL);
 
     module_desc = axis2_module_desc_create(env);
-    if (!module_desc)
+    if(!module_desc)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    module_desc->qname = (axutil_qname_t *) qname;
+    module_desc->qname = (axutil_qname_t *)qname;
 
     return module_desc;
 }
@@ -124,39 +121,38 @@
 {
     AXIS2_ENV_CHECK(env, void);
 
-    if (module_desc->module)
+    if(module_desc->module)
     {
         axis2_module_shutdown(module_desc->module, env);
     }
 
-    if (module_desc->params)
+    if(module_desc->params)
     {
         axutil_param_container_free(module_desc->params, env);
     }
 
-    if (module_desc->flow_container)
+    if(module_desc->flow_container)
     {
         axis2_flow_container_free(module_desc->flow_container, env);
     }
 
     module_desc->parent = NULL;
 
-    if (module_desc->qname)
+    if(module_desc->qname)
     {
         axutil_qname_free(module_desc->qname, env);
     }
 
-    if (module_desc->ops)
+    if(module_desc->ops)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(module_desc->ops, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(module_desc->ops, env); hi; hi = axutil_hash_next(env, hi))
         {
             struct axis2_op *op = NULL;
             axutil_hash_this(hi, NULL, NULL, &val);
-            op = (struct axis2_op *) val;
-            if (op)
+            op = (struct axis2_op *)val;
+            if(op)
                 axis2_op_free(op, env);
             val = NULL;
             op = NULL;
@@ -165,7 +161,7 @@
         axutil_hash_free(module_desc->ops, env);
     }
 
-    if (module_desc)
+    if(module_desc)
     {
         AXIS2_FREE(env->allocator, module_desc);
     }
@@ -181,7 +177,7 @@
     axis2_module_desc_t *module_desc_l = NULL;
 
     AXIS2_ENV_CHECK(env, void);
-    module_desc_l = (axis2_module_desc_t *) module_desc;
+    module_desc_l = (axis2_module_desc_t *)module_desc;
     axis2_module_desc_free(module_desc_l, env);
     return;
 }
@@ -203,8 +199,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, in_flow, AXIS2_FAILURE);
 
-    return axis2_flow_container_set_in_flow(module_desc->flow_container, env,
-                                            in_flow);
+    return axis2_flow_container_set_in_flow(module_desc->flow_container, env, in_flow);
 }
 
 AXIS2_EXTERN axis2_flow_t *AXIS2_CALL
@@ -224,8 +219,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, out_flow, AXIS2_FAILURE);
 
-    return axis2_flow_container_set_out_flow(module_desc->flow_container, env,
-                                             out_flow);
+    return axis2_flow_container_set_out_flow(module_desc->flow_container, env, out_flow);
 }
 
 AXIS2_EXTERN axis2_flow_t *AXIS2_CALL
@@ -233,8 +227,7 @@
     const axis2_module_desc_t * module_desc,
     const axutil_env_t * env)
 {
-    return axis2_flow_container_get_fault_in_flow(module_desc->flow_container,
-                                                  env);
+    return axis2_flow_container_get_fault_in_flow(module_desc->flow_container, env);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -246,8 +239,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, falut_in_flow, AXIS2_FAILURE);
 
-    return axis2_flow_container_set_fault_in_flow(module_desc->flow_container,
-                                                  env, falut_in_flow);
+    return axis2_flow_container_set_fault_in_flow(module_desc->flow_container, env, falut_in_flow);
 }
 
 AXIS2_EXTERN axis2_flow_t *AXIS2_CALL
@@ -255,8 +247,7 @@
     const axis2_module_desc_t * module_desc,
     const axutil_env_t * env)
 {
-    return axis2_flow_container_get_fault_out_flow(module_desc->flow_container,
-                                                   env);
+    return axis2_flow_container_get_fault_out_flow(module_desc->flow_container, env);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -268,8 +259,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, fault_out_flow, AXIS2_FAILURE);
 
-    return axis2_flow_container_set_fault_out_flow(module_desc->flow_container,
-                                                   env, fault_out_flow);
+    return axis2_flow_container_set_fault_out_flow(module_desc->flow_container, env, fault_out_flow);
 }
 
 AXIS2_EXTERN const axutil_qname_t *AXIS2_CALL
@@ -289,12 +279,12 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, qname, AXIS2_FAILURE);
 
-    if (module_desc->qname)
+    if(module_desc->qname)
     {
         axutil_qname_free(module_desc->qname, env);
     }
 
-    module_desc->qname = axutil_qname_clone((axutil_qname_t *) qname, env);
+    module_desc->qname = axutil_qname_clone((axutil_qname_t *)qname, env);
 
     return AXIS2_SUCCESS;
 }
@@ -311,20 +301,20 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, op, AXIS2_FAILURE);
 
-    if (!(module_desc->ops))
+    if(!(module_desc->ops))
     {
         module_desc->ops = axutil_hash_make(env);
-        if (!module_desc->ops)
+        if(!module_desc->ops)
             return AXIS2_FAILURE;
     }
 
     op_qname = axis2_op_get_qname(op, env);
 
-    if (!op_qname)
+    if(!op_qname)
     {
         return AXIS2_FAILURE;
     }
-    op_name = axutil_qname_to_string((axutil_qname_t *) op_qname, env);
+    op_name = axutil_qname_to_string((axutil_qname_t *)op_qname, env);
     axutil_hash_set(module_desc->ops, op_name, AXIS2_HASH_KEY_STRING, op);
 
     return AXIS2_SUCCESS;
@@ -370,24 +360,19 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
     param_name_l = axutil_param_get_name(param, env);
-    if (!param_name_l)
+    if(!param_name_l)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_PARAM,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_PARAM, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    if (AXIS2_TRUE == axis2_module_desc_is_param_locked(module_desc, env,
-                                                        param_name_l))
+    if(AXIS2_TRUE == axis2_module_desc_is_param_locked(module_desc, env, param_name_l))
     {
-        AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     else
     {
-        ret_status =
-            axutil_param_container_add_param(module_desc->params, env, param);
+        ret_status = axutil_param_container_add_param(module_desc->params, env, param);
     }
     return ret_status;
 }
@@ -425,22 +410,21 @@
     AXIS2_PARAM_CHECK(env->error, param_name, AXIS2_FAILURE);
 
     /* checking the locked value of parent */
-    if (!module_desc->parent)
+    if(!module_desc->parent)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_MODULE_DESC,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_MODULE_DESC, AXIS2_FAILURE);
         return AXIS2_FALSE;
     }
     locked = axis2_conf_is_param_locked(module_desc->parent, env, param_name);
 
-    if (AXIS2_TRUE == locked)
+    if(AXIS2_TRUE == locked)
     {
         ret_state = AXIS2_TRUE;
     }
     else
     {
         param_l = axis2_module_desc_get_param(module_desc, env, param_name);
-        if (param_l && AXIS2_TRUE == axutil_param_is_locked(param_l, env))
+        if(param_l && AXIS2_TRUE == axutil_param_is_locked(param_l, env))
             ret_state = AXIS2_TRUE;
         else
             ret_state = AXIS2_FALSE;

Modified: webservices/axis2/trunk/c/src/core/description/msg.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/description/msg.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/description/msg.c (original)
+++ webservices/axis2/trunk/c/src/core/description/msg.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -56,9 +55,9 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    msg = (axis2_msg_t *) AXIS2_MALLOC(env->allocator, sizeof(axis2_msg_t));
+    msg = (axis2_msg_t *)AXIS2_MALLOC(env->allocator, sizeof(axis2_msg_t));
 
-    if (!msg)
+    if(!msg)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -73,23 +72,22 @@
     msg->base = NULL;
     msg->ref = 1;
 
-    msg->param_container =
-        (axutil_param_container_t *) axutil_param_container_create(env);
-    if (!msg->param_container)
+    msg->param_container = (axutil_param_container_t *)axutil_param_container_create(env);
+    if(!msg->param_container)
     {
         axis2_msg_free(msg, env);
         return NULL;
     }
 
     msg->flow = axutil_array_list_create(env, 0);
-    if (!msg->flow)
+    if(!msg->flow)
     {
         axis2_msg_free(msg, env);
         return NULL;
     }
 
     msg->base = axis2_desc_create(env);
-    if (!msg->base)
+    if(!msg->base)
     {
         axis2_msg_free(msg, env);
         return NULL;
@@ -105,54 +103,53 @@
 {
     AXIS2_ENV_CHECK(env, void);
 
-    if (--(msg->ref) > 0)
+    if(--(msg->ref) > 0)
     {
         return;
     }
 
-    if (msg->flow)
+    if(msg->flow)
     {
-        int i = 0,
-            size = 0;
+        int i = 0, size = 0;
         size = axutil_array_list_size(msg->flow, env);
-        for (i = 0; i < size; i++)
+        for(i = 0; i < size; i++)
         {
             axis2_phase_t *phase = NULL;
             phase = axutil_array_list_get(msg->flow, env, i);
-            if (phase)
+            if(phase)
                 axis2_phase_free(phase, env);
         }
         axutil_array_list_free(msg->flow, env);
     }
 
-    if (msg->name)
+    if(msg->name)
     {
         AXIS2_FREE(env->allocator, msg->name);
     }
 
-    if (msg->element_qname)
+    if(msg->element_qname)
     {
         axutil_qname_free(msg->element_qname, env);
     }
 
-    if (msg->direction)
+    if(msg->direction)
     {
         AXIS2_FREE(env->allocator, msg->direction);
     }
 
-    if (msg->param_container)
+    if(msg->param_container)
     {
         axutil_param_container_free(msg->param_container, env);
     }
 
-    if (msg->base)
+    if(msg->base)
     {
         axis2_desc_free(msg->base, env);
     }
 
     msg->parent = NULL;
 
-    if (msg)
+    if(msg)
     {
         AXIS2_FREE(env->allocator, msg);
     }
@@ -172,15 +169,12 @@
     AXIS2_PARAM_CHECK(env->error, param, AXIS2_FALSE);
 
     param_name = axutil_param_get_name(param, env);
-    if (AXIS2_TRUE == axis2_msg_is_param_locked(msg, env, param_name))
+    if(AXIS2_TRUE == axis2_msg_is_param_locked(msg, env, param_name))
     {
-        AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    return axutil_param_container_add_param(msg->param_container, env,
-                                            param);
+    return axutil_param_container_add_param(msg->param_container, env, param);
 }
 
 AXIS2_EXTERN axutil_param_t *AXIS2_CALL
@@ -191,8 +185,7 @@
 {
     AXIS2_PARAM_CHECK(env->error, param_name, NULL);
 
-    return axutil_param_container_get_param(msg->param_container, env,
-                                            param_name);
+    return axutil_param_container_get_param(msg->param_container, env, param_name);
 }
 
 AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
@@ -213,7 +206,7 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     msg->parent = op;
-    if (op)
+    if(op)
     {
         axis2_desc_set_parent(msg->base, env, axis2_op_get_base(op, env));
     }
@@ -251,11 +244,11 @@
 
     /* checking the locked status in parent */
     parent_l = axis2_msg_get_parent(msg, env);
-    if (parent_l)
+    if(parent_l)
     {
         locked = axis2_op_is_param_locked(parent_l, env, param_name);
     }
-    if (AXIS2_TRUE == locked)
+    if(AXIS2_TRUE == locked)
     {
         return AXIS2_TRUE;
     }
@@ -273,12 +266,12 @@
     axutil_array_list_t * flow)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    if (msg->flow)
+    if(msg->flow)
     {
         axutil_array_list_free(msg->flow, env);
         msg->flow = NULL;
     }
-    if (flow)
+    if(flow)
     {
         msg->flow = flow;
     }
@@ -301,16 +294,16 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (msg->direction)
+    if(msg->direction)
     {
         AXIS2_FREE(env->allocator, msg->direction);
         msg->direction = NULL;
     }
 
-    if (direction)
+    if(direction)
     {
         msg->direction = axutil_strdup(env, direction);
-        if (!(msg->direction))
+        if(!(msg->direction))
         {
             return AXIS2_FAILURE;
         }
@@ -335,17 +328,16 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (msg->element_qname)
+    if(msg->element_qname)
     {
         axutil_qname_free(msg->element_qname, env);
         msg->element_qname = NULL;
     }
 
-    if (element_qname)
+    if(element_qname)
     {
-        msg->element_qname =
-            axutil_qname_clone((axutil_qname_t *) element_qname, env);
-        if (!(msg->element_qname))
+        msg->element_qname = axutil_qname_clone((axutil_qname_t *)element_qname, env);
+        if(!(msg->element_qname))
         {
             return AXIS2_FAILURE;
         }
@@ -370,16 +362,16 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (msg->name)
+    if(msg->name)
     {
         AXIS2_FREE(env->allocator, msg->name);
         msg->name = NULL;
     }
 
-    if (name)
+    if(name)
     {
         msg->name = axutil_strdup(env, name);
-        if (!(msg->name))
+        if(!(msg->name))
         {
             return AXIS2_FAILURE;
         }

Modified: webservices/axis2/trunk/c/src/core/description/op.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/description/op.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/description/op.c (original)
+++ webservices/axis2/trunk/c/src/core/description/op.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -54,9 +53,9 @@
     axis2_op_t *op = NULL;
     axis2_msg_t *msg = NULL;
 
-    op = (axis2_op_t *) AXIS2_MALLOC(env->allocator, sizeof(axis2_op_t));
+    op = (axis2_op_t *)AXIS2_MALLOC(env->allocator, sizeof(axis2_op_t));
 
-    if (!op)
+    if(!op)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "");
@@ -79,30 +78,27 @@
     op->rest_http_location = NULL;
     op->style = axutil_strdup(env, AXIS2_STYLE_DOC);
 
-    op->param_container = (axutil_param_container_t *)
-        axutil_param_container_create(env);
-    if (!op->param_container)
+    op->param_container = (axutil_param_container_t *)axutil_param_container_create(env);
+    if(!op->param_container)
     {
         axis2_op_free(op, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Param container creation failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Param container creation failed");
         return NULL;
     }
 
     op->base = axis2_desc_create(env);
-    if (!op->base)
+    if(!op->base)
     {
         axis2_op_free(op, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Operation base creation failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Operation base creation failed");
         return NULL;
     }
 
     /* Create and set up children messages */
     msg = axis2_msg_create(env);
-    if (!msg)
+    if(!msg)
     {
         axis2_op_free(op, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -114,7 +110,7 @@
     axis2_op_add_msg(op, env, AXIS2_MSG_IN, msg);
 
     msg = axis2_msg_create(env);
-    if (!msg)
+    if(!msg)
     {
         axis2_op_free(op, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -126,7 +122,7 @@
     axis2_op_add_msg(op, env, AXIS2_MSG_OUT, msg);
 
     msg = axis2_msg_create(env);
-    if (!msg)
+    if(!msg)
     {
         axis2_op_free(op, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -138,7 +134,7 @@
     axis2_op_add_msg(op, env, AXIS2_MSG_IN_FAULT, msg);
 
     msg = axis2_msg_create(env);
-    if (!msg)
+    if(!msg)
     {
         axis2_op_free(op, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -149,8 +145,7 @@
     axis2_msg_set_flow(msg, env, NULL);
     axis2_op_add_msg(op, env, AXIS2_MSG_OUT_FAULT, msg);
 
-    axis2_op_set_msg_exchange_pattern(op, env,
-                                      (axis2_char_t *) AXIS2_MEP_URI_IN_OUT);
+    axis2_op_set_msg_exchange_pattern(op, env, (axis2_char_t *)AXIS2_MEP_URI_IN_OUT);
 
     return op;
 }
@@ -161,7 +156,7 @@
 {
     axis2_op_t *op = NULL;
 
-    op = (axis2_op_t *) axis2_op_create(env);
+    op = (axis2_op_t *)axis2_op_create(env);
     op->from_module = AXIS2_TRUE;
     return op;
 }
@@ -176,23 +171,21 @@
 
     AXIS2_PARAM_CHECK(env->error, qname, NULL);
 
-    op = (axis2_op_t *) axis2_op_create(env);
+    op = (axis2_op_t *)axis2_op_create(env);
 
-    if (!op)
+    if(!op)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Operation creation failed for %s", 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Operation creation failed for %s",
             axutil_qname_get_localpart(qname, env));
         return NULL;
     }
 
     status = axis2_op_set_qname(op, env, qname);
-    if (AXIS2_SUCCESS != status)
+    if(AXIS2_SUCCESS != status)
     {
         axis2_op_free(op, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
-            "Setting name failed for operation %s", 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Setting name failed for operation %s",
             axutil_qname_get_localpart(qname, env));
         return NULL;
     }
@@ -205,81 +198,80 @@
     axis2_op_t * op,
     const axutil_env_t * env)
 {
-    if (op->base)
+    if(op->base)
     {
         axis2_desc_free(op->base, env);
     }
-    if (op->param_container)
+    if(op->param_container)
     {
         axutil_param_container_free(op->param_container, env);
     }
 
     op->parent = NULL;
 
-    if (op->msg_recv)
+    if(op->msg_recv)
     {
         axis2_msg_recv_free(op->msg_recv, env);
     }
-    if (op->module_qnames)
+    if(op->module_qnames)
     {
         int i = 0;
-        for (i = 0; i < axutil_array_list_size(op->module_qnames, env); i++)
+        for(i = 0; i < axutil_array_list_size(op->module_qnames, env); i++)
         {
             axutil_qname_t *module_ref = NULL;
             module_ref = axutil_array_list_get(op->module_qnames, env, i);
 
-            if (module_ref)
+            if(module_ref)
             {
                 axutil_qname_free(module_ref, env);
             }
         }
         axutil_array_list_free(op->module_qnames, env);
     }
-    if (op->engaged_module_list)
+    if(op->engaged_module_list)
     {
         axutil_array_list_free(op->engaged_module_list, env);
     }
-    if (op->wsamapping_list)
+    if(op->wsamapping_list)
     {
         int i = 0;
         int size = 0;
         size = axutil_array_list_size(op->wsamapping_list, env);
         for(i = 0; i < size; i++)
         {
-            axis2_char_t *temp_str = axutil_array_list_get(op->wsamapping_list, 
-                env, i);
+            axis2_char_t *temp_str = axutil_array_list_get(op->wsamapping_list, env, i);
             if(temp_str)
                 AXIS2_FREE(env->allocator, temp_str);
         }
         axutil_array_list_free(op->wsamapping_list, env);
     }
 
-    if (op->qname)
+    if(op->qname)
     {
         axutil_qname_free(op->qname, env);
     }
 
-    if (op->msg_exchange_pattern)
+    if(op->msg_exchange_pattern)
     {
         AXIS2_FREE(env->allocator, op->msg_exchange_pattern);
     }
 
-    if (op->style)
+    if(op->style)
     {
         AXIS2_FREE(env->allocator, op->style);
     }
 
-    if (op->rest_http_method)
+    if(op->rest_http_method)
     {
         AXIS2_FREE(env->allocator, op->rest_http_method);
     }
 
-    if (op->rest_http_location)
+    if(op->rest_http_location)
     {
         AXIS2_FREE(env->allocator, op->rest_http_location);
     }
 
-    if (op)
+    if(op)
     {
         AXIS2_FREE(env->allocator, op);
     }
@@ -294,7 +286,7 @@
 {
     axis2_op_t *op_l = NULL;
 
-    op_l = (axis2_op_t *) op;
+    op_l = (axis2_op_t *)op;
     axis2_op_free(op_l, env);
     return;
 }
@@ -311,18 +303,16 @@
     AXIS2_PARAM_CHECK(env->error, param, AXIS2_FALSE);
 
     param_name = axutil_param_get_name(param, env);
-    if (AXIS2_TRUE == axis2_op_is_param_locked(op, env, param_name))
+    if(AXIS2_TRUE == axis2_op_is_param_locked(op, env, param_name))
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Parameter %s is locked, cannot override", param_name);
-        AXIS2_ERROR_SET(env->error,
-            AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Parameter %s is locked, cannot override",
+            param_name);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     else
     {
-        status = axutil_param_container_add_param(op->param_container, env,
-                                                  param);
+        status = axutil_param_container_add_param(op->param_container, env, param);
     }
 
     return status;
@@ -338,9 +328,8 @@
 
     AXIS2_PARAM_CHECK(env->error, param_name, NULL);
 
-    param =
-        axutil_param_container_get_param(op->param_container, env, param_name);
-    if (!param && op->parent)
+    param = axutil_param_container_get_param(op->param_container, env, param_name);
+    if(!param && op->parent)
     {
         param = axis2_svc_get_param(op->parent, env, param_name);
     }
@@ -369,11 +358,11 @@
 
     /* Checking the locked value of parent */
     parent = axis2_op_get_parent(op, env);
-    if (parent)
+    if(parent)
     {
         locked = axis2_svc_is_param_locked(parent, env, param_name);
     }
-    if (locked)
+    if(locked)
     {
         return AXIS2_TRUE;
     }
@@ -389,12 +378,12 @@
 {
     AXIS2_PARAM_CHECK(env->error, rest_http_method, AXIS2_FAILURE);
 
-    if (op->rest_http_method)
+    if(op->rest_http_method)
     {
         AXIS2_FREE(env->allocator, op->rest_http_method);
     }
     op->rest_http_method = NULL;
-    if (rest_http_method)
+    if(rest_http_method)
     {
         op->rest_http_method = axutil_strdup(env, rest_http_method);
         return AXIS2_SUCCESS;
@@ -407,11 +396,11 @@
     const axis2_op_t * op,
     const axutil_env_t * env)
 {
-    if (!op)
+    if(!op)
     {
         return NULL;
     }
-    if (op->rest_http_method)
+    if(op->rest_http_method)
     {
         return op->rest_http_method;
     }
@@ -421,11 +410,11 @@
 
         param = axis2_op_get_param(op, env, AXIS2_DEFAULT_REST_HTTP_METHOD);
 
-        if (!param)
+        if(!param)
         {
             return "POST"; /* Added hard-coded string to avoid inclusion of HTTP
-                            * Transport header
-                            */
+             * Transport header
+             */
         }
         return (axis2_char_t *)axutil_param_get_value(param, env);
     }
@@ -440,18 +429,18 @@
     axis2_char_t *opname = NULL;
     AXIS2_PARAM_CHECK(env->error, rest_http_location, AXIS2_FAILURE);
     opname = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
-    if (op->rest_http_location)
+    if(op->rest_http_location)
     {
         AXIS2_FREE(env->allocator, op->rest_http_location);
     }
     op->rest_http_location = NULL;
-    if (rest_http_location)
+    if(rest_http_location)
     {
         op->rest_http_location = axutil_strdup(env, rest_http_location);
         return AXIS2_SUCCESS;
     }
-    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-        "Setting rest http location failed for operation %s", opname);
+    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Setting rest http location failed for operation %s",
+        opname);
     return AXIS2_FAILURE;
 }
 
@@ -460,10 +449,10 @@
     const axis2_op_t * op,
     const axutil_env_t * env)
 {
-    if (!op)
+    if(!op)
     {
         return NULL;
-    } 
+    }
     return op->rest_http_location;
 }
 
@@ -475,12 +464,12 @@
 {
     AXIS2_PARAM_CHECK(env->error, svc, AXIS2_FAILURE);
 
-    if (op->parent)
+    if(op->parent)
     {
         op->parent = NULL;
     }
     op->parent = svc;
-    if (svc)
+    if(svc)
     {
         axis2_desc_set_parent(op->base, env, axis2_svc_get_base(svc, env));
     }
@@ -503,11 +492,11 @@
 {
     AXIS2_PARAM_CHECK(env->error, msg_recv, AXIS2_FAILURE);
 
-    if (op->msg_recv == msg_recv)
+    if(op->msg_recv == msg_recv)
     {
         return AXIS2_SUCCESS;
     }
-    if (op->msg_recv)
+    if(op->msg_recv)
     {
         axis2_msg_recv_free(op->msg_recv, env);
         op->msg_recv = NULL;
@@ -531,15 +520,15 @@
     const axutil_env_t * env,
     const axutil_qname_t * qname)
 {
-    if (op->qname)
+    if(op->qname)
     {
         axutil_qname_free(op->qname, env);
         op->qname = NULL;
     }
 
-    if (qname)
+    if(qname)
     {
-        op->qname = axutil_qname_clone((axutil_qname_t *) qname, env);
+        op->qname = axutil_qname_clone((axutil_qname_t *)qname, env);
     }
 
     return AXIS2_SUCCESS;
@@ -550,7 +539,7 @@
     void *op,
     const axutil_env_t * env)
 {
-    return ((axis2_op_t *) op)->qname;
+    return ((axis2_op_t *)op)->qname;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -561,7 +550,7 @@
 {
     AXIS2_PARAM_CHECK(env->error, pattern, AXIS2_FAILURE);
 
-    if (op->msg_exchange_pattern)
+    if(op->msg_exchange_pattern)
     {
         AXIS2_FREE(env->allocator, op->msg_exchange_pattern);
         op->msg_exchange_pattern = NULL;
@@ -595,7 +584,7 @@
 {
     AXIS2_PARAM_CHECK(env->error, style, AXIS2_FAILURE);
 
-    if (op->style)
+    if(op->style)
     {
         AXIS2_FREE(env->allocator, op->style);
         op->style = NULL;
@@ -625,32 +614,30 @@
     AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE);
     opname = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
     collection_module = op->engaged_module_list;
-    if (collection_module)
+    if(collection_module)
     {
         size = axutil_array_list_size(collection_module, env);
     }
-    for (index = 0; index < size; index++)
+    for(index = 0; index < size; index++)
     {
         const axutil_qname_t *qname1 = NULL;
         const axutil_qname_t *qname2 = NULL;
 
-        module_desc =
-            (axis2_module_desc_t *) axutil_array_list_get(collection_module,
-                                                          env, index);
-        if (!module_desc)
-        {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Retrieving a module failed from operation %s engaged module"\
-                " list", opname);
+        module_desc = (axis2_module_desc_t *)axutil_array_list_get(collection_module, env, index);
+        if(!module_desc)
+        {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                "Retrieving a module failed from operation %s engaged module"
+                    " list", opname);
             return AXIS2_FAILURE;
         }
         qname1 = axis2_module_desc_get_qname(module_desc, env);
         qname2 = axis2_module_desc_get_qname(moduleref, env);
         modname = axutil_qname_get_localpart(qname2, env);
-        if (axutil_qname_equals(qname1, env, qname2))
+        if(axutil_qname_equals(qname1, env, qname2))
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
-                "Module %s already engaged to operation %s", modname, opname);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Module %s already engaged to operation %s",
+                modname, opname);
 
             need_to_add = AXIS2_FALSE;
             return AXIS2_FAILURE;
@@ -658,22 +645,22 @@
 
     }
     pr = axis2_phase_resolver_create_with_config(env, conf);
-    if (pr)
+    if(pr)
     {
         axis2_module_t *module = NULL;
         axis2_status_t status = AXIS2_FAILURE;
 
         status = axis2_phase_resolver_engage_module_to_op(pr, env, op, moduleref);
-        if (AXIS2_SUCCESS != status)
+        if(AXIS2_SUCCESS != status)
         {
             /* Ignore the status */
             AXIS2_ERROR_SET_STATUS_CODE(env->error, AXIS2_SUCCESS);
-            AXIS2_LOG_INFO(env->log, AXIS2_LOG_SI, 
+            AXIS2_LOG_INFO(env->log, AXIS2_LOG_SI,
                 "Engaging module %s to operaion %s failed. But ignore this.", modname, opname);
         }
         module = axis2_module_desc_get_module(moduleref, env);
 
-        if (need_to_add)
+        if(need_to_add)
         {
             axutil_array_list_add(collection_module, env, moduleref);
         }
@@ -699,24 +686,22 @@
 
     AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE);
 
-    if (!op->engaged_module_list)
+    if(!op->engaged_module_list)
     {
         op->engaged_module_list = axutil_array_list_create(env, 0);
     }
     size = axutil_array_list_size(op->engaged_module_list, env);
 
     module_qname = axis2_module_desc_get_qname(module_desc, env);
-    for (index = 0; index < size; index++)
+    for(index = 0; index < size; index++)
     {
         const axutil_qname_t *module_qname_l = NULL;
 
-        module_desc_l =
-            (axis2_module_desc_t *) axutil_array_list_get(op->
-                                                          engaged_module_list,
-                                                          env, index);
+        module_desc_l = (axis2_module_desc_t *)axutil_array_list_get(op-> engaged_module_list, env,
+            index);
         module_qname_l = axis2_module_desc_get_qname(module_desc_l, env);
 
-        if (axutil_qname_equals(module_qname, env, module_qname_l))
+        if(axutil_qname_equals(module_qname, env, module_qname_l))
         {
             return AXIS2_SUCCESS;
         }
@@ -743,17 +728,15 @@
     size = axutil_array_list_size(op->engaged_module_list, env);
 
     module_qname = axis2_module_desc_get_qname(module_desc, env);
-    for (index = 0; index < size; index++)
+    for(index = 0; index < size; index++)
     {
         const axutil_qname_t *module_qname_l = NULL;
 
-        module_desc_l =
-            (axis2_module_desc_t *) axutil_array_list_get(op->
-                                                          engaged_module_list,
-                                                          env, index);
+        module_desc_l = (axis2_module_desc_t *)axutil_array_list_get(op-> engaged_module_list, env,
+            index);
         module_qname_l = axis2_module_desc_get_qname(module_desc_l, env);
 
-        if (axutil_qname_equals(module_qname, env, module_qname_l))
+        if(axutil_qname_equals(module_qname, env, module_qname_l))
         {
             axutil_array_list_remove(op->engaged_module_list, env, index);
             return AXIS2_SUCCESS;
@@ -780,62 +763,58 @@
     axis2_char_t *opname = NULL;
 
     opname = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
-    if (op->mep != AXIS2_MEP_CONSTANT_INVALID)
+    if(op->mep != AXIS2_MEP_CONSTANT_INVALID)
     {
         return op->mep;
     }
 
     temp = AXIS2_MEP_CONSTANT_INVALID;
 
-    if (axutil_strcmp(AXIS2_MEP_URI_IN_OUT,
-                      axis2_op_get_msg_exchange_pattern(op, env)) == 0)
+    if(axutil_strcmp(AXIS2_MEP_URI_IN_OUT, axis2_op_get_msg_exchange_pattern(op, env)) == 0)
     {
         temp = AXIS2_MEP_CONSTANT_IN_OUT;
     }
-    else if (axutil_strcmp(AXIS2_MEP_URI_IN_ONLY,
-                           axis2_op_get_msg_exchange_pattern(op, env)) == 0)
+    else if(axutil_strcmp(AXIS2_MEP_URI_IN_ONLY, axis2_op_get_msg_exchange_pattern(op, env)) == 0)
     {
         temp = AXIS2_MEP_CONSTANT_IN_ONLY;
     }
-    else if (axutil_strcmp(AXIS2_MEP_URI_IN_OPTIONAL_OUT,
-                           axis2_op_get_msg_exchange_pattern(op, env)) == 0)
+    else if(axutil_strcmp(AXIS2_MEP_URI_IN_OPTIONAL_OUT, axis2_op_get_msg_exchange_pattern(op, env))
+        == 0)
     {
         temp = AXIS2_MEP_CONSTANT_IN_OPTIONAL_OUT;
     }
-    else if (axutil_strcmp(AXIS2_MEP_URI_OUT_IN,
-                           axis2_op_get_msg_exchange_pattern(op, env)) == 0)
+    else if(axutil_strcmp(AXIS2_MEP_URI_OUT_IN, axis2_op_get_msg_exchange_pattern(op, env)) == 0)
     {
         temp = AXIS2_MEP_CONSTANT_OUT_IN;
     }
-    else if (axutil_strcmp(AXIS2_MEP_URI_OUT_ONLY,
-                           axis2_op_get_msg_exchange_pattern(op, env)) == 0)
+    else if(axutil_strcmp(AXIS2_MEP_URI_OUT_ONLY, axis2_op_get_msg_exchange_pattern(op, env)) == 0)
     {
         temp = AXIS2_MEP_CONSTANT_OUT_ONLY;
     }
-    else if (axutil_strcmp(AXIS2_MEP_URI_OUT_OPTIONAL_IN,
-                           axis2_op_get_msg_exchange_pattern(op, env)) == 0)
+    else if(axutil_strcmp(AXIS2_MEP_URI_OUT_OPTIONAL_IN, axis2_op_get_msg_exchange_pattern(op, env))
+        == 0)
     {
         temp = AXIS2_MEP_CONSTANT_OUT_OPTIONAL_IN;
     }
-    else if (axutil_strcmp(AXIS2_MEP_URI_ROBUST_IN_ONLY,
-                           axis2_op_get_msg_exchange_pattern(op, env)) == 0)
+    else if(axutil_strcmp(AXIS2_MEP_URI_ROBUST_IN_ONLY, axis2_op_get_msg_exchange_pattern(op, env))
+        == 0)
     {
         temp = AXIS2_MEP_CONSTANT_ROBUST_IN_ONLY;
     }
-    else if (axutil_strcmp(AXIS2_MEP_URI_ROBUST_OUT_ONLY,
-                           axis2_op_get_msg_exchange_pattern(op, env)) == 0)
+    else if(axutil_strcmp(AXIS2_MEP_URI_ROBUST_OUT_ONLY, axis2_op_get_msg_exchange_pattern(op, env))
+        == 0)
     {
         temp = AXIS2_MEP_CONSTANT_ROBUST_OUT_ONLY;
     }
 
-    if (temp == AXIS2_MEP_CONSTANT_INVALID)
+    if(temp == AXIS2_MEP_CONSTANT_INVALID)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Could not map the MEP URI %s to an Axis2/C MEP constant value "\
-            "in retrieving MEP for operation %s", 
-                axis2_op_get_msg_exchange_pattern(op, env), opname);
-        AXIS2_ERROR_SET(env->error,
-            AXIS2_ERROR_COULD_NOT_MAP_MEP_URI_TO_MEP_CONSTANT, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Could not map the MEP URI %s to an Axis2/C MEP constant value "
+                "in retrieving MEP for operation %s", axis2_op_get_msg_exchange_pattern(op, env),
+            opname);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_COULD_NOT_MAP_MEP_URI_TO_MEP_CONSTANT,
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
     op->mep = temp;
@@ -848,11 +827,11 @@
     const axis2_op_t * op,
     const axutil_env_t * env)
 {
-    if (op->base)
+    if(op->base)
     {
         axis2_msg_t *msg = NULL;
         msg = axis2_desc_get_child(op->base, env, AXIS2_MSG_IN_FAULT);
-        if (msg)
+        if(msg)
         {
             return axis2_msg_get_flow(msg, env);
         }
@@ -865,11 +844,11 @@
     const axis2_op_t * op,
     const axutil_env_t * env)
 {
-    if (op->base)
+    if(op->base)
     {
         axis2_msg_t *msg = NULL;
         msg = axis2_desc_get_child(op->base, env, AXIS2_MSG_OUT_FAULT);
-        if (msg)
+        if(msg)
         {
             return axis2_msg_get_flow(msg, env);
         }
@@ -882,11 +861,11 @@
     const axis2_op_t * op,
     const axutil_env_t * env)
 {
-    if (op->base)
+    if(op->base)
     {
         axis2_msg_t *msg = NULL;
         msg = axis2_desc_get_child(op->base, env, AXIS2_MSG_OUT);
-        if (msg)
+        if(msg)
         {
             return axis2_msg_get_flow(msg, env);
         }
@@ -899,11 +878,11 @@
     const axis2_op_t * op,
     const axutil_env_t * env)
 {
-    if (op->base)
+    if(op->base)
     {
         axis2_msg_t *msg = NULL;
         msg = axis2_desc_get_child(op->base, env, AXIS2_MSG_IN);
-        if (msg)
+        if(msg)
         {
             return axis2_msg_get_flow(msg, env);
         }
@@ -919,11 +898,11 @@
 {
     AXIS2_PARAM_CHECK(env->error, list, AXIS2_FAILURE);
 
-    if (op->base)
+    if(op->base)
     {
         axis2_msg_t *msg = NULL;
         msg = axis2_desc_get_child(op->base, env, AXIS2_MSG_IN_FAULT);
-        if (msg)
+        if(msg)
         {
             return axis2_msg_set_flow(msg, env, list);
         }
@@ -938,11 +917,11 @@
     axutil_array_list_t * list)
 {
     AXIS2_PARAM_CHECK(env->error, list, AXIS2_FAILURE);
-    if (op->base)
+    if(op->base)
     {
         axis2_msg_t *msg = NULL;
         msg = axis2_desc_get_child(op->base, env, AXIS2_MSG_OUT_FAULT);
-        if (msg)
+        if(msg)
         {
             return axis2_msg_set_flow(msg, env, list);
         }
@@ -958,11 +937,11 @@
 {
     AXIS2_PARAM_CHECK(env->error, list, AXIS2_FAILURE);
 
-    if (op->base)
+    if(op->base)
     {
         axis2_msg_t *msg = NULL;
         msg = axis2_desc_get_child(op->base, env, AXIS2_MSG_OUT);
-        if (msg)
+        if(msg)
         {
             return axis2_msg_set_flow(msg, env, list);
         }
@@ -979,11 +958,11 @@
 {
     AXIS2_PARAM_CHECK(env->error, list, AXIS2_FAILURE);
 
-    if (op->base)
+    if(op->base)
     {
         axis2_msg_t *msg = NULL;
         msg = axis2_desc_get_child(op->base, env, AXIS2_MSG_IN);
-        if (msg)
+        if(msg)
         {
             return axis2_msg_set_flow(msg, env, list);
         }
@@ -1000,7 +979,7 @@
     axutil_qname_t *module_qname_l = NULL;
 
     AXIS2_PARAM_CHECK(env->error, module_qname, AXIS2_FAILURE);
-    module_qname_l = axutil_qname_clone((axutil_qname_t *) module_qname, env);
+    module_qname_l = axutil_qname_clone((axutil_qname_t *)module_qname, env);
 
     return axutil_array_list_add(op->module_qnames, env, module_qname_l);
 }
@@ -1027,16 +1006,16 @@
 
     AXIS2_PARAM_CHECK(env->error, msg_ctx, NULL);
     AXIS2_PARAM_CHECK(env->error, svc_ctx, NULL);
-    
+
     opname = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
     relates_to = axis2_msg_ctx_get_relates_to(msg_ctx, env);
-    if (!relates_to)
+    if(!relates_to)
     {
         op_ctx = axis2_op_ctx_create(env, op, svc_ctx);
-        if (!op_ctx)
+        if(!op_ctx)
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                 "Creating operation context failed for operation %s", opname);
             return NULL;
         }
@@ -1049,18 +1028,17 @@
         conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
         value = axis2_relates_to_get_value(relates_to, env);
         op_ctx = axis2_conf_ctx_get_op_ctx(conf_ctx, env, value);
-        if (!op_ctx)
+        if(!op_ctx)
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                 "Cannot correlate message to %s for operation %s", value, opname);
-            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CANNOT_CORRELATE_MSG,
-                AXIS2_FAILURE);
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CANNOT_CORRELATE_MSG, AXIS2_FAILURE);
             return NULL;
         }
     }
 
     status = axis2_op_register_op_ctx(op, env, msg_ctx, op_ctx);
-    if (AXIS2_FAILURE == status)
+    if(AXIS2_FAILURE == status)
     {
         axis2_op_ctx_free(op_ctx, env);
         return NULL;
@@ -1085,13 +1063,13 @@
 
     opname = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
     op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
-    if (op_ctx)
+    if(op_ctx)
     {
         return op_ctx;
     }
 
     relates_to = axis2_msg_ctx_get_relates_to(msg_ctx, env);
-    if (!relates_to)
+    if(!relates_to)
     {
         return NULL;
     }
@@ -1103,12 +1081,11 @@
         value = axis2_relates_to_get_value(relates_to, env);
         op_ctx = axis2_conf_ctx_get_op_ctx(conf_ctx, env, value);
 
-        if (!op_ctx)
+        if(!op_ctx)
         {
             AXIS2_LOG_WARNING(env->log, AXIS2_LOG_SI,
                 "Cannot correlate message to %s for operation %s", value, opname);
-            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CANNOT_CORRELATE_MSG,
-                AXIS2_FAILURE);
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CANNOT_CORRELATE_MSG, AXIS2_FAILURE);
             return NULL;
         }
     }
@@ -1134,35 +1111,35 @@
 
     opname = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
     conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
-    if (!conf_ctx)
+    if(!conf_ctx)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Configuration context not found for message context while "\
-            "registering operation context for operation %s", opname);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Configuration context not found for message context while "
+                "registering operation context for operation %s", opname);
         return AXIS2_FAILURE;
     }
 
     status = axis2_msg_ctx_set_op_ctx(msg_ctx, env, op_ctx);
 
-    if (AXIS2_SUCCESS != status)
+    if(AXIS2_SUCCESS != status)
     {
         axutil_hash_t *op_ctx_map = NULL;
 
         msg_id = axis2_msg_ctx_get_msg_id(msg_ctx, env);
-        if (msg_id)
+        if(msg_id)
         {
-            op_ctx_map = (axutil_hash_t *) axis2_conf_ctx_get_op_ctx_map(conf_ctx, env);
+            op_ctx_map = (axutil_hash_t *)axis2_conf_ctx_get_op_ctx_map(conf_ctx, env);
             axutil_hash_set(op_ctx_map, msg_id, AXIS2_HASH_KEY_STRING, NULL);
         }
         else
         {
-            AXIS2_LOG_WARNING(env->log, AXIS2_LOG_SI, 
-                "Message id not found for message context while registering operation context "\
-                "for operation %s. The reason could be that there is no addressing enabled for "\
-                "communication", opname);
+            AXIS2_LOG_WARNING(env->log, AXIS2_LOG_SI,
+                "Message id not found for message context while registering operation context "
+                    "for operation %s. The reason could be that there is no addressing enabled for "
+                    "communication", opname);
         }
     }
-    if (axis2_op_ctx_get_is_complete(op_ctx, env))
+    if(axis2_op_ctx_get_is_complete(op_ctx, env))
     {
         axis2_op_ctx_cleanup(op_ctx, env);
     }
@@ -1179,7 +1156,7 @@
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, op_ctx, AXIS2_FAILURE);
 
-    if (!axis2_op_ctx_get_is_complete(op_ctx, env))
+    if(!axis2_op_ctx_get_is_complete(op_ctx, env))
     {
         axis2_msg_ctx_t **msg_ctxs = NULL;
         msg_ctxs = axis2_op_ctx_get_msg_ctx_map(op_ctx, env);
@@ -1188,12 +1165,11 @@
     }
     else
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Invalid message; adding operation context for the "\
-            "operation :%s is already completed", 
-            axutil_qname_get_localpart(axis2_op_get_qname(op, env), env));
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE_ADDITION,
-                        AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Invalid message; adding operation context for the "
+                "operation :%s is already completed", axutil_qname_get_localpart(
+                axis2_op_get_qname(op, env), env));
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE_ADDITION, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
 
@@ -1210,7 +1186,7 @@
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, op_ctx, AXIS2_FAILURE);
 
-    if (!axis2_op_ctx_get_is_complete(op_ctx, env))
+    if(!axis2_op_ctx_get_is_complete(op_ctx, env))
     {
         axis2_msg_ctx_t **msg_ctxs = NULL;
         msg_ctxs = axis2_op_ctx_get_msg_ctx_map(op_ctx, env);
@@ -1219,12 +1195,11 @@
     }
     else
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Invalid message; adding operation context for the "\
-            "operation :%s is already completed", 
-            axutil_qname_get_localpart(axis2_op_get_qname(op, env), env));
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE_ADDITION,
-            AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Invalid message; adding operation context for the "
+                "operation :%s is already completed", axutil_qname_get_localpart(
+                axis2_op_get_qname(op, env), env));
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE_ADDITION, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
 
@@ -1249,17 +1224,16 @@
     in_msg_ctx = mep[AXIS2_WSDL_MESSAGE_LABEL_IN];
     out_msg_ctx = mep[AXIS2_WSDL_MESSAGE_LABEL_OUT];
 
-    if (in_msg_ctx && out_msg_ctx)
+    if(in_msg_ctx && out_msg_ctx)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Invalid message; adding operation context for the "\
-            "operation :%s is invalid", 
-            axutil_qname_get_localpart(axis2_op_get_qname(op, env), env));
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE_ADDITION,
-            AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Invalid message; adding operation context for the "
+                "operation :%s is invalid", axutil_qname_get_localpart(axis2_op_get_qname(op, env),
+                env));
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE_ADDITION, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    if (!in_msg_ctx)
+    if(!in_msg_ctx)
     {
         mep[AXIS2_WSDL_MESSAGE_LABEL_IN] = msg_ctx;
     }
@@ -1288,17 +1262,16 @@
     mep = axis2_op_ctx_get_msg_ctx_map(op_ctx, env);
     in_msg_ctx = mep[AXIS2_WSDL_MESSAGE_LABEL_IN];
     out_msg_ctx = mep[AXIS2_WSDL_MESSAGE_LABEL_OUT];
-    if (in_msg_ctx && out_msg_ctx)
+    if(in_msg_ctx && out_msg_ctx)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Invalid message; adding operation context for the "\
-            "operation :%s is invalid", 
-            axutil_qname_get_localpart(axis2_op_get_qname(op, env), env));
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE_ADDITION,
-            AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Invalid message; adding operation context for the "
+                "operation :%s is invalid", axutil_qname_get_localpart(axis2_op_get_qname(op, env),
+                env));
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE_ADDITION, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    if (!out_msg_ctx)
+    if(!out_msg_ctx)
     {
         mep[AXIS2_WSDL_MESSAGE_LABEL_OUT] = msg_ctx;
     }
@@ -1318,7 +1291,7 @@
 {
     AXIS2_PARAM_CHECK(env->error, label, NULL);
 
-    return (axis2_msg_t *) axis2_desc_get_child(op->base, env, label);
+    return (axis2_msg_t *)axis2_desc_get_child(op->base, env, label);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -1349,15 +1322,14 @@
 {
     AXIS2_PARAM_CHECK(env->error, mapping_list, AXIS2_FAILURE);
 
-    if (op->wsamapping_list)
+    if(op->wsamapping_list)
     {
         int i = 0;
         int size = 0;
         size = axutil_array_list_size(op->wsamapping_list, env);
         for(i = 0; i < size; i++)
         {
-            axis2_char_t *temp_str = axutil_array_list_get(op->wsamapping_list, 
-                env, i);
+            axis2_char_t *temp_str = axutil_array_list_get(op->wsamapping_list, env, i);
             if(temp_str)
                 AXIS2_FREE(env->allocator, temp_str);
         }

Modified: webservices/axis2/trunk/c/src/core/description/phase_rule.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/description/phase_rule.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/description/phase_rule.c (original)
+++ webservices/axis2/trunk/c/src/core/description/phase_rule.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -48,7 +47,7 @@
     axis2_phase_rule_t *phase_rule = NULL;
 
     phase_rule = AXIS2_MALLOC(env->allocator, sizeof(axis2_phase_rule_t));
-    if (!phase_rule)
+    if(!phase_rule)
     {
         AXIS2_ERROR_SET_ERROR_NUMBER(env->error, AXIS2_ERROR_NO_MEMORY);
         AXIS2_ERROR_SET_STATUS_CODE(env->error, AXIS2_FAILURE);
@@ -61,7 +60,7 @@
     phase_rule->first = AXIS2_FALSE;
     phase_rule->last = AXIS2_FALSE;
 
-    if (name)
+    if(name)
     {
         phase_rule->name = axutil_strdup(env, name);
     }
@@ -83,15 +82,15 @@
     const axutil_env_t * env,
     const axis2_char_t * before)
 {
-    if (phase_rule->before)
+    if(phase_rule->before)
     {
         AXIS2_FREE(env->allocator, phase_rule->before);
     }
 
-    if (before)
+    if(before)
     {
         phase_rule->before = axutil_strdup(env, before);
-        if (!phase_rule->before)
+        if(!phase_rule->before)
         {
             AXIS2_ERROR_SET_ERROR_NUMBER(env->error, AXIS2_ERROR_NO_MEMORY);
             AXIS2_ERROR_SET_STATUS_CODE(env->error, AXIS2_FAILURE);
@@ -116,15 +115,15 @@
     const axutil_env_t * env,
     const axis2_char_t * after)
 {
-    if (phase_rule->after)
+    if(phase_rule->after)
     {
         AXIS2_FREE(env->allocator, phase_rule->after);
     }
 
-    if (after)
+    if(after)
     {
         phase_rule->after = axutil_strdup(env, after);
-        if (!phase_rule->after)
+        if(!phase_rule->after)
         {
             AXIS2_ERROR_SET_ERROR_NUMBER(env->error, AXIS2_ERROR_NO_MEMORY);
             AXIS2_ERROR_SET_STATUS_CODE(env->error, AXIS2_FAILURE);
@@ -149,15 +148,15 @@
     const axutil_env_t * env,
     const axis2_char_t * name)
 {
-    if (phase_rule->name)
+    if(phase_rule->name)
     {
         AXIS2_FREE(env->allocator, phase_rule->name);
     }
 
-    if (name)
+    if(name)
     {
         phase_rule->name = axutil_strdup(env, name);
-        if (!phase_rule->name)
+        if(!phase_rule->name)
         {
             AXIS2_ERROR_SET_ERROR_NUMBER(env->error, AXIS2_ERROR_NO_MEMORY);
             AXIS2_ERROR_SET_STATUS_CODE(env->error, AXIS2_FAILURE);
@@ -209,17 +208,17 @@
     axis2_phase_rule_t * phase_rule,
     const axutil_env_t * env)
 {
-    if (phase_rule->before)
+    if(phase_rule->before)
     {
         AXIS2_FREE(env->allocator, phase_rule->before);
     }
 
-    if (phase_rule->after)
+    if(phase_rule->after)
     {
         AXIS2_FREE(env->allocator, phase_rule->after);
     }
 
-    if (phase_rule->name)
+    if(phase_rule->name)
     {
         AXIS2_FREE(env->allocator, phase_rule->name);
     }
@@ -237,23 +236,18 @@
     axis2_phase_rule_t *phase_rule_new = NULL;
 
     phase_rule_new = axis2_phase_rule_create(env, NULL);
-    if (!phase_rule_new)
+    if(!phase_rule_new)
         return NULL;
 
-    axis2_phase_rule_set_before(phase_rule_new, env,
-                                axis2_phase_rule_get_before(phase_rule, env));
+    axis2_phase_rule_set_before(phase_rule_new, env, axis2_phase_rule_get_before(phase_rule, env));
 
-    axis2_phase_rule_set_after(phase_rule_new, env,
-                               axis2_phase_rule_get_after(phase_rule, env));
+    axis2_phase_rule_set_after(phase_rule_new, env, axis2_phase_rule_get_after(phase_rule, env));
 
-    axis2_phase_rule_set_name(phase_rule_new, env,
-                              axis2_phase_rule_get_name(phase_rule, env));
+    axis2_phase_rule_set_name(phase_rule_new, env, axis2_phase_rule_get_name(phase_rule, env));
 
-    axis2_phase_rule_set_first(phase_rule_new, env,
-                               axis2_phase_rule_is_first(phase_rule, env));
+    axis2_phase_rule_set_first(phase_rule_new, env, axis2_phase_rule_is_first(phase_rule, env));
 
-    axis2_phase_rule_set_last(phase_rule_new, env,
-                              axis2_phase_rule_is_last(phase_rule, env));
+    axis2_phase_rule_set_last(phase_rule_new, env, axis2_phase_rule_is_last(phase_rule, env));
 
     return phase_rule_new;
 }

Modified: webservices/axis2/trunk/c/src/core/description/policy_include.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/description/policy_include.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/description/policy_include.c (original)
+++ webservices/axis2/trunk/c/src/core/description/policy_include.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -47,11 +46,10 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    policy_include = (axis2_policy_include_t *) AXIS2_MALLOC(env->allocator,
-                                                             sizeof
-                                                             (axis2_policy_include_t));
+    policy_include = (axis2_policy_include_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(axis2_policy_include_t));
 
-    if (!policy_include)
+    if(!policy_include)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -64,7 +62,7 @@
     policy_include->wrapper_elements = NULL;
 
     policy_include->registry = neethi_registry_create(env);
-    if (!policy_include->registry)
+    if(!policy_include->registry)
     {
         axis2_policy_include_free(policy_include, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -72,7 +70,7 @@
     }
 
     policy_include->wrapper_elements = axutil_hash_make(env);
-    if (!policy_include->wrapper_elements)
+    if(!policy_include->wrapper_elements)
     {
         axis2_policy_include_free(policy_include, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -92,27 +90,24 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    policy_include =
-        (axis2_policy_include_t *) axis2_policy_include_create(env);
+    policy_include = (axis2_policy_include_t *)axis2_policy_include_create(env);
 
     parent_desc = axis2_desc_get_parent(desc, env);
 
-    if (policy_include->registry)
+    if(policy_include->registry)
     {
         neethi_registry_free(policy_include->registry, env);
         policy_include->registry = NULL;
     }
 
-    if (parent_desc)
+    if(parent_desc)
     {
-        axis2_policy_include_t *preant_policy_include =
-            axis2_desc_get_policy_include(parent_desc, env);
-        if (preant_policy_include)
+        axis2_policy_include_t *preant_policy_include = axis2_desc_get_policy_include(parent_desc,
+            env);
+        if(preant_policy_include)
         {
             policy_include->registry = neethi_registry_create_with_parent(env,
-                                                                          axis2_policy_include_get_registry
-                                                                          (preant_policy_include,
-                                                                           env));
+                axis2_policy_include_get_registry(preant_policy_include, env));
         }
         else
         {
@@ -136,22 +131,22 @@
 {
     AXIS2_ENV_CHECK(env, void);
 
-    if (policy_include->registry)
+    if(policy_include->registry)
     {
         neethi_registry_free(policy_include->registry, env);
     }
 
-    if (policy_include->wrapper_elements)
+    if(policy_include->wrapper_elements)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(policy_include->wrapper_elements, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(policy_include->wrapper_elements, env); hi; hi
+            = axutil_hash_next(env, hi))
         {
             axis2_policy_wrapper_t *wrapper = NULL;
             axutil_hash_this(hi, NULL, NULL, &val);
-            wrapper = (axis2_policy_wrapper_t *) val;
-            if (wrapper)
+            wrapper = (axis2_policy_wrapper_t *)val;
+            if(wrapper)
                 AXIS2_FREE(env->allocator, wrapper);
             val = NULL;
             wrapper = NULL;
@@ -159,7 +154,7 @@
         axutil_hash_free(policy_include->wrapper_elements, env);
     }
 
-    if (policy_include)
+    if(policy_include)
     {
         AXIS2_FREE(env->allocator, policy_include);
     }
@@ -175,7 +170,7 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (policy_include->registry)
+    if(policy_include->registry)
     {
         neethi_registry_free(policy_include->registry, env);
     }
@@ -201,7 +196,7 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (policy_include->wrapper_elements)
+    if(policy_include->wrapper_elements)
     {
         axutil_hash_free(policy_include->wrapper_elements, env);
         policy_include->wrapper_elements = NULL;
@@ -209,20 +204,18 @@
 
     policy_include->wrapper_elements = axutil_hash_make(env);
 
-    if (!neethi_policy_get_name(policy, env) &&
-        !neethi_policy_get_id(policy, env))
+    if(!neethi_policy_get_name(policy, env) && !neethi_policy_get_id(policy, env))
     {
         neethi_policy_set_id(policy, env, axutil_uuid_gen(env));
     }
 
-    if (policy_include->wrapper_elements)
+    if(policy_include->wrapper_elements)
     {
         axis2_policy_wrapper_t *wrapper = NULL;
 
-        wrapper = (axis2_policy_wrapper_t *) AXIS2_MALLOC(env->allocator,
-                                                          sizeof
-                                                          (axis2_policy_wrapper_t));
-        if (wrapper)
+        wrapper = (axis2_policy_wrapper_t *)AXIS2_MALLOC(env->allocator,
+            sizeof(axis2_policy_wrapper_t));
+        if(wrapper)
         {
             axis2_char_t *policy_name = NULL;
             wrapper->type = AXIS2_ANON_POLICY;
@@ -230,16 +223,15 @@
 
             policy_name = neethi_policy_get_name(policy, env);
 
-            if (policy_name)
+            if(policy_name)
             {
                 axutil_hash_set(policy_include->wrapper_elements, policy_name,
-                                AXIS2_HASH_KEY_STRING, wrapper);
+                    AXIS2_HASH_KEY_STRING, wrapper);
             }
             else
             {
                 axutil_hash_set(policy_include->wrapper_elements,
-                                neethi_policy_get_id(policy, env),
-                                AXIS2_HASH_KEY_STRING, wrapper);
+                    neethi_policy_get_id(policy, env), AXIS2_HASH_KEY_STRING, wrapper);
             }
         }
     }
@@ -256,17 +248,16 @@
     axis2_policy_wrapper_t *wrapper = NULL;
 
     key = neethi_policy_get_name(policy, env);
-    if (!key)
+    if(!key)
         key = neethi_policy_get_id(policy, env);
 
-    if (!key)
+    if(!key)
     {
         return AXIS2_FAILURE;
     }
 
-    wrapper = axutil_hash_get(policy_include->wrapper_elements, key,
-                              AXIS2_HASH_KEY_STRING);
-    if (wrapper)
+    wrapper = axutil_hash_get(policy_include->wrapper_elements, key, AXIS2_HASH_KEY_STRING);
+    if(wrapper)
     {
         wrapper->value = policy;
         return AXIS2_SUCCESS;
@@ -308,11 +299,11 @@
     axis2_policy_include_t * policy_include,
     const axutil_env_t * env)
 {
-    if (policy_include->desc)
+    if(policy_include->desc)
     {
         axis2_desc_t *parent = NULL;
         parent = axis2_desc_get_parent(policy_include->desc, env);
-        if (parent)
+        if(parent)
         {
             return axis2_desc_get_policy_include(parent, env);
         }
@@ -330,36 +321,35 @@
     axutil_hash_index_t *hi = NULL;
     void *val = NULL;
 
-    for (hi = axutil_hash_first(policy_include->wrapper_elements, env); hi;
-         hi = axutil_hash_next(env, hi))
+    for(hi = axutil_hash_first(policy_include->wrapper_elements, env); hi; hi = axutil_hash_next(
+        env, hi))
     {
         axis2_policy_wrapper_t *wrapper = NULL;
 
         axutil_hash_this(hi, NULL, NULL, &val);
-        wrapper = (axis2_policy_wrapper_t *) val;
+        wrapper = (axis2_policy_wrapper_t *)val;
 
-        if (wrapper)
+        if(wrapper)
         {
             neethi_policy_t *policy = NULL;
-            if (wrapper->type == AXIS2_POLICY_REF)
+            if(wrapper->type == AXIS2_POLICY_REF)
             {
-                neethi_reference_t *reference =
-                    (neethi_reference_t *) wrapper->value;
-                if (reference)
+                neethi_reference_t *reference = (neethi_reference_t *)wrapper->value;
+                if(reference)
                 {
                     /* TOOD add neethi_reference_normalize
-                       policy = (neethi_policy_t*) neethi_reference_normalize(
-                       reference, env, policy_include->registry, AXIS2_FALSE);
+                     policy = (neethi_policy_t*) neethi_reference_normalize(
+                     reference, env, policy_include->registry, AXIS2_FALSE);
                      */
                 }
             }
             else
             {
-                policy = (neethi_policy_t *) wrapper->value;
+                policy = (neethi_policy_t *)wrapper->value;
             }
 
-            result = (result == NULL) ? (neethi_policy_t *) policy :
-                (neethi_policy_t *) neethi_engine_merge(env, result, policy);
+            result = (result == NULL) ? (neethi_policy_t *)policy
+                : (neethi_policy_t *)neethi_engine_merge(env, result, policy);
         }
     }
 
@@ -377,37 +367,28 @@
 
     parent = axis2_policy_include_get_parent(policy_include, env);
 
-    if (parent)
+    if(parent)
     {
-        neethi_policy_t *parent_policy =
-            axis2_policy_include_get_effective_policy(parent,
-                                                      env);
+        neethi_policy_t *parent_policy = axis2_policy_include_get_effective_policy(parent, env);
 
-        if (!parent_policy)
+        if(!parent_policy)
         {
             result = axis2_policy_include_get_policy(policy_include, env);
 
         }
         else
         {
-            if (axis2_policy_include_get_policy(policy_include, env))
+            if(axis2_policy_include_get_policy(policy_include, env))
             {
                 neethi_policy_t *temp_policy = NULL;
-                parent_policy =
-                    (neethi_policy_t *) neethi_engine_get_normalize(env,
-                                                                    AXIS2_FALSE,
-                                                                    parent_policy);
-                temp_policy =
-                    axis2_policy_include_get_policy(policy_include, env);
-                temp_policy =
-                    (neethi_policy_t *) neethi_engine_get_normalize(env,
-                                                                    AXIS2_FALSE,
-                                                                    temp_policy);
+                parent_policy = (neethi_policy_t *)neethi_engine_get_normalize(env, AXIS2_FALSE,
+                    parent_policy);
+                temp_policy = axis2_policy_include_get_policy(policy_include, env);
+                temp_policy = (neethi_policy_t *)neethi_engine_get_normalize(env, AXIS2_FALSE,
+                    temp_policy);
                 /* result = (neethi_policy_t*) neethi_engine_merge(env, parent_policy,
-                   axis2_policy_include_get_policy(policy_include, env)); */
-                result =
-                    (neethi_policy_t *) neethi_engine_merge(env, parent_policy,
-                                                            temp_policy);
+                 axis2_policy_include_get_policy(policy_include, env)); */
+                result = (neethi_policy_t *)neethi_engine_merge(env, parent_policy, temp_policy);
 
             }
             else
@@ -423,7 +404,7 @@
 
     return result;
     /*policy_include->effective_policy = result;
-       return AXIS2_SUCCESS; */
+     return AXIS2_SUCCESS; */
 }
 
 AXIS2_EXTERN neethi_policy_t *AXIS2_CALL
@@ -441,7 +422,7 @@
     const axutil_env_t * env)
 {
     /*if (policy_include->effective_policy)
-       return policy_include->effective_policy;
+     return policy_include->effective_policy;
      */
     return axis2_policy_include_calculate_effective_policy(policy_include, env);
     /*return policy_include->effective_policy; */
@@ -458,15 +439,15 @@
 
     policy_elements_list = axutil_array_list_create(env, 10);
 
-    for (hi = axutil_hash_first(policy_include->wrapper_elements, env); hi;
-         hi = axutil_hash_next(env, hi))
+    for(hi = axutil_hash_first(policy_include->wrapper_elements, env); hi; hi = axutil_hash_next(
+        env, hi))
     {
         axis2_policy_wrapper_t *wrapper = NULL;
 
         axutil_hash_this(hi, NULL, NULL, &val);
-        wrapper = (axis2_policy_wrapper_t *) val;
+        wrapper = (axis2_policy_wrapper_t *)val;
 
-        if (wrapper)
+        if(wrapper)
         {
             axutil_array_list_add(policy_elements_list, env, wrapper->value);
         }
@@ -486,15 +467,15 @@
 
     policy_elements_list = axutil_array_list_create(env, 10);
 
-    for (hi = axutil_hash_first(policy_include->wrapper_elements, env); hi;
-         hi = axutil_hash_next(env, hi))
+    for(hi = axutil_hash_first(policy_include->wrapper_elements, env); hi; hi = axutil_hash_next(
+        env, hi))
     {
         axis2_policy_wrapper_t *wrapper = NULL;
 
         axutil_hash_this(hi, NULL, NULL, &val);
-        wrapper = (axis2_policy_wrapper_t *) val;
+        wrapper = (axis2_policy_wrapper_t *)val;
 
-        if (wrapper && wrapper->type == type)
+        if(wrapper && wrapper->type == type)
         {
             axutil_array_list_add(policy_elements_list, env, wrapper->value);
         }
@@ -509,10 +490,9 @@
     axis2_char_t * key,
     neethi_policy_t * policy)
 {
-    if (policy_include->registry)
+    if(policy_include->registry)
     {
-        return neethi_registry_register(policy_include->registry, env, key,
-                                        policy);
+        return neethi_registry_register(policy_include->registry, env, key, policy);
     }
     return AXIS2_FAILURE;
 }
@@ -523,7 +503,7 @@
     const axutil_env_t * env,
     axis2_char_t * key)
 {
-    if (policy_include->registry)
+    if(policy_include->registry)
     {
         return neethi_registry_lookup(policy_include->registry, env, key);
     }
@@ -539,43 +519,40 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (!neethi_policy_get_name(policy, env) &&
-        !neethi_policy_get_id(policy, env))
+    if(!neethi_policy_get_name(policy, env) && !neethi_policy_get_id(policy, env))
     {
         axis2_char_t *uuid = axutil_uuid_gen(env);
         neethi_policy_set_id(policy, env, uuid);
-        if (uuid)
+        if(uuid)
         {
             AXIS2_FREE(env->allocator, uuid);
             uuid = NULL;
         }
     }
 
-    if (policy_include->wrapper_elements)
+    if(policy_include->wrapper_elements)
     {
         axis2_policy_wrapper_t *wrapper = NULL;
 
-        wrapper = (axis2_policy_wrapper_t *) AXIS2_MALLOC(env->allocator,
-                                                          sizeof
-                                                          (axis2_policy_wrapper_t));
-        if (wrapper)
+        wrapper = (axis2_policy_wrapper_t *)AXIS2_MALLOC(env->allocator,
+            sizeof(axis2_policy_wrapper_t));
+        if(wrapper)
         {
             axis2_char_t *policy_name = NULL;
             wrapper->type = type;
             wrapper->value = policy;
 
             policy_name = neethi_policy_get_name(policy, env);
-            if (!policy_name)
+            if(!policy_name)
                 policy_name = neethi_policy_get_id(policy, env);
 
-            if (policy_name)
+            if(policy_name)
             {
                 axutil_hash_set(policy_include->wrapper_elements, policy_name,
-                                AXIS2_HASH_KEY_STRING, wrapper);
-                if (policy_include->registry)
+                    AXIS2_HASH_KEY_STRING, wrapper);
+                if(policy_include->registry)
                 {
-                    neethi_registry_register(policy_include->registry,
-                                             env, policy_name, policy);
+                    neethi_registry_register(policy_include->registry, env, policy_name, policy);
                 }
                 return AXIS2_SUCCESS;
             }
@@ -593,16 +570,14 @@
 {
     axis2_policy_wrapper_t *wrapper = NULL;
 
-    wrapper = (axis2_policy_wrapper_t *) AXIS2_MALLOC(env->allocator,
-                                                      sizeof
-                                                      (axis2_policy_wrapper_t));
-    if (wrapper)
+    wrapper
+        = (axis2_policy_wrapper_t *)AXIS2_MALLOC(env->allocator, sizeof(axis2_policy_wrapper_t));
+    if(wrapper)
     {
         wrapper->type = type;
         wrapper->value = reference;
-        axutil_hash_set(policy_include->wrapper_elements,
-                        neethi_reference_get_uri(reference, env),
-                        AXIS2_HASH_KEY_STRING, wrapper);
+        axutil_hash_set(policy_include->wrapper_elements, neethi_reference_get_uri(reference, env),
+            AXIS2_HASH_KEY_STRING, wrapper);
     }
     return AXIS2_SUCCESS;
 }
@@ -613,15 +588,13 @@
     const axutil_env_t * env,
     axis2_char_t * policy_uri)
 {
-    if (policy_include->wrapper_elements)
+    if(policy_include->wrapper_elements)
     {
-        axutil_hash_set(policy_include->wrapper_elements,
-                        policy_uri, AXIS2_HASH_KEY_STRING, NULL);
+        axutil_hash_set(policy_include->wrapper_elements, policy_uri, AXIS2_HASH_KEY_STRING, NULL);
     }
-    if (policy_include->registry)
+    if(policy_include->registry)
     {
-        neethi_registry_register(policy_include->registry,
-                                 env, policy_uri, NULL);
+        neethi_registry_register(policy_include->registry, env, policy_uri, NULL);
     }
     return AXIS2_SUCCESS;
 }
@@ -631,7 +604,7 @@
     axis2_policy_include_t * policy_include,
     const axutil_env_t * env)
 {
-    if (policy_include->wrapper_elements)
+    if(policy_include->wrapper_elements)
     {
         axutil_hash_free(policy_include->wrapper_elements, env);
     }