axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r448042 [2/5] - in /webservices/axis2/trunk/c: axiom/src/om/ axiom/src/parser/guththila/ axiom/test/om/ guththila/samples/ guththila/src/ modules/core/addr/ modules/core/description/ modules/core/engine/ modules/core/transport/http/server/a...
Date Wed, 20 Sep 2006 03:11:29 GMT
Modified: webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c?view=diff&rev=448042&r1=448041&r2=448042
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c (original)
+++ webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c Tue Sep 19 20:11:28 2006
@@ -13,7 +13,7 @@
  *   See the License for the specific language governing permissions and
  *   limitations under the License.
  */
- 
+
 #include <guththila_xml_writer.h>
 #include <guththila.h>
 #include <axis2_utils.h>
@@ -22,182 +22,182 @@
 /* /\*********************** function prototypes ***********************************\/ */
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_free(axiom_xml_writer_t *writer,
-                                  const axis2_env_t *env);
-        
+        const axis2_env_t *env);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_element(
-                                    axiom_xml_writer_t *writer,
-                                    const axis2_env_t *env,
-                                    axis2_char_t *localname);
-        
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_end_start_element(axiom_xml_writer_t *writer,
-                                               const axis2_env_t *env);
-        
+        const axis2_env_t *env);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_element_with_namespace(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname,
-                                        axis2_char_t *namespace_uri);
-        
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *namespace_uri);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname,
-                                        axis2_char_t *namespace_uri,
-                                        axis2_char_t *prefix);
-                                    
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *namespace_uri,
+    axis2_char_t *prefix);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_empty_element(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname);
-        
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_empty_element_with_namespace(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname,
-                                        axis2_char_t *namespace_uri);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *namespace_uri);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname,
-                                        axis2_char_t *namespace_uri,
-                                        axis2_char_t *prefix);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *namespace_uri,
+    axis2_char_t *prefix);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_end_element(axiom_xml_writer_t *writer,
-                                               const axis2_env_t *env);
+        const axis2_env_t *env);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_end_document(axiom_xml_writer_t *writer,
-                                               const axis2_env_t *env);
+        const axis2_env_t *env);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_attribute(axiom_xml_writer_t *writer,
-                                           const axis2_env_t *env,
-                                           axis2_char_t *localname,
-                                           axis2_char_t *value);
-                                               
+        const axis2_env_t *env,
+        axis2_char_t *localname,
+        axis2_char_t *value);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_attribute_with_namespace(
-                                          axiom_xml_writer_t *writer,
-                                          const axis2_env_t *env,
-                                          axis2_char_t *localname,
-                                          axis2_char_t *value,
-                                          axis2_char_t *namespace_uri);
-                                          
-axis2_status_t AXIS2_CALL
-guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix (
-								    axiom_xml_writer_t *writer,
-								    const axis2_env_t *env,
-								    axis2_char_t *localname,
-								    axis2_char_t *value,
-								    axis2_char_t *namespace_uri,
-								    axis2_char_t *prefix);
-
-axis2_status_t AXIS2_CALL
-guththila_xml_writer_wrapper_write_namespace (
-					      axiom_xml_writer_t *writer,
-					      const axis2_env_t *env,
-					      axis2_char_t *prefix,
-					      axis2_char_t *namespace_uri);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *value,
+    axis2_char_t *namespace_uri);
 
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix(
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *value,
+    axis2_char_t *namespace_uri,
+    axis2_char_t *prefix);
 
 axis2_status_t AXIS2_CALL
-guththila_xml_writer_wrapper_write_default_namespace (axiom_xml_writer_t *writer,
-						      const axis2_env_t *env,
-						      axis2_char_t *namespace_uri);
+guththila_xml_writer_wrapper_write_namespace(
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *prefix,
+    axis2_char_t *namespace_uri);
+
+
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_default_namespace(axiom_xml_writer_t *writer,
+        const axis2_env_t *env,
+        axis2_char_t *namespace_uri);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_comment(axiom_xml_writer_t *writer,
-                                           const axis2_env_t *env,
-                                           axis2_char_t *value);
-                                           
+        const axis2_env_t *env,
+        axis2_char_t *value);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_processing_instruction(
-							  axiom_xml_writer_t *writer,
-							  const axis2_env_t *env,
-							  axis2_char_t *target);
-                                           
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *target);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_processing_instruction_data(
-							       axiom_xml_writer_t *writer,
-							       const axis2_env_t *env,
-							       axis2_char_t *target,
-							       axis2_char_t *data);
-                                           
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *target,
+    axis2_char_t *data);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_cdata(axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *data);
+        const axis2_env_t *env,
+        axis2_char_t *data);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_dtd(axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *dtd);
+        const axis2_env_t *env,
+        axis2_char_t *dtd);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_entity_ref(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *name);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *name);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_document(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_document_with_version(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *version);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *version);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_document_with_version_encoding(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *encoding,
-                                         axis2_char_t *version);
-                                         
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *encoding,
+    axis2_char_t *version);
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_characters(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *text);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *text);
 
 axis2_char_t* AXIS2_CALL
-guththila_xml_writer_wrapper_get_prefix(  axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *uri);
+guththila_xml_writer_wrapper_get_prefix(axiom_xml_writer_t *writer,
+        const axis2_env_t *env,
+        axis2_char_t *uri);
 
 axis2_status_t AXIS2_CALL
-guththila_xml_writer_wrapper_set_prefix(  axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *prefix,
-                                         axis2_char_t *uri);
+guththila_xml_writer_wrapper_set_prefix(axiom_xml_writer_t *writer,
+        const axis2_env_t *env,
+        axis2_char_t *prefix,
+        axis2_char_t *uri);
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_set_default_prefix(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *uri);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *uri);
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_encoded(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *text,
-                                         int in_attr);
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *text,
+    int in_attr);
 
 void* AXIS2_CALL
 guththila_xml_writer_wrapper_get_xml(axiom_xml_writer_t *writer,
-                                     const axis2_env_t *env);
+        const axis2_env_t *env);
 
 
 
@@ -205,9 +205,10 @@
 
 typedef struct guththila_xml_writer_wrapper_impl
 {
-  axiom_xml_writer_t writer;
-  guththila_t *parser;
-}guththila_xml_writer_wrapper_impl_t;
+    axiom_xml_writer_t writer;
+    guththila_t *parser;
+}
+guththila_xml_writer_wrapper_impl_t;
 
 
 /* /\***************************** Macros ******************************************\/ */
@@ -218,58 +219,58 @@
 
 AXIS2_EXTERN axiom_xml_writer_t * AXIS2_CALL
 axiom_xml_writer_create(const axis2_env_t *env,
-                        axis2_char_t *filename,
-                        axis2_char_t *encoding,
-                        int is_prefix_default,
-                        int compression)
+        axis2_char_t *filename,
+        axis2_char_t *encoding,
+        int is_prefix_default,
+        int compression)
 {
     guththila_xml_writer_wrapper_impl_t *writer_impl;
-  
+
     axis2_allocator_t *allocator;
     AXIS2_ENV_CHECK(env, NULL);
-    
+
     writer_impl = (guththila_xml_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator,
-                   sizeof(guththila_xml_writer_wrapper_impl_t));
+            sizeof(guththila_xml_writer_wrapper_impl_t));
 
-    if(!writer_impl)
+    if (!writer_impl)
     {
 
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-   
-   allocator = axis2_allocator_init(NULL); 
-    writer_impl->parser = guththila_create ((axis2_env_t *)env, NULL);
-    
-    if(!(writer_impl->parser))
-      {
-        AXIS2_FREE(env->allocator,writer_impl);
-        AXIS2_FREE(env->allocator,allocator);
+
+    allocator = axis2_allocator_init(NULL);
+    writer_impl->parser = guththila_create((axis2_env_t *)env, NULL);
+
+    if (!(writer_impl->parser))
+    {
+        AXIS2_FREE(env->allocator, writer_impl);
+        AXIS2_FREE(env->allocator, allocator);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
-      }
+    }
 
     guththila_create_xml_stream_writer((axis2_env_t*) env,
-						       writer_impl->parser, 
-						       filename);
+            writer_impl->parser,
+            filename);
 
-    if(!(writer_impl->parser->xsw))
+    if (!(writer_impl->parser->xsw))
     {
-        AXIS2_FREE(env->allocator,writer_impl->parser);
-	AXIS2_FREE (env->allocator, writer_impl);
-        AXIS2_FREE(env->allocator,allocator);
+        AXIS2_FREE(env->allocator, writer_impl->parser);
+        AXIS2_FREE(env->allocator, writer_impl);
+        AXIS2_FREE(env->allocator, allocator);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    
+
     writer_impl->writer.ops = NULL;
     writer_impl->writer.ops = (axiom_xml_writer_ops_t*)AXIS2_MALLOC(env->allocator,
-                                    sizeof(axiom_xml_writer_ops_t));
-    if(!(writer_impl->writer.ops))
+            sizeof(axiom_xml_writer_ops_t));
+    if (!(writer_impl->writer.ops))
     {
-        AXIS2_FREE(env->allocator,writer_impl);
-        AXIS2_FREE(env->allocator,allocator);
-        
+        AXIS2_FREE(env->allocator, writer_impl);
+        AXIS2_FREE(env->allocator, allocator);
+
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
@@ -277,118 +278,118 @@
     writer_impl->writer.ops->free = guththila_xml_writer_wrapper_free;
     writer_impl->writer.ops->write_start_element = guththila_xml_writer_wrapper_write_start_element;
     writer_impl->writer.ops->write_start_element_with_namespace =
-            guththila_xml_writer_wrapper_write_start_element_with_namespace;
+        guththila_xml_writer_wrapper_write_start_element_with_namespace;
     writer_impl->writer.ops->write_start_element_with_namespace_prefix =
-            guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix;
-    
+        guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix;
+
     writer_impl->writer.ops->write_empty_element = guththila_xml_writer_wrapper_write_empty_element;
     writer_impl->writer.ops->write_empty_element_with_namespace  =
-            guththila_xml_writer_wrapper_write_empty_element_with_namespace;
+        guththila_xml_writer_wrapper_write_empty_element_with_namespace;
     writer_impl->writer.ops->write_empty_element_with_namespace_prefix =
-            guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix;
-    
+        guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix;
+
     writer_impl->writer.ops->write_end_element =
-            guththila_xml_writer_wrapper_write_end_element;
+        guththila_xml_writer_wrapper_write_end_element;
     writer_impl->writer.ops->write_end_document =
-            guththila_xml_writer_wrapper_write_end_document;
-    
+        guththila_xml_writer_wrapper_write_end_document;
+
     writer_impl->writer.ops->write_attribute =
-            guththila_xml_writer_wrapper_write_attribute;
+        guththila_xml_writer_wrapper_write_attribute;
     writer_impl->writer.ops->write_attribute_with_namespace =
-            guththila_xml_writer_wrapper_write_attribute_with_namespace;
+        guththila_xml_writer_wrapper_write_attribute_with_namespace;
     writer_impl->writer.ops->write_attribute_with_namespace_prefix =
-            guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix;
+        guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix;
     writer_impl->writer.ops->write_namespace =
-            guththila_xml_writer_wrapper_write_namespace;
+        guththila_xml_writer_wrapper_write_namespace;
     writer_impl->writer.ops->write_default_namespace =
-            guththila_xml_writer_wrapper_write_default_namespace;
+        guththila_xml_writer_wrapper_write_default_namespace;
     writer_impl->writer.ops->write_comment =
-            guththila_xml_writer_wrapper_write_comment;
+        guththila_xml_writer_wrapper_write_comment;
     writer_impl->writer.ops->write_processing_instruction =
-            guththila_xml_writer_wrapper_write_processing_instruction;
+        guththila_xml_writer_wrapper_write_processing_instruction;
     writer_impl->writer.ops->write_processing_instruction_data =
-            guththila_xml_writer_wrapper_write_processing_instruction_data;
+        guththila_xml_writer_wrapper_write_processing_instruction_data;
     writer_impl->writer.ops->write_cdata =
-            guththila_xml_writer_wrapper_write_cdata;
+        guththila_xml_writer_wrapper_write_cdata;
     writer_impl->writer.ops->write_dtd =
-            guththila_xml_writer_wrapper_write_dtd;
+        guththila_xml_writer_wrapper_write_dtd;
     writer_impl->writer.ops->write_entity_ref =
-            guththila_xml_writer_wrapper_write_entity_ref;
+        guththila_xml_writer_wrapper_write_entity_ref;
     writer_impl->writer.ops->write_start_document =
-            guththila_xml_writer_wrapper_write_start_document;
+        guththila_xml_writer_wrapper_write_start_document;
     writer_impl->writer.ops->write_start_document_with_version =
-            guththila_xml_writer_wrapper_write_start_document_with_version;
+        guththila_xml_writer_wrapper_write_start_document_with_version;
     writer_impl->writer.ops->write_start_document_with_version_encoding =
-            guththila_xml_writer_wrapper_write_start_document_with_version_encoding;
+        guththila_xml_writer_wrapper_write_start_document_with_version_encoding;
     writer_impl->writer.ops->write_characters =
-            guththila_xml_writer_wrapper_write_characters;
+        guththila_xml_writer_wrapper_write_characters;
     writer_impl->writer.ops->get_prefix =
-            guththila_xml_writer_wrapper_get_prefix;
+        guththila_xml_writer_wrapper_get_prefix;
     writer_impl->writer.ops->set_prefix = guththila_xml_writer_wrapper_set_prefix;
     writer_impl->writer.ops->set_default_prefix =
-            guththila_xml_writer_wrapper_set_default_prefix;
+        guththila_xml_writer_wrapper_set_default_prefix;
     writer_impl->writer.ops->write_encoded =
-            guththila_xml_writer_wrapper_write_encoded;
+        guththila_xml_writer_wrapper_write_encoded;
     writer_impl->writer.ops->get_xml =
-            guththila_xml_writer_wrapper_get_xml;
+        guththila_xml_writer_wrapper_get_xml;
 
-   return &(writer_impl->writer);
+    return &(writer_impl->writer);
 }
 
 AXIS2_EXTERN axiom_xml_writer_t * AXIS2_CALL
 axiom_xml_writer_create_for_memory(const axis2_env_t *env,
-                                   axis2_char_t *encoding,
-                                   int is_prefix_default,
-                                   int compression,
-				   int type)
-{
-  guththila_xml_writer_wrapper_impl_t *writer_impl = NULL;
-  
-  axis2_allocator_t *allocator = NULL;
-  AXIS2_ENV_CHECK(env, NULL);
-    
-  writer_impl = (guththila_xml_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator,
-								    sizeof(guththila_xml_writer_wrapper_impl_t));
+        axis2_char_t *encoding,
+        int is_prefix_default,
+        int compression,
+        int type)
+{
+    guththila_xml_writer_wrapper_impl_t *writer_impl = NULL;
+
+    axis2_allocator_t *allocator = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+
+    writer_impl = (guththila_xml_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator,
+            sizeof(guththila_xml_writer_wrapper_impl_t));
 
-    if(!writer_impl)
+    if (!writer_impl)
     {
-      
-      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;
     }
-   
-    allocator = axis2_allocator_init(NULL); 
+
+    allocator = axis2_allocator_init(NULL);
     /* creating guththila parser */
-    writer_impl->parser = guththila_create ((axis2_env_t *)env, NULL);
-    
-    if(!(writer_impl->parser))
-      {
-        AXIS2_FREE(env->allocator,writer_impl);
-        AXIS2_FREE(env->allocator,allocator);
+    writer_impl->parser = guththila_create((axis2_env_t *)env, NULL);
+
+    if (!(writer_impl->parser))
+    {
+        AXIS2_FREE(env->allocator, writer_impl);
+        AXIS2_FREE(env->allocator, allocator);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
-      }
+    }
     /* guththila xml stream writer for memory */
     guththila_create_xml_stream_writer_for_memory((axis2_env_t*) env,
-						       writer_impl->parser);
+            writer_impl->parser);
 
-    if(!(writer_impl->parser->xsw))
+    if (!(writer_impl->parser->xsw))
     {
-        AXIS2_FREE(env->allocator,writer_impl->parser);
-	AXIS2_FREE (env->allocator, writer_impl);
-        AXIS2_FREE(env->allocator,allocator);
+        AXIS2_FREE(env->allocator, writer_impl->parser);
+        AXIS2_FREE(env->allocator, writer_impl);
+        AXIS2_FREE(env->allocator, allocator);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    
+
     writer_impl->writer.ops = NULL;
     writer_impl->writer.ops = (axiom_xml_writer_ops_t*)AXIS2_MALLOC(env->allocator,
-                                    sizeof(axiom_xml_writer_ops_t));
-    if(!(writer_impl->writer.ops))
+            sizeof(axiom_xml_writer_ops_t));
+    if (!(writer_impl->writer.ops))
     {
-        AXIS2_FREE(env->allocator,writer_impl);
-        AXIS2_FREE(env->allocator,allocator);
-        
+        AXIS2_FREE(env->allocator, writer_impl);
+        AXIS2_FREE(env->allocator, allocator);
+
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
@@ -396,102 +397,102 @@
     writer_impl->writer.ops->free = guththila_xml_writer_wrapper_free;
     writer_impl->writer.ops->write_start_element = guththila_xml_writer_wrapper_write_start_element;
     writer_impl->writer.ops->write_start_element_with_namespace =
-            guththila_xml_writer_wrapper_write_start_element_with_namespace;
+        guththila_xml_writer_wrapper_write_start_element_with_namespace;
     writer_impl->writer.ops->write_start_element_with_namespace_prefix =
-            guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix;
-    
+        guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix;
+
     writer_impl->writer.ops->write_empty_element = guththila_xml_writer_wrapper_write_empty_element;
     writer_impl->writer.ops->write_empty_element_with_namespace  =
-            guththila_xml_writer_wrapper_write_empty_element_with_namespace;
+        guththila_xml_writer_wrapper_write_empty_element_with_namespace;
     writer_impl->writer.ops->write_empty_element_with_namespace_prefix =
-            guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix;
-    
+        guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix;
+
     writer_impl->writer.ops->write_end_element =
-            guththila_xml_writer_wrapper_write_end_element;
+        guththila_xml_writer_wrapper_write_end_element;
     writer_impl->writer.ops->write_end_document =
-            guththila_xml_writer_wrapper_write_end_document;
-    
+        guththila_xml_writer_wrapper_write_end_document;
+
     writer_impl->writer.ops->write_attribute =
-            guththila_xml_writer_wrapper_write_attribute;
+        guththila_xml_writer_wrapper_write_attribute;
     writer_impl->writer.ops->write_attribute_with_namespace =
-            guththila_xml_writer_wrapper_write_attribute_with_namespace;
+        guththila_xml_writer_wrapper_write_attribute_with_namespace;
     writer_impl->writer.ops->write_attribute_with_namespace_prefix =
-            guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix;
+        guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix;
     writer_impl->writer.ops->write_namespace =
-            guththila_xml_writer_wrapper_write_namespace;
+        guththila_xml_writer_wrapper_write_namespace;
     writer_impl->writer.ops->write_default_namespace =
-            guththila_xml_writer_wrapper_write_default_namespace;
+        guththila_xml_writer_wrapper_write_default_namespace;
     writer_impl->writer.ops->write_comment =
-            guththila_xml_writer_wrapper_write_comment;
+        guththila_xml_writer_wrapper_write_comment;
     writer_impl->writer.ops->write_processing_instruction =
-            guththila_xml_writer_wrapper_write_processing_instruction;
+        guththila_xml_writer_wrapper_write_processing_instruction;
     writer_impl->writer.ops->write_processing_instruction_data =
-            guththila_xml_writer_wrapper_write_processing_instruction_data;
+        guththila_xml_writer_wrapper_write_processing_instruction_data;
     writer_impl->writer.ops->write_cdata =
-            guththila_xml_writer_wrapper_write_cdata;
+        guththila_xml_writer_wrapper_write_cdata;
     writer_impl->writer.ops->write_dtd =
-            guththila_xml_writer_wrapper_write_dtd;
+        guththila_xml_writer_wrapper_write_dtd;
     writer_impl->writer.ops->write_entity_ref =
-            guththila_xml_writer_wrapper_write_entity_ref;
+        guththila_xml_writer_wrapper_write_entity_ref;
     writer_impl->writer.ops->write_start_document =
-            guththila_xml_writer_wrapper_write_start_document;
+        guththila_xml_writer_wrapper_write_start_document;
     writer_impl->writer.ops->write_start_document_with_version =
-            guththila_xml_writer_wrapper_write_start_document_with_version;
+        guththila_xml_writer_wrapper_write_start_document_with_version;
     writer_impl->writer.ops->write_start_document_with_version_encoding =
-            guththila_xml_writer_wrapper_write_start_document_with_version_encoding;
+        guththila_xml_writer_wrapper_write_start_document_with_version_encoding;
     writer_impl->writer.ops->write_characters =
-            guththila_xml_writer_wrapper_write_characters;
+        guththila_xml_writer_wrapper_write_characters;
     writer_impl->writer.ops->get_prefix =
-            guththila_xml_writer_wrapper_get_prefix;
+        guththila_xml_writer_wrapper_get_prefix;
     writer_impl->writer.ops->set_prefix = guththila_xml_writer_wrapper_set_prefix;
     writer_impl->writer.ops->set_default_prefix =
-            guththila_xml_writer_wrapper_set_default_prefix;
+        guththila_xml_writer_wrapper_set_default_prefix;
     writer_impl->writer.ops->write_encoded =
-            guththila_xml_writer_wrapper_write_encoded;
+        guththila_xml_writer_wrapper_write_encoded;
     writer_impl->writer.ops->get_xml =
-            guththila_xml_writer_wrapper_get_xml;
+        guththila_xml_writer_wrapper_get_xml;
 
-   return &(writer_impl->writer);
+    return &(writer_impl->writer);
 
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_free(axiom_xml_writer_t *writer,
-                                  const axis2_env_t *env)
+        const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
-    if(AXIS2_INTF_TO_IMPL(writer)->parser)
-      {
-	if (AXIS2_INTF_TO_IMPL(writer)->parser->xsw)
-	  guththila_xml_writer_free((axis2_env_t *)env,
-						   AXIS2_INTF_TO_IMPL(writer)->parser);
-
-	guththila_free ((axis2_env_t *)env, 
-					AXIS2_INTF_TO_IMPL(writer)->parser);
-      }
-            
-    if(writer->ops)
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    if (AXIS2_INTF_TO_IMPL(writer)->parser)
+    {
+        if (AXIS2_INTF_TO_IMPL(writer)->parser->xsw)
+            guththila_xml_writer_free((axis2_env_t *)env,
+                    AXIS2_INTF_TO_IMPL(writer)->parser);
+
+        guththila_free((axis2_env_t *)env,
+                AXIS2_INTF_TO_IMPL(writer)->parser);
+    }
+
+    if (writer->ops)
         AXIS2_FREE(env->allocator, writer->ops);
 
     if (writer)
-      AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(writer));
+        AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(writer));
 
     return AXIS2_SUCCESS;
 }
-        
- axis2_status_t AXIS2_CALL
+
+axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_element(
-                                    axiom_xml_writer_t *writer,
-                                    const axis2_env_t *env,
-                                    axis2_char_t *localname)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname)
 {
     int status = AXIS2_SUCCESS;
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
     guththila_write_start_element(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    localname);
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        localname);
     return status;
 }
 
@@ -504,445 +505,445 @@
 /*                     (axis2_env_t *)env, */
 /*                     AXIS2_INTF_TO_IMPL(writer)->guththila_writer); */
 /* } */
-        
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_element_with_namespace(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname,
-                                        axis2_char_t *namespace_uri)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *namespace_uri)
 {
-  int status = AXIS2_SUCCESS;
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    int status = AXIS2_SUCCESS;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,namespace_uri, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
     guththila_write_start_element_with_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    localname,
-                    namespace_uri);
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        localname,
+        namespace_uri);
     return status;
 }
-        
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname,
-                                        axis2_char_t *namespace_uri,
-                                        axis2_char_t *prefix)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *namespace_uri,
+    axis2_char_t *prefix)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname,  AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE);
- guththila_write_start_element_with_prefix_and_namespace(
-		    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    prefix, namespace_uri, localname);
- return AXIS2_SUCCESS;
-    
+    guththila_write_start_element_with_prefix_and_namespace(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        prefix, namespace_uri, localname);
+    return AXIS2_SUCCESS;
+
 }
-                                    
- axis2_status_t AXIS2_CALL
+
+axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_empty_element(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
-     guththila_write_empty_element(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser, localname);
-     return AXIS2_SUCCESS;
-    
-    
+    guththila_write_empty_element(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser, localname);
+    return AXIS2_SUCCESS;
+
+
 }
-        
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_empty_element_with_namespace(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname,
-                                        axis2_char_t *namespace_uri)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *namespace_uri)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
-     guththila_write_empty_element_with_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    namespace_uri, localname);
-     return AXIS2_SUCCESS;
+    guththila_write_empty_element_with_namespace(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        namespace_uri, localname);
+    return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix(
-                                        axiom_xml_writer_t *writer,
-                                        const axis2_env_t *env,
-                                        axis2_char_t *localname,
-                                        axis2_char_t *namespace_uri,
-                                        axis2_char_t *prefix)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *namespace_uri,
+    axis2_char_t *prefix)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE);
-    
- guththila_write_empty_element_with_prefix_and_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    prefix, namespace_uri, localname);
+
+    guththila_write_empty_element_with_prefix_and_namespace(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        prefix, namespace_uri, localname);
     return AXIS2_SUCCESS;
-    
-    
+
+
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_end_element(axiom_xml_writer_t *writer,
-                                               const axis2_env_t *env)
+        const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
-     guththila_write_end_element(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser);
-     return AXIS2_SUCCESS;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    guththila_write_end_element(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser);
+    return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_end_document(axiom_xml_writer_t *writer,
-                                               const axis2_env_t *env)
+        const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     guththila_write_end_document(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser);
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser);
     return AXIS2_SUCCESS;
-    
+
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_attribute(axiom_xml_writer_t *writer,
-                                           const axis2_env_t *env,
-                                           axis2_char_t *localname,
-                                           axis2_char_t *value)
+        const axis2_env_t *env,
+        axis2_char_t *localname,
+        axis2_char_t *value)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
     guththila_write_attribute(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    localname, value);
-    return AXIS2_SUCCESS;
-                        
-    
-    
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        localname, value);
+    return AXIS2_SUCCESS;
+
+
+
 }
-                                               
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_attribute_with_namespace(
-                                          axiom_xml_writer_t *writer,
-                                          const axis2_env_t *env,
-                                          axis2_char_t *localname,
-                                          axis2_char_t *value,
-                                          axis2_char_t *namespace_uri)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *value,
+    axis2_char_t *namespace_uri)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname,  AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
-    
-     guththila_write_attribute_with_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    namespace_uri, localname, value);
+
+    guththila_write_attribute_with_namespace(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        namespace_uri, localname, value);
     return AXIS2_SUCCESS;
 }
-                                          
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix(
-                                          axiom_xml_writer_t *writer,
-                                          const axis2_env_t *env,
-                                          axis2_char_t *localname,
-                                          axis2_char_t *value,
-                                          axis2_char_t *namespace_uri,
-                                          axis2_char_t *prefix)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *localname,
+    axis2_char_t *value,
+    axis2_char_t *namespace_uri,
+    axis2_char_t *prefix)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, prefix , AXIS2_FAILURE);
-     guththila_write_attribute_with_prefix_and_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    prefix, namespace_uri, localname, value);
-     return AXIS2_SUCCESS;
-    
-    
-    
+    guththila_write_attribute_with_prefix_and_namespace(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        prefix, namespace_uri, localname, value);
+    return AXIS2_SUCCESS;
+
+
+
 }
-                                          
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_namespace(axiom_xml_writer_t *writer,
-                                             const axis2_env_t *env,
-                                             axis2_char_t *prefix,
-                                             axis2_char_t *namespace_uri)
+        const axis2_env_t *env,
+        axis2_char_t *prefix,
+        axis2_char_t *namespace_uri)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
     /*     AXIS2_PARAM_CHECK(env->error, prefix , AXIS2_FAILURE); */
     /* when defult namespace comes prefix is null */
-     guththila_write_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    prefix, namespace_uri);
-     return AXIS2_SUCCESS;
+    guththila_write_namespace(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        prefix, namespace_uri);
+    return AXIS2_SUCCESS;
 
 }
 
 
 axis2_status_t AXIS2_CALL
-guththila_xml_writer_wrapper_write_default_namespace (axiom_xml_writer_t *writer,
-                                             const axis2_env_t *env,
-                                             axis2_char_t *namespace_uri)
+guththila_xml_writer_wrapper_write_default_namespace(axiom_xml_writer_t *writer,
+        const axis2_env_t *env,
+        axis2_char_t *namespace_uri)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
     guththila_write_default_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    namespace_uri);
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        namespace_uri);
     return AXIS2_SUCCESS;
-    
+
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_comment(axiom_xml_writer_t *writer,
-                                           const axis2_env_t *env,
-                                           axis2_char_t *value)
+        const axis2_env_t *env,
+        axis2_char_t *value)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
-     guththila_write_comment(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    value);
+    guththila_write_comment(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        value);
     return AXIS2_SUCCESS;
-    
+
 }
 
-                                           
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_processing_instruction(
-                                           axiom_xml_writer_t *writer,
-                                           const axis2_env_t *env,
-                                           axis2_char_t *target)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *target)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, target, AXIS2_FAILURE);
-/*     return guththila_write_processing_instruction( */
-/*                     (axis2_env_t *)env, */
-/*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
-/*                     target); */
-    return AXIS2_SUCCESS;    
-    
+    /*     return guththila_write_processing_instruction( */
+    /*                     (axis2_env_t *)env, */
+    /*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
+    /*                     target); */
+    return AXIS2_SUCCESS;
+
 }
-                                           
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_processing_instruction_data(
-                                           axiom_xml_writer_t *writer,
-                                           const axis2_env_t *env,
-                                           axis2_char_t *target,
-                                           axis2_char_t *data)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *target,
+    axis2_char_t *data)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, target, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, data, AXIS2_FAILURE);
-/*     return guththila_write_processing_instruction_data( */
-/*                     (axis2_env_t *)env, */
-/*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
-/*                     target, data); */
-    return AXIS2_SUCCESS;    
+    /*     return guththila_write_processing_instruction_data( */
+    /*                     (axis2_env_t *)env, */
+    /*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
+    /*                     target, data); */
+    return AXIS2_SUCCESS;
 }
-                                           
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_cdata(axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *data)
+        const axis2_env_t *env,
+        axis2_char_t *data)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, data, AXIS2_FAILURE);
-/*     return guththila_write_cdata( */
-/*                     (axis2_env_t *)env, */
-/*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
-/*                     data); */
-    return AXIS2_SUCCESS;                        
+    /*     return guththila_write_cdata( */
+    /*                     (axis2_env_t *)env, */
+    /*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
+    /*                     data); */
+    return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_dtd(axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *dtd)
+        const axis2_env_t *env,
+        axis2_char_t *dtd)
 {
     /* AXIS2_ENV_CHECK( env, AXIS2_FAILURE); */
-/*     AXIS2_PARAM_CHECK(env->error, dtd, AXIS2_FAILURE); */
-/*     return guththila_write_dtd( */
-/*                     (axis2_env_t *)env, */
-/*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
-/*                     dtd); */
-  return 0;
+    /*     AXIS2_PARAM_CHECK(env->error, dtd, AXIS2_FAILURE); */
+    /*     return guththila_write_dtd( */
+    /*                     (axis2_env_t *)env, */
+    /*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
+    /*                     dtd); */
+    return 0;
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_entity_ref(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *name)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *name)
 {
     /* AXIS2_ENV_CHECK( env, AXIS2_FAILURE); */
-/*     AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE); */
-/*     return guththila_write_entity_ref( */
-/*                     (axis2_env_t *)env, */
-/*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
-/*                     name); */
-  return 0;
-    
+    /*     AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE); */
+    /*     return guththila_write_entity_ref( */
+    /*                     (axis2_env_t *)env, */
+    /*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
+    /*                     name); */
+    return 0;
+
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_document(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env)
 {
-     AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
-      guththila_write_start_document(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser);
-      return AXIS2_SUCCESS;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    guththila_write_start_document(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser);
+    return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_document_with_version(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *version)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *version)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, version, AXIS2_FAILURE);
     /* return guththila_write_start_document_with_version( */
-/*                     (axis2_env_t *)env, */
-/*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
-/*                     version); */
-      guththila_write_start_document(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser);
-      return AXIS2_SUCCESS;
+    /*                     (axis2_env_t *)env, */
+    /*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
+    /*                     version); */
+    guththila_write_start_document(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser);
+    return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_start_document_with_version_encoding(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *encoding,
-                                         axis2_char_t *version)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *encoding,
+    axis2_char_t *version)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, version, AXIS2_FAILURE);
-    
-/*     return guththila_write_start_document_with_version_encoding( */
-/*                     (axis2_env_t *)env, */
-/*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
-/*                     encoding, version); */
-      guththila_write_start_document(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser);
-      return AXIS2_SUCCESS;
+
+    /*     return guththila_write_start_document_with_version_encoding( */
+    /*                     (axis2_env_t *)env, */
+    /*                     AXIS2_INTF_TO_IMPL(writer)->parser, */
+    /*                     encoding, version); */
+    guththila_write_start_document(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser);
+    return AXIS2_SUCCESS;
 }
 
-                                         
+
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_characters(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *text)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *text)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE);
-     guththila_write_characters(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser,
-                    text);
+    guththila_write_characters(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser,
+        text);
     return AXIS2_SUCCESS;
 }
 
 axis2_char_t* AXIS2_CALL
-guththila_xml_writer_wrapper_get_prefix(  axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *uri)
+guththila_xml_writer_wrapper_get_prefix(axiom_xml_writer_t *writer,
+        const axis2_env_t *env,
+        axis2_char_t *uri)
 {
-    AXIS2_ENV_CHECK( env, NULL);
+    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, uri, NULL);
-   return guththila_get_prefix_for_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser, uri);
+    return guththila_get_prefix_for_namespace(
+                (axis2_env_t *)env,
+                AXIS2_INTF_TO_IMPL(writer)->parser, uri);
 }
 
 axis2_status_t AXIS2_CALL
-guththila_xml_writer_wrapper_set_prefix( axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *prefix,
-                                         axis2_char_t *uri)
+guththila_xml_writer_wrapper_set_prefix(axiom_xml_writer_t *writer,
+        const axis2_env_t *env,
+        axis2_char_t *prefix,
+        axis2_char_t *uri)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE);
- guththila_write_namespace (
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser, prefix, uri);
+    guththila_write_namespace(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser, prefix, uri);
     return AXIS2_SUCCESS;
-    
+
 }
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_set_default_prefix(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *uri)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *uri)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE);
- guththila_write_default_namespace(
-                    (axis2_env_t *)env,
-                    AXIS2_INTF_TO_IMPL(writer)->parser, uri);
- return AXIS2_SUCCESS;
+    guththila_write_default_namespace(
+        (axis2_env_t *)env,
+        AXIS2_INTF_TO_IMPL(writer)->parser, uri);
+    return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 guththila_xml_writer_wrapper_write_encoded(
-                                         axiom_xml_writer_t *writer,
-                                         const axis2_env_t *env,
-                                         axis2_char_t *text,
-                                         int in_attr)
+    axiom_xml_writer_t *writer,
+    const axis2_env_t *env,
+    axis2_char_t *text,
+    int in_attr)
 {
-    AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE);
-/*     return guththila_write_encoded( */
-/*                     (axis2_env_t *)env, */
-/*                     AXIS2_INTF_TO_IMPL(writer)->parser, text,
-		       in_attr); */
+    /*     return guththila_write_encoded( */
+    /*                     (axis2_env_t *)env, */
+    /*                     AXIS2_INTF_TO_IMPL(writer)->parser, text,
+    		       in_attr); */
     return AXIS2_SUCCESS;
 }
 
 void* AXIS2_CALL
 guththila_xml_writer_wrapper_get_xml(axiom_xml_writer_t *writer,
-                                     const axis2_env_t *env)
+        const axis2_env_t *env)
 {
-  char *buffer = NULL;
-  AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
-  buffer = guththila_get_memory_buffer((axis2_env_t *)env,
-						       AXIS2_INTF_TO_IMPL(writer)->parser);
-  return (void*)buffer ;
+    char *buffer = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    buffer = guththila_get_memory_buffer((axis2_env_t *)env,
+            AXIS2_INTF_TO_IMPL(writer)->parser);
+    return (void*)buffer ;
 }

Modified: webservices/axis2/trunk/c/axiom/test/om/test_om.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/test/om/test_om.c?view=diff&rev=448042&r1=448041&r2=448042
==============================================================================
--- webservices/axis2/trunk/c/axiom/test/om/test_om.c (original)
+++ webservices/axis2/trunk/c/axiom/test/om/test_om.c Tue Sep 19 20:11:28 2006
@@ -96,102 +96,102 @@
 
     document = AXIOM_STAX_BUILDER_GET_DOCUMENT(builder, environment);
     /**
-        get root element , building starts hear 
-     */
-    if (!document)
-        return -1;
-
-    node1 = AXIOM_DOCUMENT_GET_ROOT_ELEMENT(document, environment);
-    if (!node1)
-    {
-        printf(" root element null ");
-        AXIOM_STAX_BUILDER_FREE(builder, environment);
-        return -1;
-    }
-    if (node1)
-    {
-        /** print root node information */
-
-
-        ele1 = AXIOM_NODE_GET_DATA_ELEMENT(node1, environment);
-        if (ele1)
-
-            printf("root localname %s\n", AXIOM_ELEMENT_GET_LOCALNAME(ele1, environment));
-
-        ns = AXIOM_ELEMENT_GET_NAMESPACE(ele1, environment, node1);
-
-        if (ns)
-        {
-            printf("root ns prefix %s\n", AXIOM_NAMESPACE_GET_PREFIX(ns, environment));
-            printf("root ns uri %s\n", AXIOM_NAMESPACE_GET_URI(ns, environment));
-
-        }
-    }
-    /** build the document continuously untill all the xml file is built in to a om model */
-
-
-    node2 = AXIOM_DOCUMENT_BUILD_NEXT(document , environment);
-    do
-    {
-
-        if (!node2)
-            break;
-
-        switch (AXIOM_NODE_GET_NODE_TYPE(node2, environment))
-        {
-            case AXIOM_ELEMENT:
-                ele2 = (axiom_element_t*) AXIOM_NODE_GET_DATA_ELEMENT(node2, environment);
-                if (ele2 && AXIOM_ELEMENT_GET_LOCALNAME(ele2, environment))
-                {
-                    printf("\n localname %s\n" , AXIOM_ELEMENT_GET_LOCALNAME(ele2, environment));
-                }
-
-                break;
-            case AXIOM_TEXT:
-
-                text = (axiom_text_t *)AXIOM_NODE_GET_DATA_ELEMENT(node2, environment);
-                if (text && AXIOM_TEXT_GET_VALUE(text , environment))
-                    printf("\n text value  %s \n", AXIOM_TEXT_GET_VALUE(text, environment));
-                break;
-
-            default:
-                break;
-        }
-
-        node2 = AXIOM_DOCUMENT_BUILD_NEXT(document , environment);
-    }
-    while (node2);
-    printf("END: pull document\n");
-
-    printf("Serialize pulled document\n");
-
-    writer = axiom_xml_writer_create_for_memory(environment, NULL, AXIS2_TRUE, 0,
-            AXIS2_XML_PARSER_TYPE_BUFFER);
-    om_output = axiom_output_create(environment, writer);
-
-    AXIOM_NODE_SERIALIZE(node1, environment , om_output);
-
-    buffer = (axis2_char_t*)AXIOM_XML_WRITER_GET_XML(writer, environment);
-
-    AXIOM_OUTPUT_FREE(om_output, environment);
-    if (buffer)
-        printf("%s", buffer);
-
-    AXIOM_STAX_BUILDER_FREE(builder, environment);
-    if (buffer)
-        AXIS2_FREE(environment->allocator, buffer);
-    printf("\ndone\n");
-    fclose(f);
-    return 0;
-}
-
-
-
-int
-test_om_serialize()
-{
-
-    /*
+        get root element , building starts hear 
+     */
+    if (!document)
+        return -1;
+
+    node1 = AXIOM_DOCUMENT_GET_ROOT_ELEMENT(document, environment);
+    if (!node1)
+    {
+        printf(" root element null ");
+        AXIOM_STAX_BUILDER_FREE(builder, environment);
+        return -1;
+    }
+    if (node1)
+    {
+        /** print root node information */
+
+
+        ele1 = AXIOM_NODE_GET_DATA_ELEMENT(node1, environment);
+        if (ele1)
+
+            printf("root localname %s\n", AXIOM_ELEMENT_GET_LOCALNAME(ele1, environment));
+
+        ns = AXIOM_ELEMENT_GET_NAMESPACE(ele1, environment, node1);
+
+        if (ns)
+        {
+            printf("root ns prefix %s\n", AXIOM_NAMESPACE_GET_PREFIX(ns, environment));
+            printf("root ns uri %s\n", AXIOM_NAMESPACE_GET_URI(ns, environment));
+
+        }
+    }
+    /** build the document continuously untill all the xml file is built in to a om model */
+
+
+    node2 = AXIOM_DOCUMENT_BUILD_NEXT(document , environment);
+    do
+    {
+
+        if (!node2)
+            break;
+
+        switch (AXIOM_NODE_GET_NODE_TYPE(node2, environment))
+        {
+            case AXIOM_ELEMENT:
+                ele2 = (axiom_element_t*) AXIOM_NODE_GET_DATA_ELEMENT(node2, environment);
+                if (ele2 && AXIOM_ELEMENT_GET_LOCALNAME(ele2, environment))
+                {
+                    printf("\n localname %s\n" , AXIOM_ELEMENT_GET_LOCALNAME(ele2, environment));
+                }
+
+                break;
+            case AXIOM_TEXT:
+
+                text = (axiom_text_t *)AXIOM_NODE_GET_DATA_ELEMENT(node2, environment);
+                if (text && AXIOM_TEXT_GET_VALUE(text , environment))
+                    printf("\n text value  %s \n", AXIOM_TEXT_GET_VALUE(text, environment));
+                break;
+
+            default:
+                break;
+        }
+
+        node2 = AXIOM_DOCUMENT_BUILD_NEXT(document , environment);
+    }
+    while (node2);
+    printf("END: pull document\n");
+
+    printf("Serialize pulled document\n");
+
+    writer = axiom_xml_writer_create_for_memory(environment, NULL, AXIS2_TRUE, 0,
+            AXIS2_XML_PARSER_TYPE_BUFFER);
+    om_output = axiom_output_create(environment, writer);
+
+    AXIOM_NODE_SERIALIZE(node1, environment , om_output);
+
+    buffer = (axis2_char_t*)AXIOM_XML_WRITER_GET_XML(writer, environment);
+
+    AXIOM_OUTPUT_FREE(om_output, environment);
+    if (buffer)
+        printf("%s", buffer);
+
+    AXIOM_STAX_BUILDER_FREE(builder, environment);
+    if (buffer)
+        AXIS2_FREE(environment->allocator, buffer);
+    printf("\ndone\n");
+    fclose(f);
+    return 0;
+}
+
+
+
+int
+test_om_serialize()
+{
+
+    /*
        <book xmlns:axiomc="http://ws.apache.org/axis2/c/om" xmlns:isbn="urn:ISBN:0-395-74341-6">
        <title>Axis2/C OM HOWTO</title>
        <isbn:number>1748491379</isbn:number>

Modified: webservices/axis2/trunk/c/guththila/samples/guththila_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/samples/guththila_main.c?view=diff&rev=448042&r1=448041&r2=448042
==============================================================================
--- webservices/axis2/trunk/c/guththila/samples/guththila_main.c (original)
+++ webservices/axis2/trunk/c/guththila/samples/guththila_main.c Tue Sep 19 20:11:28 2006
@@ -13,174 +13,174 @@
  *   See the License for the specific language governing permissions and
  *   limitations under the License.
  *
- *   
- * @author Dinesh Premalal (xydinesh@gmail.com, premalwd@cse.mrt.ac.lk)   
+ *
+ * @author Dinesh Premalal (xydinesh@gmail.com, premalwd@cse.mrt.ac.lk)
 */
 
 #include "guththila.h"
 #include "guththila_defines.h"
 
 int
-main (int argc, char *argv[])
+main(int argc, char *argv[])
 {
     int c;
     axis2_allocator_t *allocator;
     guththila_reader_t *red;
     axis2_env_t *environment;
     guththila_t *parser;
-	char *xml_buffer;
-    allocator = axis2_allocator_init (NULL);
-	xml_buffer = "<?xml version = \"1.0\"?><test></test>";
+    char *xml_buffer;
+    allocator = axis2_allocator_init(NULL);
+    xml_buffer = "<?xml version = \"1.0\"?><test></test>";
     environment =
-        axis2_env_create (allocator);
+        axis2_env_create(allocator);
 
     if (argc > 1)
-      red = guththila_reader_create_for_file (environment, argv[1]);
+        red = guththila_reader_create_for_file(environment, argv[1]);
     else
-      {
-	if (xml_buffer)
-	  {
-	    int size = 0;
-	    size = strlen (xml_buffer);
-	    red = guththila_reader_create_for_memory (environment, (void *)xml_buffer, size, NULL);
-	  }
-      }
-    
-    parser = guththila_create (environment, red);
-    guththila_read (environment, parser);
+    {
+        if (xml_buffer)
+        {
+            int size = 0;
+            size = strlen(xml_buffer);
+            red = guththila_reader_create_for_memory(environment, (void *)xml_buffer, size, NULL);
+        }
+    }
+
+    parser = guththila_create(environment, red);
+    guththila_read(environment, parser);
 
-    while ((c = guththila_next (environment, parser)) != -1)
+    while ((c = guththila_next(environment, parser)) != -1)
     {
         switch (c)
         {
-        case GUTHTHILA_START_DOCUMENT:
+            case GUTHTHILA_START_DOCUMENT:
             {
                 int ix;
-                printf ("<?xml ");
+                printf("<?xml ");
 
                 ix = guththila_get_attribute_count
-                    (environment, parser);
+                        (environment, parser);
                 for (; ix > 0; ix--)
                 {
                     guththila_attribute_t *a;
                     char *p;
-                    a = guththila_get_attribute (environment,
-                                                                 parser);
+                    a = guththila_get_attribute(environment,
+                            parser);
                     p = guththila_get_attribute_name
-                        (environment, parser, a);
-                    printf ("%s=\"", p);
-                    AXIS2_FREE (allocator, p);
+                            (environment, parser, a);
+                    printf("%s=\"", p);
+                    AXIS2_FREE(allocator, p);
                     p = guththila_get_attribute_value
-                        (environment, parser, a);
-                    printf ("%s\" ", p);
-                    AXIS2_FREE (allocator, p);
+                            (environment, parser, a);
+                    printf("%s\" ", p);
+                    AXIS2_FREE(allocator, p);
                 }
-                printf ("?>\n");
+                printf("?>\n");
             }
             break;
-        case GUTHTHILA_START_ELEMENT:
-        case GUTHTHILA_EMPTY_ELEMENT:
+            case GUTHTHILA_START_ELEMENT:
+            case GUTHTHILA_EMPTY_ELEMENT:
             {
                 int ia;
                 int d;
                 char *p;
-		guththila_depth_t *depth;
+                guththila_depth_t *depth;
 
-                printf ("<");
-                p = guththila_get_prefix (environment,
-                                                          parser);
+                printf("<");
+                p = guththila_get_prefix(environment,
+                        parser);
                 if (p)
                 {
-                    printf ("%s:", p);
-                    AXIS2_FREE (allocator, p);
+                    printf("%s:", p);
+                    AXIS2_FREE(allocator, p);
                 }
-                p = guththila_get_name (environment, parser);
-                printf ("%s", p);
-                AXIS2_FREE (allocator, p);
+                p = guththila_get_name(environment, parser);
+                printf("%s", p);
+                AXIS2_FREE(allocator, p);
 
                 ia = guththila_get_attribute_count
-                    (environment, parser);
+                        (environment, parser);
                 for (; ia > 0; ia--)
                 {
                     /* p = guththila_get_attribute_prefix_by_number
                        (parser, ia); */
-                    p = guththila_get_attribute_namespace_by_number (environment, parser, ia);
+                    p = guththila_get_attribute_namespace_by_number(environment, parser, ia);
                     if (p)
                     {
-                        printf (" %s:", p);
-                        AXIS2_FREE (allocator, p);
-                        p = guththila_get_attribute_name_by_number (environment, parser, ia);
-                        printf ("%s=\"", p);
-                        AXIS2_FREE (allocator, p);
-                        p = guththila_get_attribute_value_by_number (environment, parser, ia);
-                        printf ("%s\"", p);
-                        AXIS2_FREE (allocator, p);
+                        printf(" %s:", p);
+                        AXIS2_FREE(allocator, p);
+                        p = guththila_get_attribute_name_by_number(environment, parser, ia);
+                        printf("%s=\"", p);
+                        AXIS2_FREE(allocator, p);
+                        p = guththila_get_attribute_value_by_number(environment, parser, ia);
+                        printf("%s\"", p);
+                        AXIS2_FREE(allocator, p);
                     }
                     else
                     {
-                        p = guththila_get_attribute_name_by_number (environment, parser, ia);
-                        printf (" %s=\"", p);
-                        AXIS2_FREE (allocator, p);
-                        p = guththila_get_attribute_value_by_number (environment, parser, ia);
-                        printf ("%s\"", p);
-                        AXIS2_FREE (allocator, p);
+                        p = guththila_get_attribute_name_by_number(environment, parser, ia);
+                        printf(" %s=\"", p);
+                        AXIS2_FREE(allocator, p);
+                        p = guththila_get_attribute_value_by_number(environment, parser, ia);
+                        printf("%s\"", p);
+                        AXIS2_FREE(allocator, p);
                     }
                 }
-		depth = (guththila_depth_t *) AXIS2_STACK_GET (parser->dep, environment);
+                depth = (guththila_depth_t *) AXIS2_STACK_GET(parser->dep, environment);
                 d = depth->count;
                 for (; d > 0; d--)
                 {
-                    p = guththila_get_namespace_prefix_by_number (environment, parser, d);
-                    if (strncmp (p, "xmlns", 5))
-                        printf (" xmlns:");
-                    printf ("%s=\"", p);
-                    AXIS2_FREE (allocator, p);
+                    p = guththila_get_namespace_prefix_by_number(environment, parser, d);
+                    if (strncmp(p, "xmlns", 5))
+                        printf(" xmlns:");
+                    printf("%s=\"", p);
+                    AXIS2_FREE(allocator, p);
                     p = guththila_get_namespace_uri_by_number
-                        (environment, parser, d);
-                    printf ("%s\" ", p);
-                    AXIS2_FREE (allocator, p);
+                            (environment, parser, d);
+                    printf("%s\" ", p);
+                    AXIS2_FREE(allocator, p);
                 }
                 if (parser->guththila_event == GUTHTHILA_START_ELEMENT)
-                    printf (">");
+                    printf(">");
                 else
-                    printf ("/>");
+                    printf("/>");
             }
             break;
-        case GUTHTHILA_END_ELEMENT:
+            case GUTHTHILA_END_ELEMENT:
             {
                 char *p;
-                printf ("</");
-                p = guththila_get_prefix (environment,
-                                                          parser);
+                printf("</");
+                p = guththila_get_prefix(environment,
+                        parser);
                 if (p)
                 {
-                    printf ("%s:", p);
-                    AXIS2_FREE (allocator, p);
+                    printf("%s:", p);
+                    AXIS2_FREE(allocator, p);
                 }
-                p = guththila_get_name (environment, parser);
-                printf ("%s", p);
-                AXIS2_FREE (allocator, p);
-                printf (">");
+                p = guththila_get_name(environment, parser);
+                printf("%s", p);
+                AXIS2_FREE(allocator, p);
+                printf(">");
             }
             break;
-        case GUTHTHILA_CHARACTER:
+            case GUTHTHILA_CHARACTER:
             {
                 char *p;
-                p = guththila_get_value (environment, parser);
-		if (!parser->is_whitespace)
-		  {
-		    printf (p);
-		  }
-                AXIS2_FREE (allocator, p);
+                p = guththila_get_value(environment, parser);
+                if (!parser->is_whitespace)
+                {
+                    printf(p);
+                }
+                AXIS2_FREE(allocator, p);
             }
             break;
-        case GUTHTHILA_COMMENT:
-            break;
+            case GUTHTHILA_COMMENT:
+                break;
         };
     }
-    guththila_reader_free (environment, red);
-    guththila_free (environment, parser);
-    axis2_allocator_free (allocator);
-    axis2_env_free (environment);
+    guththila_reader_free(environment, red);
+    guththila_free(environment, parser);
+    axis2_allocator_free(allocator);
+    axis2_env_free(environment);
     return 0;
 }

Modified: webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c?view=diff&rev=448042&r1=448041&r2=448042
==============================================================================
--- webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c (original)
+++ webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c Tue Sep 19 20:11:28 2006
@@ -3,29 +3,29 @@
 #include <guththila_reader.h>
 #include <guththila_writer.h>
 #include <guththila.h>
-int main ()
+int main()
 {
-	char *t;
-  axis2_allocator_t *allocator;
-  axis2_env_t *env ;
-  guththila_t *parser ;
-  /*guththila_writer_t *writer;*/
-  allocator = axis2_allocator_init (NULL);
-  env = axis2_env_create (allocator);
-  /*writer = guththila_writer_create_for_memory (env);*/
-  parser = guththila_create (env, NULL);
-  guththila_create_xml_stream_writer_for_memory (env, parser);
- // guththila_write_start_element_with_prefix (env, parser, "my", "one");
-  guththila_write_start_element (env, parser, "two");
-  guththila_write_default_namespace (env, parser, "http://another.host.com");
-  guththila_write_start_element (env, parser, "two.one");
-  guththila_write_end_element (env, parser);
-  guththila_write_end_document (env, parser);
-  t = guththila_writer_get_buffer (env, parser->xsw->writer);
-  printf ("%s \n", t);
-  guththila_xml_writer_free (env, parser);
-  guththila_free (env, parser);
-  axis2_allocator_free (allocator);
-  axis2_env_free (env);
-  return 0;
+    char *t;
+    axis2_allocator_t *allocator;
+    axis2_env_t *env ;
+    guththila_t *parser ;
+    /*guththila_writer_t *writer;*/
+    allocator = axis2_allocator_init(NULL);
+    env = axis2_env_create(allocator);
+    /*writer = guththila_writer_create_for_memory (env);*/
+    parser = guththila_create(env, NULL);
+    guththila_create_xml_stream_writer_for_memory(env, parser);
+// guththila_write_start_element_with_prefix (env, parser, "my", "one");
+    guththila_write_start_element(env, parser, "two");
+    guththila_write_default_namespace(env, parser, "http://another.host.com");
+    guththila_write_start_element(env, parser, "two.one");
+    guththila_write_end_element(env, parser);
+    guththila_write_end_document(env, parser);
+    t = guththila_writer_get_buffer(env, parser->xsw->writer);
+    printf("%s \n", t);
+    guththila_xml_writer_free(env, parser);
+    guththila_free(env, parser);
+    axis2_allocator_free(allocator);
+    axis2_env_free(env);
+    return 0;
 }

Modified: webservices/axis2/trunk/c/guththila/src/guththila_buffer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_buffer.c?view=diff&rev=448042&r1=448041&r2=448042
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_buffer.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_buffer.c Tue Sep 19 20:11:28 2006
@@ -13,7 +13,7 @@
  *   See the License for the specific language governing permissions and
  *   limitations under the License.
  *
- *   
+ *
  */
 
 
@@ -23,74 +23,74 @@
 #include <axis2_env.h>
 
 AXIS2_EXTERN guththila_buffer_t * AXIS2_CALL
-guththila_buffer_create (axis2_env_t * environment, int size)
+guththila_buffer_create(axis2_env_t * environment, int size)
 {
     guththila_buffer_t *name;
     name = NULL;
-    name  = AXIS2_MALLOC (environment->allocator,
-                                            sizeof (guththila_buffer_t));
+    name  = AXIS2_MALLOC(environment->allocator,
+            sizeof(guththila_buffer_t));
     if (name)
-      {
-	name->size = size;
-	name->offset = 0;
-	name->last = 0;
-	name->next = 0;
-	name->is_memory = 0;
-	name->buff = NULL;
-	if (size != 0)
-	  name->buff = (guththila_char_t *) AXIS2_MALLOC (
-							  environment->allocator, size);
-      }
-	return name;
+    {
+        name->size = size;
+        name->offset = 0;
+        name->last = 0;
+        name->next = 0;
+        name->is_memory = 0;
+        name->buff = NULL;
+        if (size != 0)
+            name->buff = (guththila_char_t *) AXIS2_MALLOC(
+                        environment->allocator, size);
+    }
+    return name;
 }
 
 AXIS2_EXTERN guththila_buffer_t *
-guththila_buffer_create_for_buffer (axis2_env_t * environment, char *buffer, int size)
+guththila_buffer_create_for_buffer(axis2_env_t * environment, char *buffer, int size)
 {
     guththila_buffer_t *name;
     name = NULL;
-    name  = AXIS2_MALLOC (environment->allocator,
-                                            sizeof (guththila_buffer_t));
+    name  = AXIS2_MALLOC(environment->allocator,
+            sizeof(guththila_buffer_t));
     if (name)
-      {
-	name->size = size;
-	name->offset = 0;
-	name->is_memory = 1;
-	name->last = size;
-	name->next = 0;
-	name->buff = NULL;
-	if (buffer)
-	  name->buff = buffer;
-      }
+    {
+        name->size = size;
+        name->offset = 0;
+        name->is_memory = 1;
+        name->last = size;
+        name->next = 0;
+        name->buff = NULL;
+        if (buffer)
+            name->buff = buffer;
+    }
     return name;
 }
 
 AXIS2_EXTERN void
-guththila_buffer_free (axis2_env_t * environment,
-                       guththila_buffer_t * name)
+guththila_buffer_free(axis2_env_t * environment,
+        guththila_buffer_t * name)
 {
     if (name)
     {
         if (name->buff && !name->is_memory)
         {
-            AXIS2_FREE (environment->allocator, name->buff);
-	    name->buff = NULL;
+            AXIS2_FREE(environment->allocator, name->buff);
+            name->buff = NULL;
         }
-        AXIS2_FREE (environment->allocator, name);
-	name = NULL;
+        AXIS2_FREE(environment->allocator, name);
+        name = NULL;
     }
 }
 
 
 AXIS2_EXTERN guththila_buffer_t *
-guththila_buffer_grow (axis2_env_t * environment,
-                       guththila_buffer_t * name)
+guththila_buffer_grow(axis2_env_t * environment,
+        guththila_buffer_t * name)
 {
 
     guththila_char_t *x = NULL;
     name->size <<= 1;
-    x = (guththila_char_t *) AXIS2_REALLOC (environment->allocator,
-                                                  name->buff,name->size);
+    x = (guththila_char_t *) AXIS2_REALLOC(environment->allocator,
+            name->buff, name->size);
     if (x)
         name->buff = x;
     else

Modified: webservices/axis2/trunk/c/guththila/src/guththila_reader.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_reader.c?view=diff&rev=448042&r1=448041&r2=448042
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_reader.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_reader.c Tue Sep 19 20:11:28 2006
@@ -13,7 +13,7 @@
  *   See the License for the specific language governing permissions and
  *   limitations under the License.
  *
- *   
+ *
  */
 
 
@@ -25,115 +25,115 @@
 
 
 AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
-guththila_reader_create_for_file (axis2_env_t * environment,
-                                  char *filename)
+guththila_reader_create_for_file(axis2_env_t * environment,
+        char *filename)
 {
     guththila_reader_impl_t *file_reader = NULL;
-    if(!filename)
+    if (!filename)
         return NULL;
-    
-       file_reader = (guththila_reader_impl_t *) AXIS2_MALLOC ( environment->allocator,
-                                                 sizeof (guththila_reader_impl_t));
-    if(!file_reader)
+
+    file_reader = (guththila_reader_impl_t *) AXIS2_MALLOC(environment->allocator,
+            sizeof(guththila_reader_impl_t));
+    if (!file_reader)
         return NULL;
-    
-    file_reader->fp  = fopen(filename,"r");
-    
-    if(!(file_reader->fp ))
+
+    file_reader->fp  = fopen(filename, "r");
+
+    if (!(file_reader->fp))
     {
-        AXIS2_FREE(environment->allocator,file_reader);
+        AXIS2_FREE(environment->allocator, file_reader);
         return NULL;
-    }                                                            
-    
+    }
+
     file_reader->reader.guththila_reader_type = GUTHTHILA_FILE_READER;
-    
+
     return &(file_reader->reader);
 }
 
 
 AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
 guththila_reader_create_for_io(
-                axis2_env_t *environment,
-                int (*input_read_callback)(char *buffer,int size,void* ctx),void* ctx)
+    axis2_env_t *environment,
+    int(*input_read_callback)(char *buffer, int size, void* ctx), void* ctx)
 {
-    guththila_reader_impl_t *io_reader = 
-        (guththila_reader_impl_t *) AXIS2_MALLOC (environment->allocator,
-                                            sizeof (guththila_reader_impl_t));
-    if(!io_reader)
+    guththila_reader_impl_t *io_reader =
+        (guththila_reader_impl_t *) AXIS2_MALLOC(environment->allocator,
+                sizeof(guththila_reader_impl_t));
+    if (!io_reader)
     {
         return NULL;
     }
-    
+
     io_reader->input_read_callback  = input_read_callback;
     io_reader->context = ctx;
     io_reader->reader.guththila_reader_type = GUTHTHILA_IO_READER;
-    
+
     return &(io_reader->reader);
 }
 
 AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
 guththila_reader_create_for_memory(
-                axis2_env_t *environment,
-		void *buffer,
-                int size,
-		void* ctx)
+    axis2_env_t *environment,
+    void *buffer,
+    int size,
+    void* ctx)
 {
-    guththila_reader_impl_t *memory_reader = 
-        (guththila_reader_impl_t *) AXIS2_MALLOC (environment->allocator,
-                                            sizeof (guththila_reader_impl_t));
-    if(!memory_reader)
+    guththila_reader_impl_t *memory_reader =
+        (guththila_reader_impl_t *) AXIS2_MALLOC(environment->allocator,
+                sizeof(guththila_reader_impl_t));
+    if (!memory_reader)
     {
         return NULL;
     }
-    
+
     if (buffer)
-      {
-	memory_reader->buffer  = (char *)buffer;
-	memory_reader->buffer_size =  strlen ((const char *) buffer);
-      }
+    {
+        memory_reader->buffer  = (char *)buffer;
+        memory_reader->buffer_size =  strlen((const char *) buffer);
+    }
     memory_reader->context = ctx;
     memory_reader->reader.guththila_reader_type = GUTHTHILA_MEMORY_READER;
-    
+
     return &(memory_reader->reader);
 }
 
 AXIS2_EXTERN void AXIS2_CALL
-guththila_reader_free (axis2_env_t * environment,
-                       guththila_reader_t * r)
+guththila_reader_free(axis2_env_t * environment,
+        guththila_reader_t * r)
 {
 
     if (!r)
         return;
-    
-    if(r->guththila_reader_type == GUTHTHILA_FILE_READER)
-    {   
-        if(((guththila_reader_impl_t*)r)->fp)
+
+    if (r->guththila_reader_type == GUTHTHILA_FILE_READER)
+    {
+        if (((guththila_reader_impl_t*)r)->fp)
             fclose(((guththila_reader_impl_t*)r)->fp);
     }
-    AXIS2_FREE(environment->allocator, (guththila_reader_impl_t*)r); 
-   return;    
+    AXIS2_FREE(environment->allocator, (guththila_reader_impl_t*)r);
+    return;
 }
 
-        
+
 AXIS2_EXTERN int AXIS2_CALL
-guththila_reader_read (axis2_env_t * environment,
-                       guththila_char_t * buffer,
-                       int offset,
-                       int length,
-                       guththila_reader_t * r)
+guththila_reader_read(axis2_env_t * environment,
+        guththila_char_t * buffer,
+        int offset,
+        int length,
+        guththila_reader_t * r)
 {
-    
-    if(r->guththila_reader_type == GUTHTHILA_FILE_READER)
+
+    if (r->guththila_reader_type == GUTHTHILA_FILE_READER)
     {
-       return (int)fread (buffer + offset, 1, length,((guththila_reader_impl_t*)r)->fp);
+        return (int)fread(buffer + offset, 1, length, ((guththila_reader_impl_t*)r)->fp);
     }
-    else if(r->guththila_reader_type == GUTHTHILA_IO_READER)
+    else if (r->guththila_reader_type == GUTHTHILA_IO_READER)
         return ((guththila_reader_impl_t*)r)->input_read_callback((buffer + offset), length,
-        ((guththila_reader_impl_t*)r)->context);
+                ((guththila_reader_impl_t*)r)->context);
     else if (r->guththila_reader_type == GUTHTHILA_MEMORY_READER)
-      {
-	return ((guththila_reader_impl_t *)r)->buffer_size;
-      }
- 
-    return GUTHTHILA_FAILURE;       
+    {
+        return ((guththila_reader_impl_t *)r)->buffer_size;
+    }
+
+    return GUTHTHILA_FAILURE;
 }



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


Mime
View raw message