axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r805360 [6/13] - in /webservices/axis2/trunk/c/axiom/src: attachments/ om/ parser/ parser/guththila/ parser/libxml2/ soap/ util/ xpath/
Date Tue, 18 Aug 2009 11:08:44 GMT
Modified: webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c?rev=805360&r1=805359&r2=805360&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c Tue Aug 18 11:08:42 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,7 +51,7 @@
 
     /** current event */
     int current_event;
-	/** Indicate the  current element level. */
+    /** Indicate the  current element level. */
     int element_level;
     axutil_hash_t *declared_namespaces;
 };
@@ -65,13 +64,10 @@
     axiom_stax_builder_t *om_builder = NULL;
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, parser, NULL);
-	
-	
-    om_builder = (axiom_stax_builder_t *) AXIS2_MALLOC(env->allocator,
-                                                       sizeof
-                                                       (axiom_stax_builder_t));
 
-    if (!om_builder)
+    om_builder = (axiom_stax_builder_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_stax_builder_t));
+
+    if(!om_builder)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -90,7 +86,7 @@
     om_builder->declared_namespaces = axutil_hash_make(env);
 
     om_builder->document = axiom_document_create(env, NULL, om_builder);
-    if (!om_builder->document)
+    if(!om_builder->document)
     {
         AXIS2_FREE(env->allocator, om_builder);
         return NULL;
@@ -121,35 +117,26 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, element_node, AXIS2_FAILURE);
 
-    attribute_count = axiom_xml_reader_get_attribute_count(om_builder->parser,
-                                                           env);
-    for (i = 1; i <= attribute_count; i++)
+    attribute_count = axiom_xml_reader_get_attribute_count(om_builder->parser, env);
+    for(i = 1; i <= attribute_count; i++)
     {
         axiom_element_t *temp_ele = NULL;
 
-        uri =
-            axiom_xml_reader_get_attribute_namespace_by_number(om_builder->
-                                                               parser, env, i);
-
-        prefix =
-            axiom_xml_reader_get_attribute_prefix_by_number(om_builder->parser,
-                                                            env, i);
-        if (uri)
+        uri = axiom_xml_reader_get_attribute_namespace_by_number(om_builder-> parser, env, i);
+
+        prefix = axiom_xml_reader_get_attribute_prefix_by_number(om_builder->parser, env, i);
+        if(uri)
         {
-            if (axutil_strcmp(uri, "") != 0)
+            if(axutil_strcmp(uri, "") != 0)
             {
                 axiom_element_t *om_ele = NULL;
-                om_ele =
-                    (axiom_element_t *)
-                    axiom_node_get_data_element(element_node, env);
-                if (om_ele)
+                om_ele = (axiom_element_t *)axiom_node_get_data_element(element_node, env);
+                if(om_ele)
                 {
-                    ns = axiom_element_find_namespace(om_ele,
-                                                      env, element_node, uri,
-                                                      prefix);
+                    ns = axiom_element_find_namespace(om_ele, env, element_node, uri, prefix);
 
                     /* newly added to handle "xml:*" attributes" (axutil_strcmp(prefix, "xml") == 0) && */
-                    if (!ns)
+                    if(!ns)
                     {
                         ns = axiom_namespace_create(env, uri, prefix);
                     }
@@ -157,9 +144,7 @@
             }
         }
 
-        attr_name =
-            axiom_xml_reader_get_attribute_name_by_number(om_builder->parser,
-                                                          env, i);
+        attr_name = axiom_xml_reader_get_attribute_name_by_number(om_builder->parser, env, i);
 
 #ifdef WIN32
         attr_name_str = axutil_string_create(env, attr_name);
@@ -168,59 +153,50 @@
         attr_name_str = axutil_string_create_assume_ownership(env, &attr_name);
 #endif
 
-        attr_value =
-            axiom_xml_reader_get_attribute_value_by_number(om_builder->parser,
-                                                           env, i);
+        attr_value = axiom_xml_reader_get_attribute_value_by_number(om_builder->parser, env, i);
 
 #ifdef WIN32
         attr_value_str = axutil_string_create(env, attr_value);
         axiom_xml_reader_xml_free(om_builder->parser, env, attr_value);
 #else
-        attr_value_str =
-            axutil_string_create_assume_ownership(env, &attr_value);
+        attr_value_str = axutil_string_create_assume_ownership(env, &attr_value);
 #endif
 
-        if (attr_name)
+        if(attr_name)
         {
-            attribute =
-                axiom_attribute_create_str(env, attr_name_str, attr_value_str,
-                                           ns);
-            if (!attribute)
+            attribute = axiom_attribute_create_str(env, attr_name_str, attr_value_str, ns);
+            if(!attribute)
             {
                 return AXIS2_FAILURE;
             }
 
-            temp_ele =
-                (axiom_element_t *) axiom_node_get_data_element(element_node,
-                                                                env);
-            if (temp_ele)
+            temp_ele = (axiom_element_t *)axiom_node_get_data_element(element_node, env);
+            if(temp_ele)
             {
-                status = axiom_element_add_attribute(temp_ele,
-                                                     env, attribute,
-                                                     element_node);
+                status = axiom_element_add_attribute(temp_ele, env, attribute, element_node);
             }
         }
-        if (uri)
+        if(uri)
         {
 #ifdef AXIS2_LIBXML2_ENABLED
             axiom_xml_reader_xml_free(om_builder->parser, env, uri);
 #else
-            AXIS2_FREE(env->allocator,uri);
+            AXIS2_FREE(env->allocator, uri);
 #endif
         }
-        if (prefix)
+        if(prefix)
         {
 #ifdef AXIS2_LIBXML2_ENABLED
             axiom_xml_reader_xml_free(om_builder->parser, env, prefix);
 #else
-            AXIS2_FREE(env->allocator,prefix);
+            AXIS2_FREE(env->allocator, prefix);
 #endif
         }
-        if (attr_name_str)
+        if(attr_name_str)
         {
             axutil_string_free(attr_name_str, env);
         }
-        if (attr_value_str)
+        if(attr_value_str)
         {
             axutil_string_free(attr_value_str, env);
         }
@@ -240,18 +216,15 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    if (!om_builder->lastnode)
+    if(!om_builder->lastnode)
     {
-        AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_INVALID_BUILDER_STATE_LAST_NODE_NULL,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_BUILDER_STATE_LAST_NODE_NULL, AXIS2_FAILURE);
         return NULL;
     }
     temp_value = axiom_xml_reader_get_value(om_builder->parser, env);
-    if (!temp_value)
+    if(!temp_value)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_VALUE_NULL,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_VALUE_NULL, AXIS2_FAILURE);
         return NULL;
     }
 
@@ -261,23 +234,22 @@
 #else
     temp_value_str = axutil_string_create_assume_ownership(env, &temp_value);
 #endif
-    if (!temp_value_str)
+    if(!temp_value_str)
     {
         /* axutil_string_create will have set an error number */
         return NULL;
     }
 
-    if (axiom_node_is_complete(om_builder->lastnode, env))
+    if(axiom_node_is_complete(om_builder->lastnode, env))
     {
-        axiom_text_create_str(env,
-                              axiom_node_get_parent(om_builder->lastnode, env),
-                              temp_value_str, &node);
+        axiom_text_create_str(env, axiom_node_get_parent(om_builder->lastnode, env),
+            temp_value_str, &node);
     }
     else
     {
         axiom_text_create_str(env, om_builder->lastnode, temp_value_str, &node);
     }
-    if (node)
+    if(node)
     {
         axiom_node_set_complete(node, env, AXIS2_TRUE);
         om_builder->lastnode = node;
@@ -300,26 +272,24 @@
 
     element = om_builder->lastnode;
 
-    if (axiom_node_is_complete(element, env) || !(om_builder->cache))
+    if(axiom_node_is_complete(element, env) || !(om_builder->cache))
     {
-        AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_INVALID_BUILDER_STATE_CANNOT_DISCARD,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_BUILDER_STATE_CANNOT_DISCARD, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
 
     om_builder->cache = AXIS2_FALSE;
     do
     {
-        while (axiom_xml_reader_next(om_builder->parser, env)
-               != AXIOM_XML_READER_END_ELEMENT);
+        while(axiom_xml_reader_next(om_builder->parser, env) != AXIOM_XML_READER_END_ELEMENT)
+            ;
     }
-    while (!(axiom_node_is_complete(element, env)));
+    while(!(axiom_node_is_complete(element, env)));
 
     /*All children of this element is pulled now */
 
     prev_node = axiom_node_get_previous_sibling(element, env);
-    if (prev_node)
+    if(prev_node)
     {
         axiom_node_free_tree(axiom_node_get_next_sibling(prev_node, env), env);
         axiom_node_set_next_sibling(prev_node, env, NULL);
@@ -357,32 +327,26 @@
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    namespace_count =
-        axiom_xml_reader_get_namespace_count(om_builder->parser, env);
-    for (i = 1; i <= namespace_count; i++)
-    {
-        temp_ns_prefix =
-            axiom_xml_reader_get_namespace_prefix_by_number(om_builder->parser,
-                                                            env, i);
-
-        temp_ns_uri =
-            axiom_xml_reader_get_namespace_uri_by_number(om_builder->parser,
-                                                         env, i);
+    namespace_count = axiom_xml_reader_get_namespace_count(om_builder->parser, env);
+    for(i = 1; i <= namespace_count; i++)
+    {
+        temp_ns_prefix
+            = axiom_xml_reader_get_namespace_prefix_by_number(om_builder->parser, env, i);
+
+        temp_ns_uri = axiom_xml_reader_get_namespace_uri_by_number(om_builder->parser, env, i);
 
 #ifdef WIN32
         temp_ns_prefix_str = axutil_string_create(env, temp_ns_prefix);
 #else
-        temp_ns_prefix_str =
-            axutil_string_create_assume_ownership(env, &temp_ns_prefix);
+        temp_ns_prefix_str = axutil_string_create_assume_ownership(env, &temp_ns_prefix);
 #endif
 
 #ifdef WIN32
         temp_ns_uri_str = axutil_string_create(env, temp_ns_uri);
 #else
-        temp_ns_uri_str =
-            axutil_string_create_assume_ownership(env, &temp_ns_uri);
+        temp_ns_uri_str = axutil_string_create_assume_ownership(env, &temp_ns_uri);
 #endif
-        if (!temp_ns_prefix || axutil_strcmp(temp_ns_prefix, "xmlns") == 0)
+        if(!temp_ns_prefix || axutil_strcmp(temp_ns_prefix, "xmlns") == 0)
         {
 
             /** default namespace case */
@@ -390,26 +354,24 @@
             /** !temp_ns_prefix is for guththila */
             axiom_element_t *om_ele = NULL;
 
-            if (temp_ns_prefix_str)
+            if(temp_ns_prefix_str)
             {
                 axutil_string_free(temp_ns_prefix_str, env);
                 temp_ns_prefix_str = NULL;
             }
 
             temp_ns_prefix_str = axutil_string_create(env, "");
-            om_ele = (axiom_element_t *) axiom_node_get_data_element(node, env);
+            om_ele = (axiom_element_t *)axiom_node_get_data_element(node, env);
 
-            om_ns =
-                axiom_namespace_create_str(env, temp_ns_uri_str,
-                                           temp_ns_prefix_str);
-            if (!om_ns || !om_ele)
+            om_ns = axiom_namespace_create_str(env, temp_ns_uri_str, temp_ns_prefix_str);
+            if(!om_ns || !om_ele)
             {
                 return AXIS2_FAILURE;
             }
 
             status = axiom_element_declare_namespace(om_ele, env, node, om_ns);
 
-            if (!status)
+            if(!status)
             {
                 axiom_namespace_free(om_ns, env);
                 om_ns = NULL;
@@ -419,32 +381,26 @@
         {
             axiom_element_t *om_ele = NULL;
             axis2_char_t *prefix = NULL;
-            om_ele = (axiom_element_t *) axiom_node_get_data_element(node, env);
+            om_ele = (axiom_element_t *)axiom_node_get_data_element(node, env);
 
-            om_ns =
-                axiom_namespace_create_str(env, temp_ns_uri_str,
-                                           temp_ns_prefix_str);
-            if (!om_ns || !om_ele)
+            om_ns = axiom_namespace_create_str(env, temp_ns_uri_str, temp_ns_prefix_str);
+            if(!om_ns || !om_ele)
             {
                 return AXIS2_FAILURE;
             }
 
-            status =
-                axiom_element_declare_namespace_assume_param_ownership(om_ele,
-                                                                       env,
-                                                                       om_ns);
+            status = axiom_element_declare_namespace_assume_param_ownership(om_ele, env, om_ns);
             prefix = axiom_namespace_get_prefix(om_ns, env);
-            axutil_hash_set(om_builder->declared_namespaces,
-                            prefix, AXIS2_HASH_KEY_STRING, om_ns);
+            axutil_hash_set(om_builder->declared_namespaces, prefix, AXIS2_HASH_KEY_STRING, om_ns);
         }
 
         axutil_string_free(temp_ns_uri_str, env);
         axutil_string_free(temp_ns_prefix_str, env);
 #ifdef WIN32
-         axiom_xml_reader_xml_free(om_builder->parser, env, temp_ns_uri);
+        axiom_xml_reader_xml_free(om_builder->parser, env, temp_ns_uri);
         axiom_xml_reader_xml_free(om_builder->parser, env, temp_ns_prefix);
 #endif
-        if (!om_ns)
+        if(!om_ns)
         {
             /* something went wrong */
             return AXIS2_FAILURE;
@@ -452,34 +408,32 @@
     }
     /* set own namespace */
     temp_prefix = axiom_xml_reader_get_prefix(om_builder->parser, env);
-    if (temp_prefix)
+    if(temp_prefix)
     {
-        om_ns = axutil_hash_get(om_builder->declared_namespaces,
-                                temp_prefix, AXIS2_HASH_KEY_STRING);
+        om_ns
+            = axutil_hash_get(om_builder->declared_namespaces, temp_prefix, AXIS2_HASH_KEY_STRING);
 
-        if (om_ns)
+        if(om_ns)
         {
             axiom_element_t *om_ele = NULL;
-            om_ele = (axiom_element_t *) axiom_node_get_data_element(node, env);
-            if (om_ele)
+            om_ele = (axiom_element_t *)axiom_node_get_data_element(node, env);
+            if(om_ele)
             {
-                axiom_element_set_namespace_assume_param_ownership(om_ele, env,
-                                                                   om_ns);
+                axiom_element_set_namespace_assume_param_ownership(om_ele, env, om_ns);
             }
         }
         else
         {
-            AXIS2_ERROR_SET(env->error,
-                            AXIS2_ERROR_INVALID_DOCUMENT_STATE_UNDEFINED_NAMESPACE,
-                            AXIS2_FAILURE);
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_DOCUMENT_STATE_UNDEFINED_NAMESPACE,
+                AXIS2_FAILURE);
             return AXIS2_FAILURE;
         }
 
-        #ifdef AXIS2_LIBXML2_ENABLED
-            axiom_xml_reader_xml_free(om_builder->parser, env, temp_prefix);
-        #else
-            AXIS2_FREE(env->allocator,temp_prefix);
-        #endif
+#ifdef AXIS2_LIBXML2_ENABLED
+        axiom_xml_reader_xml_free(om_builder->parser, env, temp_prefix);
+#else
+        AXIS2_FREE(env->allocator, temp_prefix);
+#endif
     }
 
     return status;
@@ -501,10 +455,9 @@
 
     temp_localname = axiom_xml_reader_get_name(om_builder->parser, env);
 
-    if (!temp_localname)
+    if(!temp_localname)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL, AXIS2_FAILURE);
         return NULL;
     }
 
@@ -512,18 +465,15 @@
     temp_localname_str = axutil_string_create(env, temp_localname);
     axiom_xml_reader_xml_free(om_builder->parser, env, temp_localname);
 #else
-    temp_localname_str =
-        axutil_string_create_assume_ownership(env, &temp_localname);
+    temp_localname_str = axutil_string_create_assume_ownership(env, &temp_localname);
 #endif
 
     om_builder->element_level++;
 
-    if (!(om_builder->lastnode))
+    if(!(om_builder->lastnode))
     {
-        om_ele =
-            axiom_element_create_str(env, NULL, temp_localname_str, NULL,
-                                     &element_node);
-        if (!om_ele)
+        om_ele = axiom_element_create_str(env, NULL, temp_localname_str, NULL, &element_node);
+        if(!om_ele)
         {
             return NULL;
         }
@@ -532,41 +482,34 @@
 
         axiom_node_set_builder(element_node, env, om_builder);
 
-        if (om_builder->document)
+        if(om_builder->document)
         {
             axiom_node_set_document(element_node, env, om_builder->document);
-            axiom_document_set_root_element(om_builder->document,
-                                            env, element_node);
+            axiom_document_set_root_element(om_builder->document, env, element_node);
         }
     }
-    else if (axiom_node_is_complete(om_builder->lastnode, env))
+    else if(axiom_node_is_complete(om_builder->lastnode, env))
     {
-        om_ele = axiom_element_create_str(env,
-                                          axiom_node_get_parent(om_builder->
-                                                                lastnode, env),
-                                          temp_localname_str, NULL,
-                                          &element_node);
-        if (!om_ele)
+        om_ele = axiom_element_create_str(env, axiom_node_get_parent(om_builder-> lastnode, env),
+            temp_localname_str, NULL, &element_node);
+        if(!om_ele)
         {
             return NULL;
         }
 
-        if (element_node)
+        if(element_node)
         {
-            axiom_node_set_next_sibling(om_builder->lastnode,
-                                        env, element_node);
-            axiom_node_set_previous_sibling(element_node,
-                                            env, om_builder->lastnode);
+            axiom_node_set_next_sibling(om_builder->lastnode, env, element_node);
+            axiom_node_set_previous_sibling(element_node, env, om_builder->lastnode);
             axiom_node_set_document(element_node, env, om_builder->document);
             axiom_node_set_builder(element_node, env, om_builder);
         }
     }
     else
     {
-        om_ele = axiom_element_create_str(env, om_builder->lastnode,
-                                          temp_localname_str, NULL,
-                                          &element_node);
-        if (element_node)
+        om_ele = axiom_element_create_str(env, om_builder->lastnode, temp_localname_str, NULL,
+            &element_node);
+        if(element_node)
         {
             axiom_node_set_first_child(om_builder->lastnode, env, element_node);
             axiom_node_set_parent(element_node, env, om_builder->lastnode);
@@ -582,7 +525,7 @@
     axiom_stax_builder_process_attributes(om_builder, env, element_node);
 
     om_builder->lastnode = element_node;
-    if (om_ele)
+    if(om_ele)
     {
         axiom_element_set_is_empty(om_ele, env, is_empty);
     }
@@ -600,39 +543,35 @@
     AXIS2_ENV_CHECK(env, NULL);
 
     comment_value = axiom_xml_reader_get_value(om_builder->parser, env);
-    if (!comment_value)
+    if(!comment_value)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL, AXIS2_FAILURE);
         return NULL;
     }
 
-    if (!(om_builder->lastnode))
+    if(!(om_builder->lastnode))
     {
 
 #ifdef AXIS2_LIBXML2_ENABLED
         axiom_xml_reader_xml_free(om_builder->parser, env, comment_value);
 #else
-        AXIS2_FREE(env->allocator,comment_value);
+        AXIS2_FREE(env->allocator, comment_value);
 #endif
         return NULL;
     }
-    else if (axiom_node_is_complete(om_builder->lastnode, env))
+    else if(axiom_node_is_complete(om_builder->lastnode, env))
     {
-        axiom_comment_create(env,
-                             axiom_node_get_parent(om_builder->lastnode, env),
-                             comment_value, &comment_node);
+        axiom_comment_create(env, axiom_node_get_parent(om_builder->lastnode, env), comment_value,
+            &comment_node);
 
         axiom_node_set_next_sibling(om_builder->lastnode, env, comment_node);
-        axiom_node_set_previous_sibling(comment_node, env,
-                                        om_builder->lastnode);
+        axiom_node_set_previous_sibling(comment_node, env, om_builder->lastnode);
         axiom_node_set_builder(comment_node, env, om_builder);
         axiom_node_set_document(comment_node, env, om_builder->document);
     }
     else
     {
-        axiom_comment_create(env, om_builder->lastnode,
-                             comment_value, &comment_node);
+        axiom_comment_create(env, om_builder->lastnode, comment_value, &comment_node);
 
         axiom_node_set_first_child(om_builder->lastnode, env, comment_node);
         axiom_node_set_parent(comment_node, env, om_builder->lastnode);
@@ -645,10 +584,10 @@
 #ifdef AXIS2_LIBXML2_ENABLED
     axiom_xml_reader_xml_free(om_builder->parser,env,comment_value);
 #else
-    AXIS2_FREE(env->allocator,comment_value);
+    AXIS2_FREE(env->allocator, comment_value);
 #endif
 
-	om_builder->lastnode = comment_node;
+    om_builder->lastnode = comment_node;
 
     return comment_node;
 }
@@ -664,17 +603,16 @@
     AXIS2_ENV_CHECK(env, NULL);
 
     doc_value = axiom_xml_reader_get_dtd(om_builder->parser, env);
-    if (!doc_value)
+    if(!doc_value)
     {
         return NULL;
     }
-    if (!(om_builder->lastnode))
+    if(!(om_builder->lastnode))
     {
         axiom_doctype_create(env, NULL, doc_value, &doctype_node);
-        if (om_builder->document)
+        if(om_builder->document)
         {
-            axiom_document_set_root_element(om_builder->document,
-                                            env, doctype_node);
+            axiom_document_set_root_element(om_builder->document, env, doctype_node);
         }
     }
     om_builder->lastnode = doctype_node;
@@ -694,47 +632,41 @@
     AXIS2_ENV_CHECK(env, NULL);
     target = axiom_xml_reader_get_pi_target(om_builder->parser, env);
     value = axiom_xml_reader_get_pi_data(om_builder->parser, env);
-    if (!target)
+    if(!target)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL, AXIS2_FAILURE);
         return NULL;
     }
-    if (!(om_builder->lastnode))
+    if(!(om_builder->lastnode))
     {
         /* do nothing */
         axiom_xml_reader_xml_free(om_builder->parser, env, target);
         axiom_xml_reader_xml_free(om_builder->parser, env, value);
         return NULL;
     }
-    else if (axiom_node_is_complete(om_builder->lastnode, env) ||
-             (axiom_node_get_node_type(om_builder->lastnode, env) ==
-              AXIOM_TEXT))
-    {
-        axiom_processing_instruction_create(env,
-                                            axiom_node_get_parent(om_builder->
-                                                                  lastnode,
-                                                                  env), target,
-                                            value, &pi_node);
+    else if(axiom_node_is_complete(om_builder->lastnode, env) || (axiom_node_get_node_type(
+        om_builder->lastnode, env) == AXIOM_TEXT))
+    {
+        axiom_processing_instruction_create(env, axiom_node_get_parent(om_builder-> lastnode, env),
+            target, value, &pi_node);
 
         axiom_node_set_next_sibling(om_builder->lastnode, env, pi_node);
         axiom_node_set_previous_sibling(pi_node, env, om_builder->lastnode);
     }
     else
     {
-        axiom_processing_instruction_create(env, om_builder->lastnode,
-                                            target, value, &pi_node);
+        axiom_processing_instruction_create(env, om_builder->lastnode, target, value, &pi_node);
         axiom_node_set_first_child(om_builder->lastnode, env, pi_node);
         axiom_node_set_parent(pi_node, env, om_builder->lastnode);
     }
 
     om_builder->element_level++;
 
-    if (target)
+    if(target)
     {
         axiom_xml_reader_xml_free(om_builder->parser, env, target);
     }
-    if (value)
+    if(value)
     {
         axiom_xml_reader_xml_free(om_builder->parser, env, value);
     }
@@ -752,12 +684,12 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     om_builder->element_level--;
 
-    if (om_builder->lastnode)
+    if(om_builder->lastnode)
     {
-        if (axiom_node_is_complete((om_builder->lastnode), env))
+        if(axiom_node_is_complete((om_builder->lastnode), env))
         {
             parent = axiom_node_get_parent((om_builder->lastnode), env);
-            if (parent)
+            if(parent)
             {
                 axiom_node_set_complete(parent, env, AXIS2_TRUE);
                 om_builder->lastnode = parent;
@@ -768,9 +700,9 @@
             axiom_node_set_complete((om_builder->lastnode), env, AXIS2_TRUE);
         }
     }
-    if (om_builder->root_node)
+    if(om_builder->root_node)
     {
-        if (axiom_node_is_complete(om_builder->root_node, env))
+        if(axiom_node_is_complete(om_builder->root_node, env))
         {
             om_builder->done = AXIS2_TRUE;
         }
@@ -787,92 +719,87 @@
     axiom_node_t *node = NULL;
     AXIS2_ENV_CHECK(env, NULL);
 
-    if (!om_builder->parser)
+    if(!om_builder->parser)
     {
         return NULL;
     }
     do
     {
-        if (om_builder->done)
+        if(om_builder->done)
         {
-            AXIS2_ERROR_SET(env->error,
-                            AXIS2_ERROR_BUILDER_DONE_CANNOT_PULL,
-                            AXIS2_FAILURE);
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_BUILDER_DONE_CANNOT_PULL, AXIS2_FAILURE);
             return NULL;
         }
 
         token = axiom_xml_reader_next(om_builder->parser, env);
-        if (token == -1)
+        if(token == -1)
         {
             return NULL;
         }
 
         om_builder->current_event = token;
 
-        if (!(om_builder->cache))
+        if(!(om_builder->cache))
         {
             return NULL;
         }
 
-        switch (token)
+        switch(token)
         {
-        case AXIOM_XML_READER_START_DOCUMENT:
-            /*Do nothing */
-            break;
+            case AXIOM_XML_READER_START_DOCUMENT:
+                /*Do nothing */
+                break;
 
-        case AXIOM_XML_READER_START_ELEMENT:
-            node = axiom_stax_builder_create_om_element(om_builder, env,
-                                                        AXIS2_FALSE);
-            break;
+            case AXIOM_XML_READER_START_ELEMENT:
+                node = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE);
+                break;
 
-        case AXIOM_XML_READER_EMPTY_ELEMENT:
+            case AXIOM_XML_READER_EMPTY_ELEMENT:
 
 #ifdef AXIS2_LIBXML2_ENABLED
-            node = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE);
+                node = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE);
 #else
-            node = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_TRUE);
+                node = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_TRUE);
 #endif
 
-        case AXIOM_XML_READER_END_ELEMENT:
-            axiom_stax_builder_end_element(om_builder, env);
-            break;
+            case AXIOM_XML_READER_END_ELEMENT:
+                axiom_stax_builder_end_element(om_builder, env);
+                break;
 
-        case AXIOM_XML_READER_SPACE:
-            node = axiom_stax_builder_create_om_text(om_builder, env);
-            break;
+            case AXIOM_XML_READER_SPACE:
+                node = axiom_stax_builder_create_om_text(om_builder, env);
+                break;
 
-        case AXIOM_XML_READER_CHARACTER:
-            node = axiom_stax_builder_create_om_text(om_builder, env);
-            break;
+            case AXIOM_XML_READER_CHARACTER:
+                node = axiom_stax_builder_create_om_text(om_builder, env);
+                break;
 
-        case AXIOM_XML_READER_ENTITY_REFERENCE:
-            break;
+            case AXIOM_XML_READER_ENTITY_REFERENCE:
+                break;
 
-        case AXIOM_XML_READER_COMMENT:
+            case AXIOM_XML_READER_COMMENT:
 
-            node = axiom_stax_builder_create_om_comment(om_builder, env);
-            axiom_stax_builder_end_element(om_builder, env);
-            break;
+                node = axiom_stax_builder_create_om_comment(om_builder, env);
+                axiom_stax_builder_end_element(om_builder, env);
+                break;
 
-        case AXIOM_XML_READER_PROCESSING_INSTRUCTION:
+            case AXIOM_XML_READER_PROCESSING_INSTRUCTION:
 
-            node =
-                axiom_stax_builder_create_om_processing_instruction(om_builder,
-                                                                    env);
-            axiom_stax_builder_end_element(om_builder, env);
-            break;
+                node = axiom_stax_builder_create_om_processing_instruction(om_builder, env);
+                axiom_stax_builder_end_element(om_builder, env);
+                break;
 
-        case AXIOM_XML_READER_CDATA:
-            break;
+            case AXIOM_XML_READER_CDATA:
+                break;
 
-        case AXIOM_XML_READER_DOCUMENT_TYPE:
-            break;
+            case AXIOM_XML_READER_DOCUMENT_TYPE:
+                break;
 
-        default:
-            break;
+            default:
+                break;
         }
     }
-    while (!node);
+    while(!node);
     return node;
 }
 
@@ -882,31 +809,31 @@
     const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    if (!om_builder)
+    if(!om_builder)
     {
         return;
     }
-    if (om_builder->declared_namespaces)
+    if(om_builder->declared_namespaces)
     {
         axutil_hash_free(om_builder->declared_namespaces, env);
         om_builder->declared_namespaces = NULL;
     }
 
-    if (om_builder->document)
+    if(om_builder->document)
     {
         axiom_document_free(om_builder->document, env);
         om_builder->document = NULL;
     }
     else
     {
-        if (om_builder->root_node)
+        if(om_builder->root_node)
         {
             axiom_node_free_tree(om_builder->root_node, env);
             om_builder->root_node = NULL;
         }
     }
 
-    if (om_builder->parser)
+    if(om_builder->parser)
     {
         axiom_xml_reader_free(om_builder->parser, env);
         om_builder->parser = NULL;
@@ -932,7 +859,7 @@
 
     nodes[count++] = om_node;
 
-    if (om_node)
+    if(om_node)
     {
         do
         {
@@ -942,7 +869,7 @@
 
             temp_node = axiom_node_get_first_child(om_node, env);
             /* serialize children of this node */
-            if (temp_node)
+            if(temp_node)
             {
                 om_node = temp_node;
                 nodes[count++] = om_node;
@@ -950,20 +877,20 @@
             else
             {
                 temp_node = axiom_node_get_next_sibling(om_node, env);
-                if (temp_node)
+                if(temp_node)
                 {
                     om_node = temp_node;
                     nodes[count - 1] = om_node;
                 }
                 else
                 {
-                    while (count > 1 && !temp_node)
+                    while(count > 1 && !temp_node)
                     {
                         count--;
                         om_node = nodes[count - 1];
                         temp_node = axiom_node_get_next_sibling(om_node, env);
                     }
-                    if (temp_node && count > 1)
+                    if(temp_node && count > 1)
                     {
                         om_node = temp_node;
                         nodes[count - 1] = om_node;
@@ -975,20 +902,20 @@
                 }
             }
         }
-        while (count > 0);
+        while(count > 0);
     }
-    if (om_builder->declared_namespaces)
+    if(om_builder->declared_namespaces)
     {
         axutil_hash_free(om_builder->declared_namespaces, env);
         om_builder->declared_namespaces = NULL;
     }
 
-    if (om_builder->parser)
+    if(om_builder->parser)
     {
         axiom_xml_reader_free(om_builder->parser, env);
         om_builder->parser = NULL;
     }
-    if (om_builder->document)
+    if(om_builder->document)
     {
         axiom_document_free_self(om_builder->document, env);
         om_builder->document = NULL;
@@ -1006,8 +933,8 @@
 }
 
 /**
-    This is an internal function
-*/
+ This is an internal function
+ */
 
 AXIS2_EXTERN int AXIS2_CALL
 axiom_stax_builder_get_current_event(
@@ -1020,7 +947,7 @@
 
 /**
  This is an internal function
-*/
+ */
 AXIS2_EXTERN axiom_node_t *AXIS2_CALL
 axiom_stax_builder_get_lastnode(
     axiom_stax_builder_t * om_builder,
@@ -1031,8 +958,8 @@
 }
 
 /**
-This is an internal function
-*/
+ This is an internal function
+ */
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 axiom_stax_builder_is_complete(
     axiom_stax_builder_t * om_builder,
@@ -1043,8 +970,8 @@
 }
 
 /**
-This is an internal function to be used by soap om_builder only
-*/
+ This is an internal function to be used by soap om_builder only
+ */
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_stax_builder_set_lastnode(
     axiom_stax_builder_t * om_builder,
@@ -1059,8 +986,8 @@
 }
 
 /**
-internal function for soap om_builder only
-*/
+ internal function for soap om_builder only
+ */
 AXIS2_EXTERN int AXIS2_CALL
 axiom_stax_builder_get_element_level(
     axiom_stax_builder_t * om_builder,
@@ -1071,8 +998,8 @@
 }
 
 /**
-internal function for soap om_builder only
-*/
+ internal function for soap om_builder only
+ */
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_stax_builder_set_element_level(
     axiom_stax_builder_t * om_builder,
@@ -1091,22 +1018,21 @@
 {
     int token = 0;
     void *val = NULL;
-/*	axutil_env_t* thread = NULL;*/
-/*	thread = axutil_env_create(env->allocator);*/
-/*	env = thread;*/
-    if (!om_builder)
+    /*	axutil_env_t* thread = NULL;*/
+    /*	thread = axutil_env_create(env->allocator);*/
+    /*	env = thread;*/
+    if(!om_builder)
     {
         return -1;
     }
 
-    if (om_builder->done)
+    if(om_builder->done)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_BUILDER_DONE_CANNOT_PULL,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_BUILDER_DONE_CANNOT_PULL, AXIS2_FAILURE);
         return -1;
     }
 
-    if (!om_builder->parser)
+    if(!om_builder->parser)
     {
         return -1;
     }
@@ -1115,95 +1041,93 @@
 
     om_builder->current_event = token;
 
-    if (token == -1)
+    if(token == -1)
     {
         om_builder->done = AXIS2_TRUE;
         return -1;
     }
 
-    if (!(om_builder->cache))
+    if(!(om_builder->cache))
     {
         return -1;
     }
-    switch (token)
+    switch(token)
     {
-    case AXIOM_XML_READER_START_DOCUMENT:
-        /*Do nothing */
-        break;
+        case AXIOM_XML_READER_START_DOCUMENT:
+            /*Do nothing */
+            break;
 
-    case AXIOM_XML_READER_START_ELEMENT:
-        val = axiom_stax_builder_create_om_element(om_builder, env,
-                                                   AXIS2_FALSE);
-        if (!val)
-        {
-            return -1;
-        }
-        break;
+        case AXIOM_XML_READER_START_ELEMENT:
+            val = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE);
+            if(!val)
+            {
+                return -1;
+            }
+            break;
 
-    case AXIOM_XML_READER_EMPTY_ELEMENT:
+        case AXIOM_XML_READER_EMPTY_ELEMENT:
 
 #ifdef AXIS2_LIBXML2_ENABLED
-        val = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE);
+            val = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE);
 #else
-        val = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_TRUE);
+            val = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_TRUE);
 #endif
 
-        if (!val)
-        {
-            return -1;
-        }
-    case AXIOM_XML_READER_END_ELEMENT:
-        axiom_stax_builder_end_element(om_builder, env);
-        break;
+            if(!val)
+            {
+                return -1;
+            }
+        case AXIOM_XML_READER_END_ELEMENT:
+            axiom_stax_builder_end_element(om_builder, env);
+            break;
 
-    case AXIOM_XML_READER_SPACE:
-        /* ignore white space before the root element */
-        if (om_builder->lastnode)
-        {
+        case AXIOM_XML_READER_SPACE:
+            /* ignore white space before the root element */
+            if(om_builder->lastnode)
+            {
+                val = axiom_stax_builder_create_om_text(om_builder, env);
+                if(!val)
+                {
+                    return -1;
+                }
+            }
+            break;
+
+        case AXIOM_XML_READER_CHARACTER:
             val = axiom_stax_builder_create_om_text(om_builder, env);
-            if (!val)
+            if(!val)
             {
                 return -1;
             }
-        }
-        break;
-
-    case AXIOM_XML_READER_CHARACTER:
-        val = axiom_stax_builder_create_om_text(om_builder, env);
-        if (!val)
-        {
-            return -1;
-        }
-        break;
+            break;
 
-    case AXIOM_XML_READER_ENTITY_REFERENCE:
-        break;
+        case AXIOM_XML_READER_ENTITY_REFERENCE:
+            break;
 
-    case AXIOM_XML_READER_COMMENT:
-        val = axiom_stax_builder_create_om_comment(om_builder, env);
-        if (val)
-        {
-            axiom_stax_builder_end_element(om_builder, env);
-        }
-        break;
+        case AXIOM_XML_READER_COMMENT:
+            val = axiom_stax_builder_create_om_comment(om_builder, env);
+            if(val)
+            {
+                axiom_stax_builder_end_element(om_builder, env);
+            }
+            break;
 
-    case AXIOM_XML_READER_PROCESSING_INSTRUCTION:
-        val = axiom_stax_builder_create_om_processing_instruction(om_builder,
-                                                                  env);
-        if (val)
-        {
-            axiom_stax_builder_end_element(om_builder, env);
-        }
-        break;
+        case AXIOM_XML_READER_PROCESSING_INSTRUCTION:
+            val = axiom_stax_builder_create_om_processing_instruction(om_builder, env);
+            if(val)
+            {
+                axiom_stax_builder_end_element(om_builder, env);
+            }
+            break;
 
-    case AXIOM_XML_READER_CDATA:
-        break;
+        case AXIOM_XML_READER_CDATA:
+            break;
 
-    case AXIOM_XML_READER_DOCUMENT_TYPE:
-        break;
+        case AXIOM_XML_READER_DOCUMENT_TYPE:
+            break;
 
-    default:
-        break;
+        default:
+            break;
     }
     return token;
 }

Modified: webservices/axis2/trunk/c/axiom/src/om/om_text.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_text.c?rev=805360&r1=805359&r2=805360&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_text.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_text.c Tue Aug 18 11:08:42 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
@@ -66,14 +65,13 @@
 
     *node = axiom_node_create(env);
 
-    if (!(*node))
+    if(!(*node))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    om_text = (axiom_text_t *) AXIS2_MALLOC(env->allocator,
-                                            sizeof(axiom_text_t));
-    if (!om_text)
+    om_text = (axiom_text_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_text_t));
+    if(!om_text)
     {
         AXIS2_FREE(env->allocator, *node);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -92,7 +90,7 @@
     om_text->data_handler = NULL;
     om_text->mime_type = NULL;
 
-    if (value)
+    if(value)
     {
         om_text->value = axutil_string_create(env, value);
     }
@@ -101,7 +99,7 @@
     axiom_node_set_node_type((*node), env, AXIOM_TEXT);
     axiom_node_set_complete((*node), env, AXIS2_FALSE);
 
-    if (parent && axiom_node_get_node_type(parent, env) == AXIOM_ELEMENT)
+    if(parent && axiom_node_get_node_type(parent, env) == AXIOM_ELEMENT)
     {
         axiom_node_add_child(parent, env, (*node));
     }
@@ -121,8 +119,8 @@
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, data_handler, NULL);
 
-    om_text = (axiom_text_t *) axiom_text_create(env, parent, NULL, node);
-    if (!om_text)
+    om_text = (axiom_text_t *)axiom_text_create(env, parent, NULL, node);
+    if(!om_text)
     {
         return NULL;
     }
@@ -140,27 +138,27 @@
 {
     AXIS2_ENV_CHECK(env, void);
 
-    if (om_text->value)
+    if(om_text->value)
     {
         axutil_string_free(om_text->value, env);
     }
 
-    if (om_text->ns)
+    if(om_text->ns)
     {
         axiom_namespace_free(om_text->ns, env);
     }
 
-    if (om_text->content_id)
+    if(om_text->content_id)
     {
         AXIS2_FREE(env->allocator, om_text->content_id);
     }
 
-    if (om_text->om_attribute)
+    if(om_text->om_attribute)
     {
         axiom_attribute_free(om_text->om_attribute, env);
     }
 
-    if (om_text->data_handler)
+    if(om_text->data_handler)
     {
         axiom_data_handler_free(om_text->data_handler, env);
     }
@@ -183,26 +181,23 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE);
 
-    if (!axiom_text_get_is_binary(om_text, env))
+    if(!axiom_text_get_is_binary(om_text, env))
     {
-        if (om_text->value)
+        if(om_text->value)
         {
-            status = axiom_output_write(om_output, env,
-                                        AXIOM_TEXT, 1,
-                                        axutil_string_get_buffer(om_text->value,
-                                                                 env));
+            status = axiom_output_write(om_output, env, AXIOM_TEXT, 1, axutil_string_get_buffer(
+                om_text->value, env));
         }
     }
     else
     {
         om_output_xml_writer = axiom_output_get_xml_writer(om_output, env);
-        if (axiom_output_is_optimized(om_output, env) && om_text->optimize)
+        if(axiom_output_is_optimized(om_output, env) && om_text->optimize)
         {
-            if (!(axiom_text_get_content_id(om_text, env)))
+            if(!(axiom_text_get_content_id(om_text, env)))
             {
-                axis2_char_t *content_id =
-                    axiom_output_get_next_content_id(om_output, env);
-                if (content_id)
+                axis2_char_t *content_id = axiom_output_get_next_content_id(om_output, env);
+                if(content_id)
                 {
                     om_text->content_id = axutil_strdup(env, content_id);
                 }
@@ -211,27 +206,24 @@
             attribute_value = axutil_stracat(env, "cid:", om_text->content_id);
 
             /*send binary as MTOM optimised */
-            if (om_text->om_attribute)
+            if(om_text->om_attribute)
             {
                 axiom_attribute_free(om_text->om_attribute, env);
                 om_text->om_attribute = NULL;
             }
 
-            om_text->om_attribute =
-                axiom_attribute_create(env, "href", attribute_value, NULL);
+            om_text->om_attribute = axiom_attribute_create(env, "href", attribute_value, NULL);
 
             AXIS2_FREE(env->allocator, attribute_value);
             attribute_value = NULL;
 
-            if (!om_text->is_swa) /* This is a hack to get SwA working */
+            if(!om_text->is_swa) /* This is a hack to get SwA working */
             {
                 axiom_text_serialize_start_part(om_text, env, om_output);
             }
             else
             {
-                status = axiom_output_write(om_output, env,
-                                        AXIOM_TEXT, 1,
-                                        om_text->content_id);
+                status = axiom_output_write(om_output, env, AXIOM_TEXT, 1, om_text->content_id);
             }
 
             axiom_output_write_optimized(om_output, env, om_text);
@@ -241,8 +233,7 @@
         else
         {
             text = axiom_text_get_text(om_text, env);
-            axiom_xml_writer_write_characters(om_output_xml_writer, env,
-                                              (axis2_char_t *) text);
+            axiom_xml_writer_write_characters(om_output_xml_writer, env, (axis2_char_t *)text);
         }
     }
     return status;
@@ -253,7 +244,7 @@
     axiom_text_t * om_text,
     const axutil_env_t * env)
 {
-    if (om_text->value)
+    if(om_text->value)
     {
         return axutil_string_get_buffer(om_text->value, env);
     }
@@ -269,14 +260,14 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE);
 
-    if (om_text->value)
+    if(om_text->value)
     {
         axutil_string_free(om_text->value, env);
         om_text->value = NULL;
     }
 
     om_text->value = axutil_string_create(env, value);
-    if (!om_text->value)
+    if(!om_text->value)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return AXIS2_FAILURE;
@@ -302,11 +293,11 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE);
-    if (om_text->mime_type)
+    if(om_text->mime_type)
     {
         AXIS2_FREE(env->allocator, om_text->mime_type);
     }
-    om_text->mime_type = (axis2_char_t *) axutil_strdup(env, mime_type);
+    om_text->mime_type = (axis2_char_t *)axutil_strdup(env, mime_type);
     return AXIS2_SUCCESS;
 }
 
@@ -374,11 +365,11 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE);
-    if (om_text->content_id)
+    if(om_text->content_id)
     {
         AXIS2_FREE(env->allocator, om_text->content_id);
     }
-    om_text->content_id = (axis2_char_t *) axutil_strdup(env, content_id);
+    om_text->content_id = (axis2_char_t *)axutil_strdup(env, content_id);
     return AXIS2_SUCCESS;
 }
 
@@ -394,26 +385,23 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     local_name = axiom_text_get_localname(om_text, env);
 
-    om_text->ns = axiom_namespace_create(env,
-                                         "http://www.w3.org/2004/08/xop/include",
-                                         "xop");
+    om_text->ns = axiom_namespace_create(env, "http://www.w3.org/2004/08/xop/include", "xop");
 
-    if (om_text->ns)
+    if(om_text->ns)
     {
         namespace_uri = axiom_namespace_get_uri(om_text->ns, env);
-        if (namespace_uri)
+        if(namespace_uri)
         {
             prefix = axiom_namespace_get_prefix(om_text->ns, env);
 
-            if (prefix)
+            if(prefix)
             {
-                axiom_output_write(om_output, env, AXIOM_ELEMENT, 3,
-                                   local_name, namespace_uri, prefix);
+                axiom_output_write(om_output, env, AXIOM_ELEMENT, 3, local_name, namespace_uri,
+                    prefix);
             }
             else
             {
-                axiom_output_write(om_output, env, AXIOM_ELEMENT, 2,
-                                   local_name, namespace_uri);
+                axiom_output_write(om_output, env, AXIOM_ELEMENT, 2, local_name, namespace_uri);
             }
         }
         else
@@ -425,15 +413,15 @@
     {
         axiom_output_write(om_output, env, AXIOM_TEXT, 1, local_name);
     }
-    if (om_text->om_attribute)
+    if(om_text->om_attribute)
     {
         axiom_attribute_serialize(om_text->om_attribute, env, om_output);
     }
-    if (om_text->ns)
+    if(om_text->ns)
     {
         axiom_namespace_serialize(om_text->ns, env, om_output);
-		axiom_namespace_free(om_text->ns, env);
-		om_text->ns = NULL;
+        axiom_namespace_free(om_text->ns, env);
+        om_text->ns = NULL;
     }
 
     return AXIS2_SUCCESS;
@@ -457,34 +445,29 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
     xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
-                                                    AXIS2_XML_PARSER_TYPE_BUFFER);
+        AXIS2_XML_PARSER_TYPE_BUFFER);
     om_namespace = axiom_namespace_create(env, "", "");
 
     namespace_uri = axiom_namespace_get_uri(om_text->ns, env);
     attribute_local_name = axiom_attribute_get_localname(om_attribute, env);
 
-    if (om_namespace)
+    if(om_namespace)
     {
         prefix = axiom_namespace_get_prefix(om_text->ns, env);
         attribute_value = axiom_attribute_get_value(om_attribute, env);
-        if (prefix)
+        if(prefix)
         {
-            axiom_xml_writer_write_attribute(xml_writer, env,
-                                             attribute_local_name,
-                                             attribute_value);
+            axiom_xml_writer_write_attribute(xml_writer, env, attribute_local_name, attribute_value);
         }
         else
         {
-            axiom_xml_writer_write_attribute_with_namespace(xml_writer, env,
-                                                            attribute_local_name,
-                                                            attribute_value,
-                                                            namespace_uri);
+            axiom_xml_writer_write_attribute_with_namespace(xml_writer, env, attribute_local_name,
+                attribute_value, namespace_uri);
         }
     }
     else
     {
-        axiom_xml_writer_write_attribute(xml_writer, env, attribute_local_name,
-                                         attribute_value);
+        axiom_xml_writer_write_attribute(xml_writer, env, attribute_local_name, attribute_value);
     }
     axiom_namespace_free(om_namespace, env);
     return AXIS2_SUCCESS;
@@ -504,17 +487,15 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
     xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
-                                                    AXIS2_XML_PARSER_TYPE_BUFFER);
+        AXIS2_XML_PARSER_TYPE_BUFFER);
     om_namespace = axiom_namespace_create(env, "", "");
 
-    if (om_namespace)
+    if(om_namespace)
     {
         namespace_uri = axiom_namespace_get_uri(om_text->ns, env);
         namespace_prefix = axiom_namespace_get_prefix(om_text->ns, env);
-        axiom_xml_writer_write_namespace(xml_writer, env, namespace_prefix,
-                                         namespace_uri);
-        axiom_xml_writer_set_prefix(xml_writer, env, namespace_prefix,
-                                    namespace_uri);
+        axiom_xml_writer_write_namespace(xml_writer, env, namespace_prefix, namespace_uri);
+        axiom_xml_writer_set_prefix(xml_writer, env, namespace_prefix, namespace_uri);
     }
     return AXIS2_SUCCESS;
 }
@@ -524,7 +505,7 @@
     axiom_text_t * om_text,
     const axutil_env_t * env)
 {
-    if (om_text->value)
+    if(om_text->value)
     {
         return axutil_string_get_buffer(om_text->value, env);
     }
@@ -532,23 +513,20 @@
     {
         axis2_char_t *data_handler_stream = NULL;
         int data_handler_stream_size = 0;
-        if (om_text->data_handler)
+        if(om_text->data_handler)
         {
             int encoded_len = 0;
             axis2_char_t *encoded_str = NULL;
-            axiom_data_handler_read_from(om_text->data_handler, env,
-                                         &data_handler_stream,
-                                         &data_handler_stream_size);
-            if (data_handler_stream)
+            axiom_data_handler_read_from(om_text->data_handler, env, &data_handler_stream,
+                &data_handler_stream_size);
+            if(data_handler_stream)
             {
-                encoded_len =
-                    axutil_base64_encode_len(data_handler_stream_size);
+                encoded_len = axutil_base64_encode_len(data_handler_stream_size);
                 encoded_str = AXIS2_MALLOC(env->allocator, encoded_len + 2);
-                if (encoded_str)
+                if(encoded_str)
                 {
-                    encoded_len = axutil_base64_encode(encoded_str,
-                                                       data_handler_stream,
-                                                       data_handler_stream_size);
+                    encoded_len = axutil_base64_encode(encoded_str, data_handler_stream,
+                        data_handler_stream_size);
                     encoded_str[encoded_len] = '\0';
                     return encoded_str;
                 }
@@ -579,14 +557,13 @@
 
     *node = axiom_node_create(env);
 
-    if (!(*node))
+    if(!(*node))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    om_text = (axiom_text_t *) AXIS2_MALLOC(env->allocator,
-                                            sizeof(axiom_text_t));
-    if (!om_text)
+    om_text = (axiom_text_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_text_t));
+    if(!om_text)
     {
         AXIS2_FREE(env->allocator, *node);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -604,7 +581,7 @@
     om_text->data_handler = NULL;
     om_text->mime_type = NULL;
 
-    if (value)
+    if(value)
     {
         om_text->value = axutil_string_clone(value, env);
     }
@@ -613,7 +590,7 @@
     axiom_node_set_node_type((*node), env, AXIOM_TEXT);
     axiom_node_set_complete((*node), env, AXIS2_FALSE);
 
-    if (parent && axiom_node_get_node_type(parent, env) == AXIOM_ELEMENT)
+    if(parent && axiom_node_get_node_type(parent, env) == AXIOM_ELEMENT)
     {
         axiom_node_add_child(parent, env, (*node));
     }
@@ -627,12 +604,12 @@
     const axutil_env_t * env,
     axutil_string_t * value)
 {
-    if (om_text->value)
+    if(om_text->value)
     {
         axutil_string_free(om_text->value, env);
         om_text->value = NULL;
     }
-    if (value)
+    if(value)
     {
         om_text->value = axutil_string_clone(value, env);
     }

Modified: webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_reader_wrapper.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_reader_wrapper.c?rev=805360&r1=805359&r2=805360&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_reader_wrapper.c (original)
+++ webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_reader_wrapper.c Tue Aug 18 11:08:42 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
@@ -127,8 +126,7 @@
     guththila_reader_t *reader;
     int event_map[10];
 
-}
-guththila_xml_reader_wrapper_impl_t;
+} guththila_xml_reader_wrapper_impl_t;
 
 /********************************* Macro ***************************************/
 
@@ -142,47 +140,36 @@
 guththila_xml_reader_wrapper_init_map(
     guththila_xml_reader_wrapper_impl_t * parser)
 {
-    if (parser)
+    if(parser)
     {
-        parser->event_map[GUTHTHILA_START_DOCUMENT] =
-            AXIOM_XML_READER_START_DOCUMENT;
-        parser->event_map[GUTHTHILA_START_ELEMENT] =
-            AXIOM_XML_READER_START_ELEMENT;
+        parser->event_map[GUTHTHILA_START_DOCUMENT] = AXIOM_XML_READER_START_DOCUMENT;
+        parser->event_map[GUTHTHILA_START_ELEMENT] = AXIOM_XML_READER_START_ELEMENT;
         parser->event_map[GUTHTHILA_END_ELEMENT] = AXIOM_XML_READER_END_ELEMENT;
         parser->event_map[GUTHTHILA_SPACE] = AXIOM_XML_READER_SPACE;
-        parser->event_map[GUTHTHILA_EMPTY_ELEMENT] =
-            AXIOM_XML_READER_EMPTY_ELEMENT;
+        parser->event_map[GUTHTHILA_EMPTY_ELEMENT] = AXIOM_XML_READER_EMPTY_ELEMENT;
         parser->event_map[GUTHTHILA_CHARACTER] = AXIOM_XML_READER_CHARACTER;
-        parser->event_map[GUTHTHILA_ENTITY_REFERANCE] =
-            AXIOM_XML_READER_ENTITY_REFERENCE;
+        parser->event_map[GUTHTHILA_ENTITY_REFERANCE] = AXIOM_XML_READER_ENTITY_REFERENCE;
         parser->event_map[GUTHTHILA_COMMENT] = AXIOM_XML_READER_COMMENT;
         return AXIS2_SUCCESS;
     }
     return AXIS2_FAILURE;
 }
 
-static const axiom_xml_reader_ops_t axiom_xml_reader_ops_var = {
-    guththila_xml_reader_wrapper_next,
-    guththila_xml_reader_wrapper_free,
-    guththila_xml_reader_wrapper_get_attribute_count,
+static const axiom_xml_reader_ops_t axiom_xml_reader_ops_var = { guththila_xml_reader_wrapper_next,
+    guththila_xml_reader_wrapper_free, guththila_xml_reader_wrapper_get_attribute_count,
     guththila_xml_reader_wrapper_get_attribute_name_by_number,
     guththila_xml_reader_wrapper_get_attribute_prefix_by_number,
     guththila_xml_reader_wrapper_get_attribute_value_by_number,
     guththila_xml_reader_wrapper_get_attribute_namespace_by_number,
-    guththila_xml_reader_wrapper_get_value,
-    guththila_xml_reader_wrapper_get_namespace_count,
+    guththila_xml_reader_wrapper_get_value, guththila_xml_reader_wrapper_get_namespace_count,
     guththila_xml_reader_wrapper_get_namespace_uri_by_number,
     guththila_xml_reader_wrapper_get_namespace_prefix_by_number,
-    guththila_xml_reader_wrapper_get_prefix,
-    guththila_xml_reader_wrapper_get_name,
-    guththila_xml_reader_wrapper_get_pi_target,
-    guththila_xml_reader_wrapper_get_pi_data,
-    guththila_xml_reader_wrapper_get_dtd,
-    guththila_xml_reader_wrapper_xml_free,
+    guththila_xml_reader_wrapper_get_prefix, guththila_xml_reader_wrapper_get_name,
+    guththila_xml_reader_wrapper_get_pi_target, guththila_xml_reader_wrapper_get_pi_data,
+    guththila_xml_reader_wrapper_get_dtd, guththila_xml_reader_wrapper_xml_free,
     guththila_xml_reader_wrapper_get_char_set_encoding,
     guththila_xml_reader_wrapper_get_namespace_uri,
-    guththila_xml_reader_wrapper_get_namespace_uri_by_prefix
-};
+    guththila_xml_reader_wrapper_get_namespace_uri_by_prefix };
 
 /********************************************************************************/
 
@@ -197,11 +184,9 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    guththila_impl =
-        AXIS2_MALLOC(env->allocator,
-                     sizeof(guththila_xml_reader_wrapper_impl_t));
+    guththila_impl = AXIS2_MALLOC(env->allocator, sizeof(guththila_xml_reader_wrapper_impl_t));
 
-    if (!guththila_impl)
+    if(!guththila_impl)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -209,17 +194,16 @@
 
     guththila_impl->reader = guththila_reader_create_for_file(filename, env);
 
-    if (!(guththila_impl->reader))
+    if(!(guththila_impl->reader))
     {
         AXIS2_FREE(env->allocator, guththila_impl);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    guththila =
-        (guththila_t *) AXIS2_MALLOC(env->allocator, sizeof(guththila_t));
+    guththila = (guththila_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_t));
     guththila_init(guththila, guththila_impl->reader, env);
-    if (!guththila)
+    if(!guththila)
     {
         AXIS2_FREE(env->allocator, guththila_impl);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -228,17 +212,17 @@
 
     guththila_impl->guththila_parser = guththila;
     guththila_impl->parser.ops = NULL;
-/*    guththila_impl->parser.ops =
-        (axiom_xml_reader_ops_t *) AXIS2_MALLOC(env->allocator,
-                                                sizeof(axiom_xml_reader_ops_t));
-    if (!(guththila_impl->parser.ops))
-    {
-        guththila_free(guththila, env);
-        AXIS2_FREE(env->allocator, guththila_impl);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-*/
+    /*    guththila_impl->parser.ops =
+     (axiom_xml_reader_ops_t *) AXIS2_MALLOC(env->allocator,
+     sizeof(axiom_xml_reader_ops_t));
+     if (!(guththila_impl->parser.ops))
+     {
+     guththila_free(guththila, env);
+     AXIS2_FREE(env->allocator, guththila_impl);
+     AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+     return NULL;
+     }
+     */
     guththila_xml_reader_wrapper_init_map(guththila_impl);
 
     /************** ops *****/
@@ -262,10 +246,9 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    guththila_impl = AXIS2_MALLOC(env->allocator,
-                                  sizeof(guththila_xml_reader_wrapper_impl_t));
+    guththila_impl = AXIS2_MALLOC(env->allocator, sizeof(guththila_xml_reader_wrapper_impl_t));
 
-    if (!guththila_impl)
+    if(!guththila_impl)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -274,20 +257,18 @@
     /*allocator = axutil_allocator_init(NULL); */
 
     /*-------difference of two create function is here--------*/
-    guththila_impl->reader =
-        guththila_reader_create_for_io(read_input_callback, ctx, env);
+    guththila_impl->reader = guththila_reader_create_for_io(read_input_callback, ctx, env);
 
-    if (!(guththila_impl->reader))
+    if(!(guththila_impl->reader))
     {
         AXIS2_FREE(env->allocator, guththila_impl);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    guththila =
-        (guththila_t *) AXIS2_MALLOC(env->allocator, sizeof(guththila_t));
+    guththila = (guththila_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_t));
     guththila_init(guththila, guththila_impl->reader, env);
-    if (!guththila)
+    if(!guththila)
     {
         AXIS2_FREE(env->allocator, guththila_impl);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -297,14 +278,14 @@
     guththila_impl->guththila_parser = guththila;
     guththila_impl->parser.ops = NULL;
     /*  guththila_impl->parser.ops = (axiom_xml_reader_ops_t *)
-        AXIS2_MALLOC(env->allocator, sizeof(axiom_xml_reader_ops_t));
-    if (!(guththila_impl->parser.ops))
-    {
-        guththila_free(guththila, env);
-        AXIS2_FREE(env->allocator, guththila_impl);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-        }*/
+     AXIS2_MALLOC(env->allocator, sizeof(axiom_xml_reader_ops_t));
+     if (!(guththila_impl->parser.ops))
+     {
+     guththila_free(guththila, env);
+     AXIS2_FREE(env->allocator, guththila_impl);
+     AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+     return NULL;
+     }*/
 
     guththila_xml_reader_wrapper_init_map(guththila_impl);
 
@@ -315,15 +296,13 @@
 
 /* ####################################################################### */
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_xml_reader_init(
-    )
+axiom_xml_reader_init()
 {
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_xml_reader_cleanup(
-    )
+axiom_xml_reader_cleanup()
 {
     return AXIS2_SUCCESS;
 }
@@ -344,10 +323,9 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    guththila_impl = AXIS2_MALLOC(env->allocator,
-                                  sizeof(guththila_xml_reader_wrapper_impl_t));
+    guththila_impl = AXIS2_MALLOC(env->allocator, sizeof(guththila_xml_reader_wrapper_impl_t));
 
-    if (!guththila_impl)
+    if(!guththila_impl)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -356,20 +334,18 @@
     /*allocator = axutil_allocator_init(NULL); */
 
     /*-------difference of two create function is here--------*/
-    guththila_impl->reader =
-        guththila_reader_create_for_memory(buffer, size, env);
+    guththila_impl->reader = guththila_reader_create_for_memory(buffer, size, env);
 
-    if (!(guththila_impl->reader))
+    if(!(guththila_impl->reader))
     {
         AXIS2_FREE(env->allocator, guththila_impl);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    guththila =
-        (guththila_t *) AXIS2_MALLOC(env->allocator, sizeof(guththila_t));
+    guththila = (guththila_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_t));
     guththila_init(guththila, guththila_impl->reader, env);
-    if (!guththila)
+    if(!guththila)
     {
         AXIS2_FREE(env->allocator, guththila_impl);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -378,16 +354,16 @@
 
     guththila_impl->guththila_parser = guththila;
     guththila_impl->parser.ops = NULL;
-/*    guththila_impl->parser.ops = (axiom_xml_reader_ops_t *)
-        AXIS2_MALLOC(env->allocator, sizeof(axiom_xml_reader_ops_t));
-    if (!(guththila_impl->parser.ops))
-    {
-        guththila_free(guththila, env);
-        AXIS2_FREE(env->allocator, guththila_impl);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-*/
+    /*    guththila_impl->parser.ops = (axiom_xml_reader_ops_t *)
+     AXIS2_MALLOC(env->allocator, sizeof(axiom_xml_reader_ops_t));
+     if (!(guththila_impl->parser.ops))
+     {
+     guththila_free(guththila, env);
+     AXIS2_FREE(env->allocator, guththila_impl);
+     AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+     return NULL;
+     }
+     */
     guththila_xml_reader_wrapper_init_map(guththila_impl);
 
     /************** ops *****/
@@ -414,17 +390,16 @@
     guththila_xml_reader_wrapper_impl_t *parser_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     parser_impl = AXIS2_INTF_TO_IMPL(parser);
-    if (parser_impl->reader)
+    if(parser_impl->reader)
     {
         guththila_reader_free(parser_impl->reader, env);
     }
 
-    if (parser_impl->guththila_parser)
+    if(parser_impl->guththila_parser)
     {
         guththila_un_init(parser_impl->guththila_parser, env);
     }
 
-    
     AXIS2_FREE(env->allocator, parser_impl);
 }
 
@@ -434,8 +409,7 @@
     const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    return guththila_get_attribute_count(AXIS2_INTF_TO_IMPL(parser)->
-                                         guththila_parser, env);
+    return guththila_get_attribute_count(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -445,8 +419,8 @@
     int i)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return guththila_get_attribute_name_by_number(AXIS2_INTF_TO_IMPL(parser)->
-                                                  guththila_parser, i, env);
+    return guththila_get_attribute_name_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, i,
+        env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -456,8 +430,8 @@
     int i)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return guththila_get_attribute_prefix_by_number(AXIS2_INTF_TO_IMPL(parser)->
-                                                    guththila_parser, i, env);
+    return guththila_get_attribute_prefix_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser,
+        i, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -467,8 +441,8 @@
     int i)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return guththila_get_attribute_value_by_number(AXIS2_INTF_TO_IMPL(parser)->
-                                                   guththila_parser, i, env);
+    return guththila_get_attribute_value_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser,
+        i, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -478,9 +452,8 @@
     int i)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return
-        guththila_get_attribute_namespace_by_number(AXIS2_INTF_TO_IMPL(parser)->
-                                                    guththila_parser, i, env);
+    return guththila_get_attribute_namespace_by_number(
+        AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, i, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -489,8 +462,7 @@
     const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return guththila_get_value(AXIS2_INTF_TO_IMPL(parser)->guththila_parser,
-                               env);
+    return guththila_get_value(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env);
 }
 
 int AXIS2_CALL
@@ -499,8 +471,7 @@
     const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    return guththila_get_namespace_count(AXIS2_INTF_TO_IMPL(parser)->
-                                         guththila_parser, env);
+    return guththila_get_namespace_count(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -510,8 +481,8 @@
     int i)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return guththila_get_namespace_uri_by_number(AXIS2_INTF_TO_IMPL(parser)->
-                                                 guththila_parser, i, env);
+    return guththila_get_namespace_uri_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, i,
+        env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -521,8 +492,8 @@
     int i)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return guththila_get_namespace_prefix_by_number(AXIS2_INTF_TO_IMPL(parser)->
-                                                    guththila_parser, i, env);
+    return guththila_get_namespace_prefix_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser,
+        i, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -531,8 +502,7 @@
     const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return guththila_get_prefix(AXIS2_INTF_TO_IMPL(parser)->guththila_parser,
-                                env);
+    return guththila_get_prefix(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -541,8 +511,7 @@
     const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return guththila_get_name(AXIS2_INTF_TO_IMPL(parser)->guththila_parser,
-                              env);
+    return guththila_get_name(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -578,8 +547,8 @@
     const axutil_env_t * env,
     void *data)
 {
-    if (data)
-       AXIS2_FREE(env->allocator, data);
+    if(data)
+        AXIS2_FREE(env->allocator, data);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -587,8 +556,7 @@
     axiom_xml_reader_t * parser,
     const axutil_env_t * env)
 {
-    return guththila_get_encoding(AXIS2_INTF_TO_IMPL(parser)->guththila_parser,
-                                  env);
+    return guththila_get_encoding(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -597,7 +565,7 @@
     const axutil_env_t * env)
 {
 
-    return (axis2_char_t *) NULL;
+    return (axis2_char_t *)NULL;
 }
 
 axis2_char_t *AXIS2_CALL
@@ -606,5 +574,5 @@
     const axutil_env_t * env,
     axis2_char_t * prefix)
 {
-    return (axis2_char_t *) NULL;
+    return (axis2_char_t *)NULL;
 }



Mime
View raw message