You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pi...@apache.org on 2007/03/12 10:51:41 UTC

svn commit: r517155 - /webservices/axis2/trunk/c/axiom/src/om/om_attribute.c

Author: pini
Date: Mon Mar 12 02:51:41 2007
New Revision: 517155

URL: http://svn.apache.org/viewvc?view=rev&rev=517155
Log:
Fixed indentation.

Modified:
    webservices/axis2/trunk/c/axiom/src/om/om_attribute.c

Modified: webservices/axis2/trunk/c/axiom/src/om/om_attribute.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_attribute.c?view=diff&rev=517155&r1=517154&r2=517155
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_attribute.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_attribute.c Mon Mar 12 02:51:41 2007
@@ -34,9 +34,9 @@
 
 AXIS2_EXTERN axiom_attribute_t* AXIS2_CALL
 axiom_attribute_create(const axis2_env_t *env,
-        const axis2_char_t * localname,
-        const axis2_char_t * value,
-        axiom_namespace_t * ns)
+    const axis2_char_t * localname,
+    const axis2_char_t * value,
+    axiom_namespace_t * ns)
 {
     axiom_attribute_t *attribute = NULL;
 
@@ -45,7 +45,7 @@
     AXIS2_PARAM_CHECK(env->error, localname, NULL);
 
     attribute = (axiom_attribute_t *) AXIS2_MALLOC(env->allocator,
-            sizeof(axiom_attribute_t));
+        sizeof(axiom_attribute_t));
     if (!attribute)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -85,27 +85,26 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_attribute_free(axiom_attribute_t *attribute,
-        const axis2_env_t *env)
+    const axis2_env_t *env)
 {
     if (--attribute->ref > 0)
-	  return AXIS2_SUCCESS;
+    {
+        return AXIS2_SUCCESS;
+    }
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
     if (attribute->localname)
     {
         AXIS2_FREE(env->allocator, attribute->localname);
-        attribute->localname = NULL;
     }
     if (attribute->value)
     {
         AXIS2_FREE(env->allocator, attribute->value);
-        attribute->value = NULL;
     }
     if (attribute->qname)
     {
         AXIS2_QNAME_FREE(attribute->qname, env);
-        attribute->qname = NULL;
     }
     
     AXIS2_FREE(env->allocator, attribute);
@@ -114,8 +113,7 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_attribute_free_void_arg(
-    void *attribute,
+axiom_attribute_free_void_arg(void *attribute,
     const axis2_env_t *env)
 {
     axiom_attribute_t *om_attribute_l = NULL;
@@ -125,10 +123,9 @@
     return axiom_attribute_free(om_attribute_l, env);
 }
 
-
-AXIS2_EXTERN axis2_qname_t * AXIS2_CALL
+AXIS2_EXTERN axis2_qname_t *AXIS2_CALL
 axiom_attribute_get_qname(axiom_attribute_t *attribute,
-        const axis2_env_t *env)
+    const axis2_env_t *env)
 {
     axis2_qname_t *qname = NULL;
     AXIS2_ENV_CHECK(env, NULL);
@@ -137,14 +134,14 @@
         if (attribute->ns)
         {
             qname = axis2_qname_create(env,
-                    attribute->localname,
-                    AXIOM_NAMESPACE_GET_URI(attribute->ns, env),
-                    AXIOM_NAMESPACE_GET_PREFIX(attribute->ns, env));
+                attribute->localname,
+                AXIOM_NAMESPACE_GET_URI(attribute->ns, env),
+                AXIOM_NAMESPACE_GET_PREFIX(attribute->ns, env));
         }
         else
         {
             qname = axis2_qname_create(env, attribute->localname,
-                    NULL,  NULL);
+                NULL,  NULL);
         }
         attribute->qname = qname;
         return qname;
@@ -152,11 +149,10 @@
     return attribute->qname;
 }
 
-
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_attribute_serialize(axiom_attribute_t *attribute,
-        const axis2_env_t *env,
-        axiom_output_t *om_output)
+    const axis2_env_t *env,
+    axiom_output_t *om_output)
 {
     int status = AXIS2_SUCCESS;
 
@@ -174,36 +170,35 @@
         if ((uri) && (NULL != prefix) && (AXIS2_STRCMP(prefix, "") != 0))
         {
             status = axiom_output_write(om_output, env, AXIOM_ATTRIBUTE, 4,
-                    attribute->localname,
-                    attribute->value,
-                    uri , prefix);
+                attribute->localname,
+                attribute->value,
+                uri , prefix);
         }
         else if (uri)
         {
             status = axiom_output_write(om_output, env, AXIOM_ATTRIBUTE, 3,
-                    attribute->localname, attribute->value, uri);
+                attribute->localname, attribute->value, uri);
         }
     }
     else
     {
         status = axiom_output_write(om_output, env, AXIOM_ATTRIBUTE, 2,
-                attribute->localname, attribute->value);
+            attribute->localname, attribute->value);
     }
     return status;
 }
 
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
 axiom_attribute_get_localname(axiom_attribute_t *attribute,
-        const axis2_env_t *env)
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return attribute->localname;
-
 }
 
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
 axiom_attribute_get_value(axiom_attribute_t *attribute,
-        const axis2_env_t *env)
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return attribute->value;
@@ -211,7 +206,7 @@
 
 AXIS2_EXTERN axiom_namespace_t* AXIS2_CALL
 axiom_attribute_get_namespace(axiom_attribute_t *attribute,
-        const axis2_env_t *env)
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return attribute->ns;
@@ -219,8 +214,8 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_attribute_set_localname(axiom_attribute_t *attribute,
-        const axis2_env_t *env,
-        const axis2_char_t *localname)
+    const axis2_env_t *env,
+    const axis2_char_t *localname)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
@@ -228,7 +223,6 @@
     if ((attribute->localname))
     {
         AXIS2_FREE(env->allocator, attribute->localname);
-        attribute->localname = NULL;
     }
 
     attribute->localname = (axis2_char_t*)AXIS2_STRDUP(localname, env);
@@ -244,8 +238,8 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_attribute_set_value(axiom_attribute_t *attribute,
-        const axis2_env_t *env,
-        const axis2_char_t *value)
+    const axis2_env_t *env,
+    const axis2_char_t *value)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
@@ -253,7 +247,6 @@
     if (attribute->value)
     {
         AXIS2_FREE(env->allocator, attribute->value);
-        attribute->value = NULL;
     }
 
     attribute->value = (axis2_char_t*)AXIS2_STRDUP(value, env);
@@ -267,8 +260,8 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_attribute_set_namespace(axiom_attribute_t *attribute,
-        const axis2_env_t *env,
-        axiom_namespace_t *om_namespace)
+    const axis2_env_t *env,
+    axiom_namespace_t *om_namespace)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_FUNC_PARAM_CHECK(om_namespace, env, AXIS2_FAILURE);
@@ -278,7 +271,7 @@
 
 AXIS2_EXTERN axiom_attribute_t* AXIS2_CALL
 axiom_attribute_clone(axiom_attribute_t *attribute,
-        const axis2_env_t *env)
+    const axis2_env_t *env)
 {
     axiom_attribute_t *cloned_attr    = NULL;
     if (!attribute) return NULL;
@@ -286,9 +279,9 @@
 
     /** namespace is not cloned since it is a shollow copy*/
     cloned_attr = axiom_attribute_create(env,
-            attribute->localname,
-            attribute->value,
-            attribute->ns);
+        attribute->localname,
+        attribute->value,
+        attribute->ns);
     if (cloned_attr)
     {
         return cloned_attr;
@@ -304,4 +297,5 @@
     om_attribute->ref++;
     return AXIS2_SUCCESS;
 }
+
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org