axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r345821 [6/8] - in /webservices/axis2/trunk/c: ./ include/ modules/test/om/src/ modules/util/src/ modules/xml/guththila/ modules/xml/om/src/ modules/xml/om/test/ modules/xml/parser/ modules/xml/parser/guththila/impl/src/ modules/xml/parser/...
Date Mon, 21 Nov 2005 03:57:03 GMT
Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_pull_parser.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_pull_parser.c?rev=345821&r1=345820&r2=345821&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_pull_parser.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_pull_parser.c Sun Nov 20 19:53:26 2005
@@ -18,6 +18,7 @@
  */
 
 #include "guththila_xml_pull_parser.h"
+#include "guththila_string.h"
 
 static int
 guththila_is_space (int c)
@@ -31,10 +32,9 @@
                                   guththila_reader_t * r)
 {
     guththila_xml_pull_parser_t *parser =
-        (guththila_xml_pull_parser_t *) guththila_malloc (environment->
-                                                          allocator,
-                                                          sizeof
-                                                          (guththila_xml_pull_parser_t));
+        (guththila_xml_pull_parser_t *) GUTHTHILA_MALLOC (
+                environment->allocator, sizeof (guththila_xml_pull_parser_t));
+                
     parser->buffer = guththila_buffer_create (environment, 1024);
     parser->stack = guththila_stack_create (environment);
     parser->attrib = guththila_stack_create (environment);
@@ -61,7 +61,7 @@
     if (parser->buffer)
         guththila_buffer_free (environment, (void *) parser->buffer);
     if (parser->reader)
-        guththila_free (environment->allocator, parser->reader);
+        GUTHTHILA_FREE (environment->allocator, parser->reader);
     if (parser->stack)
         guththila_stack_free (environment, parser->stack);
     if (parser->attrib)
@@ -70,7 +70,7 @@
         guththila_stack_free (environment, parser->namesp);
     if (parser->dep)
         guththila_stack_free (environment, parser->dep);
-    guththila_free (environment->allocator, (void *) parser);
+    GUTHTHILA_FREE (environment->allocator, (void *) parser);
 }
 
 
@@ -89,12 +89,12 @@
 
 
 void
-guththila_xml_pull_parser_relocate_tokens (guththila_environment_t *
-                                           environment,
-                                           guththila_xml_pull_parser_t *
-                                           parser, int offset)
+guththila_xml_pull_parser_relocate_tokens 
+                        (guththila_environment_t *environment,
+                         guththila_xml_pull_parser_t *parser,
+                         int offset)
 {
-    guththila_element_t *el;
+    guththila_element_t *el = NULL;
     int isize;
     isize = guththila_stack_size (environment, parser->stack);
     el = guththila_stack_last (environment, parser->stack);
@@ -133,14 +133,12 @@
         }
         else
         {
-            guththila_buffer_t *b;
+            guththila_buffer_t *b = NULL;
             b = parser->buffer;
             parser->buffer =
                 guththila_buffer_grow (environment, parser->buffer);
-            guththila_xml_pull_parser_relocate_tokens (environment, parser,
-                                                       (b->size -
-                                                        parser->buffer->
-                                                        size));
+            guththila_xml_pull_parser_relocate_tokens (
+                environment, parser,  (b->size - parser->buffer->size));
         }
     }
     c = guththila_reader_read (environment, (parser->buffer->buff),
@@ -238,7 +236,7 @@
                                       guththila_xml_pull_parser_t * parser)
 {
     guththila_token_t *t =
-        (guththila_token_t *) guththila_malloc (environment->allocator,
+        (guththila_token_t *) GUTHTHILA_MALLOC (environment->allocator,
                                                 sizeof (guththila_token_t));
     t->type = Unknown;
     t->start = guththila_xml_pull_parser_last_char (environment, parser);
@@ -987,7 +985,7 @@
 {
     int ii;
     guththila_depth_t *m =
-        (guththila_depth_t *) guththila_malloc (environment->allocator,
+        (guththila_depth_t *) GUTHTHILA_MALLOC (environment->allocator,
                                                 sizeof (guththila_depth_t));
     guththila_depth_t *l = NULL;
     guththila_element_t *e;
@@ -1053,7 +1051,7 @@
 {
     guththila_attribute_t *att;
     att =
-        (guththila_attribute_t *) guththila_malloc (environment->allocator,
+        (guththila_attribute_t *) GUTHTHILA_MALLOC (environment->allocator,
                                                     sizeof
                                                     (guththila_attribute_t));
     att->name = name;
@@ -1076,7 +1074,7 @@
 {
     guththila_attribute_t *att;
     att =
-        (guththila_attribute_t *) guththila_malloc (environment->allocator,
+        (guththila_attribute_t *) GUTHTHILA_MALLOC (environment->allocator,
                                                     sizeof
                                                     (guththila_attribute_t));
     att->name = name;
@@ -1095,15 +1093,15 @@
                                          guththila_token_t * uri)
 {
     guththila_namespace_t *ns;
-    ns = (guththila_namespace_t *) guththila_malloc (environment->allocator,
+    ns = (guththila_namespace_t *) GUTHTHILA_MALLOC (environment->allocator,
                                                      sizeof
                                                      (guththila_namespace_t));
     ns->name =
         guththila_token_to_string (environment, name, parser->unicode_state);
-    ns->length = guththila_strlen (environment->string, ns->name);
+    ns->length = GUTHTHILA_STRLEN ( ns->name);
     ns->uri =
         guththila_token_to_string (environment, uri, parser->unicode_state);
-    ns->lengthuri = guththila_strlen (environment->string, ns->uri);
+    ns->lengthuri = GUTHTHILA_STRLEN ( ns->uri);
     guththila_stack_push_namespace (environment, parser->namesp, ns);
 }
 
@@ -1323,7 +1321,7 @@
                                                 guththila_namespace_t * ns)
 {
     if (ns)
-        return guththila_strdup (environment->string, ns->name);
+        return GUTHTHILA_STRDUP (environment , ns->name);
     else
         return NULL;
 }
@@ -1337,7 +1335,7 @@
                                              guththila_namespace_t * ns)
 {
     if (ns)
-        return guththila_strdup (environment->string, ns->uri);
+        return GUTHTHILA_STRDUP (environment, ns->uri);
     else
         return NULL;
 }
@@ -1358,7 +1356,7 @@
         if (e->namespace)
             ns = e->namespace;
     }
-    return guththila_strdup (environment->string, ns->name);
+    return GUTHTHILA_STRDUP (environment, ns->name);
 }
 
 
@@ -1379,7 +1377,7 @@
         if (e->namespace)
             ns = e->namespace;
     }
-    return guththila_strdup (environment->string, ns->uri);
+    return GUTHTHILA_STRDUP (environment , ns->uri);
 }
 
 
@@ -1405,9 +1403,9 @@
             {
                 ns = e->namespace;
                 if (!
-                    (guththila_strcmp
-                     (environment->string, ns->name, att_prefix)))
-                    return guththila_strdup (environment->string, ns->uri);
+                    (GUTHTHILA_STRCMP
+                     ( ns->name, att_prefix)))
+                    return GUTHTHILA_STRDUP (environment , ns->uri);
             }
         }
     }

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_pull_parser.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_pull_parser.h?rev=345821&r1=345820&r2=345821&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_pull_parser.h (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_pull_parser.h Sun Nov 20 19:53:26 2005
@@ -63,6 +63,7 @@
     GUTHTHILA_ENTITY_REFERANCE,
     GUTHTHILA_COMMENT
 };
+
 enum guththila_event_types guththila_event;
 
 
@@ -88,206 +89,278 @@
 GUTHTHILA_DECLARE (int)
 guththila_xml_pull_parser_read (guththila_environment_t * environment,
                                 guththila_xml_pull_parser_t * p);
-     int guththila_xml_pull_parser_next_char (guththila_environment_t *
-                                              environment,
+                                
+int 
+guththila_xml_pull_parser_next_char (guththila_environment_t *environment,
+                                         guththila_xml_pull_parser_t * p,
+                                         int eof);
+
+int 
+guththila_xml_pull_parser_tokenize (guththila_environment_t *environment,
+                                        guththila_xml_pull_parser_t * p);
+                                        
+                                        
+int 
+guththila_xml_pull_parser_exception (guththila_char_t * s, int line);
+
+int 
+guththila_xml_pull_parser_skip_spaces (guththila_environment_t *environment,
+                                           guththila_xml_pull_parser_t *p,
+                                           int c);
+                                           
+int 
+guththila_xml_pull_parser_process_xml_decl(guththila_environment_t *environment,
+                                            guththila_xml_pull_parser_t * p);
+                                            
+int 
+guththila_xml_pull_parser_process_version_info(guththila_environment_t * environment,
+                                               guththila_xml_pull_parser_t * p);
+                                               
+                                               
+int 
+guththila_xml_pull_parser_process_encoding_decl (guththila_environment_t * environment,
+                                                 guththila_xml_pull_parser_t * p);
+                                                 
+int 
+guththila_xml_pull_parser_process_sd_decl (guththila_environment_t *environment,
+                                           guththila_xml_pull_parser_t *p);
+                                           
+void 
+guththila_xml_pull_parser_open_token (guththila_environment_t *environment,
+                                      guththila_xml_pull_parser_t *p);
+                                      
+void 
+guththila_xml_pull_parser_close_token (guththila_environment_t *environment,
+                                       guththila_xml_pull_parser_t *p,
+                                       int t,
+                                       int refer);
+                                       
+guththila_char_t *
+guththila_xml_pull_parser_last_char (guththila_environment_t *environment,
+                                     guththila_xml_pull_parser_t *p);
+                                     
+int 
+guththila_xml_pull_parser_process_eq (guththila_environment_t *environment,
+                                      guththila_xml_pull_parser_t *p,
+                                      int c);
+                                      
+void 
+guththila_xml_pull_parser_add_attribute (guththila_environment_t *environment,
+                                         guththila_xml_pull_parser_t *p,
+                                         guththila_token_t * name,
+                                         guththila_token_t * value);
+                                         
+void 
+guththila_xml_pull_parser_add_attribute_with_prefix
+                                        (guththila_environment_t *environment,
+                                         guththila_xml_pull_parser_t *p,
+                                         guththila_token_t * prefix,
+                                         guththila_token_t * name,
+                                         guththila_token_t * value);
+                                         
+int 
+guththila_xml_pull_parser_process_char_data (guththila_environment_t *environment,
+                                             guththila_xml_pull_parser_t *p);
+                                             
+int 
+guththila_xml_pull_parser_process_space_tag_or_empty_element
+                                            (guththila_environment_t * environment,
+                                             guththila_xml_pull_parser_t *p);
+                                             
+int 
+guththila_xml_pull_parser_process_comment (guththila_environment_t *environment,
+                                           guththila_xml_pull_parser_t *p);
+                                           
+int 
+guththila_xml_pull_parser_process_pi (guththila_environment_t *environment,
+                                      guththila_xml_pull_parser_t *p);
+                                      
+int 
+guththila_xml_pull_parser_process_empty_tag (guththila_environment_t *environment,
+                                             guththila_xml_pull_parser_t *p);
+                                             
+void 
+guththila_xml_pull_parser_reset (guththila_environment_t *environment,
+                                 guththila_xml_pull_parser_t * p);
+                                 
+int 
+guththila_xml_pull_parser_process_name (guththila_environment_t *environment,
+                                        guththila_xml_pull_parser_t *p);
+                                        
+int 
+guththila_xml_pull_parser_process_attribute (guththila_environment_t  *environment,
+                                             guththila_xml_pull_parser_t *p,
+                                             int c);
+                                             
+int 
+guththila_xml_pull_parser_process_attribute_value
+                                             (guththila_environment_t * environment,
                                               guththila_xml_pull_parser_t * p,
-                                              int eof);
-     int guththila_xml_pull_parser_tokenize (guththila_environment_t *
-                                             environment,
-                                             guththila_xml_pull_parser_t * p);
-     int guththila_xml_pull_parser_exception (guththila_char_t * s, int line);
-     int guththila_xml_pull_parser_skip_spaces (guththila_environment_t *
-                                                environment,
-                                                guththila_xml_pull_parser_t *
-                                                p, int c);
-     int guththila_xml_pull_parser_process_xml_decl (guththila_environment_t *
-                                                     environment,
-                                                     guththila_xml_pull_parser_t
-                                                     * p);
-     int guththila_xml_pull_parser_process_version_info
-         (guththila_environment_t * environment,
-          guththila_xml_pull_parser_t * p);
-     int guththila_xml_pull_parser_process_encoding_decl
-         (guththila_environment_t * environment,
-          guththila_xml_pull_parser_t * p);
-     int guththila_xml_pull_parser_process_sd_decl (guththila_environment_t *
-                                                    environment,
-                                                    guththila_xml_pull_parser_t
-                                                    * p);
-     void guththila_xml_pull_parser_open_token (guththila_environment_t *
-                                                environment,
-                                                guththila_xml_pull_parser_t *
-                                                p);
-     void guththila_xml_pull_parser_close_token (guththila_environment_t *
-                                                 environment,
-                                                 guththila_xml_pull_parser_t *
-                                                 p, int t, int refer);
-     guththila_char_t
-         *guththila_xml_pull_parser_last_char (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_pull_parser_t *
-                                               p);
-     int guththila_xml_pull_parser_process_eq (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_pull_parser_t *
-                                               p, int c);
-     void guththila_xml_pull_parser_add_attribute (guththila_environment_t *
-                                                   environment,
-                                                   guththila_xml_pull_parser_t
-                                                   * p,
-                                                   guththila_token_t * name,
-                                                   guththila_token_t * value);
-     void guththila_xml_pull_parser_add_attribute_with_prefix
-         (guththila_environment_t * environment,
-          guththila_xml_pull_parser_t * p, guththila_token_t * prefix,
-          guththila_token_t * name, guththila_token_t * value);
-     int guththila_xml_pull_parser_process_char_data (guththila_environment_t
-                                                      * environment,
-                                                      guththila_xml_pull_parser_t
-                                                      * p);
-     int guththila_xml_pull_parser_process_space_tag_or_empty_element
-         (guththila_environment_t * environment,
-          guththila_xml_pull_parser_t * p);
-     int guththila_xml_pull_parser_process_comment (guththila_environment_t *
-                                                    environment,
-                                                    guththila_xml_pull_parser_t
-                                                    * p);
-     int guththila_xml_pull_parser_process_pi (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_pull_parser_t *
-                                               p);
-     int guththila_xml_pull_parser_process_empty_tag (guththila_environment_t
-                                                      * environment,
-                                                      guththila_xml_pull_parser_t
-                                                      * p);
-     void guththila_xml_pull_parser_reset (guththila_environment_t *
-                                           environment,
-                                           guththila_xml_pull_parser_t * p);
-     int guththila_xml_pull_parser_process_name (guththila_environment_t *
-                                                 environment,
-                                                 guththila_xml_pull_parser_t *
-                                                 p);
-     int guththila_xml_pull_parser_process_attribute (guththila_environment_t
-                                                      * environment,
-                                                      guththila_xml_pull_parser_t
-                                                      * p, int c);
-     int guththila_xml_pull_parser_process_attribute_value
-         (guththila_environment_t * environment,
-          guththila_xml_pull_parser_t * p, int c);
-     int guththila_xml_pull_parser_is_space (guththila_environment_t *
-                                             environment, int c);
-     void guththila_xml_pull_parser_relocate_tokens (guththila_environment_t *
-                                                     environment,
-                                                     guththila_xml_pull_parser_t
-                                                     * p, int offset);
-     void guththila_xml_pull_parser_shift (guththila_environment_t *
-                                           environment,
-                                           guththila_xml_pull_parser_t * p);
-     void guththila_xml_pull_parser_add_namespace (guththila_environment_t *
-                                                   environment,
-                                                   guththila_xml_pull_parser_t
-                                                   * p,
-                                                   guththila_token_t * name,
-                                                   guththila_token_t * uri);
-     void guththila_xml_pull_parser_open_element (guththila_environment_t *
-                                                  environment,
-                                                  guththila_xml_pull_parser_t
-                                                  * p);
-     void guththila_xml_pull_parser_close_element (guththila_environment_t *
-                                                   environment,
-                                                   guththila_xml_pull_parser_t
-                                                   * p);
-     int guththila_xml_pull_parser_from_utf16 (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_pull_parser_t *
-                                               p, int eof);
-     int guththila_xml_pull_parser_is_valid_starting_char
-         (guththila_environment_t * environment,
-          guththila_xml_pull_parser_t * p, int c);
+                                              int c);
+                                              
+                                              
+int 
+guththila_xml_pull_parser_is_space (guththila_environment_t *environment, int c);
+
+
+void 
+guththila_xml_pull_parser_relocate_tokens (guththila_environment_t *environment,
+                                           guththila_xml_pull_parser_t *p,
+                                           int offset);
+                                           
+void 
+guththila_xml_pull_parser_shift (guththila_environment_t *environment,
+                                 guththila_xml_pull_parser_t * p);
+                                 
+void 
+guththila_xml_pull_parser_add_namespace (guththila_environment_t *environment,
+                                         guththila_xml_pull_parser_t *p,
+                                         guththila_token_t * name,
+                                         guththila_token_t * uri);
+                                         
+void 
+guththila_xml_pull_parser_open_element (guththila_environment_t *environment,
+                                        guththila_xml_pull_parser_t *p);
+                                        
+void 
+guththila_xml_pull_parser_close_element (guththila_environment_t *environment,
+                                         guththila_xml_pull_parser_t *p);
+                                         
+int 
+guththila_xml_pull_parser_from_utf16 (guththila_environment_t *environment,
+                                      guththila_xml_pull_parser_t *p,
+                                      int eof);
+                                      
+int 
+guththila_xml_pull_parser_is_valid_starting_char 
+                                        (guththila_environment_t * environment,
+                                         guththila_xml_pull_parser_t * p,
+                                         int c);
+                                         
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_pull_parser_next (guththila_environment_t * environment,
                                 guththila_xml_pull_parser_t * p);
+                                
 GUTHTHILA_DECLARE (guththila_xml_pull_parser_t *)
 guththila_xml_pull_parser_create (guththila_environment_t * environment,
                                   guththila_reader_t * r);
+                                  
 GUTHTHILA_DECLARE (void)
 guththila_xml_pull_parser_free (guththila_environment_t * environment,
                                 guththila_xml_pull_parser_t * parser);
+                                
 GUTHTHILA_DECLARE (int)
-guththila_xml_pull_parser_get_attribute_count (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_pull_parser_t *
-                                               p);
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_attribute_name (guththila_environment_t *
-                                              environment,
-                                              guththila_xml_pull_parser_t * p,
-                                              guththila_attribute_t * att);
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_attribute_value (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_pull_parser_t *
-                                               p,
-                                               guththila_attribute_t * att);
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_attribute_prefix (guththila_environment_t *
-                                                environment,
-                                                guththila_xml_pull_parser_t *
-                                                p,
-                                                guththila_attribute_t * att);
+guththila_xml_pull_parser_get_attribute_count 
+                                (guththila_environment_t * environment,
+                                 guththila_xml_pull_parser_t *p);
+                                 
+                                 
+GUTHTHILA_DECLARE (guththila_char_t *)
+guththila_xml_pull_parser_get_attribute_name 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_pull_parser_t * p,
+                                 guththila_attribute_t * att);
+                                 
+                                 
+GUTHTHILA_DECLARE (guththila_char_t *)
+guththila_xml_pull_parser_get_attribute_value 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_pull_parser_t *p,
+                                 guththila_attribute_t * att);
+                                 
+                                 
+GUTHTHILA_DECLARE (guththila_char_t *)
+guththila_xml_pull_parser_get_attribute_prefix 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_pull_parser_t *p,
+                                 guththila_attribute_t * att);
+                                 
+                                 
 GUTHTHILA_DECLARE (guththila_attribute_t *)
-guththila_xml_pull_parser_get_attribute (guththila_environment_t *
-                                         environment,
+guththila_xml_pull_parser_get_attribute (guththila_environment_t *environment,
                                          guththila_xml_pull_parser_t * p);
+                                         
+                                         
 GUTHTHILA_DECLARE (guththila_char_t *)
 guththila_xml_pull_parser_get_attribute_name_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * p, int i);
+                                        (guththila_environment_t * environment,
+                                         guththila_xml_pull_parser_t * p,
+                                         int i);
+                                         
+                                         
 GUTHTHILA_DECLARE (guththila_char_t *)
 guththila_xml_pull_parser_get_attribute_value_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * p, int i);
+                                        (guththila_environment_t * environment,
+                                         guththila_xml_pull_parser_t * p,
+                                         int i);
+                                         
+                                         
 GUTHTHILA_DECLARE (guththila_char_t *)
 guththila_xml_pull_parser_get_attribute_prefix_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * p, int i);
+                                        (guththila_environment_t * environment,
+                                         guththila_xml_pull_parser_t * p,
+                                         int i);
+                                         
+                                         
 GUTHTHILA_DECLARE (guththila_char_t *)
 guththila_xml_pull_parser_get_name (guththila_environment_t * environment,
                                     guththila_xml_pull_parser_t * p);
+                                    
+                                    
 GUTHTHILA_DECLARE (guththila_char_t *)
 guththila_xml_pull_parser_get_prefix (guththila_environment_t * environment,
                                       guththila_xml_pull_parser_t * p);
+                                      
+                                      
 GUTHTHILA_DECLARE (guththila_char_t *)
 guththila_xml_pull_parser_get_value (guththila_environment_t * environment,
                                      guththila_xml_pull_parser_t * p);
+                                     
+                                     
 GUTHTHILA_DECLARE (guththila_namespace_t *)
-guththila_xml_pull_parser_get_namespace (guththila_environment_t *
-                                         environment,
+guththila_xml_pull_parser_get_namespace (guththila_environment_t *environment,
                                          guththila_xml_pull_parser_t * p);
+                                         
+                                         
 GUTHTHILA_DECLARE (int)
-guththila_xml_pull_parser_get_namespace_count (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_pull_parser_t *
-                                               p);
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_namespace_uri (guththila_environment_t *
-                                             environment,
-                                             guththila_xml_pull_parser_t * p,
-                                             guththila_namespace_t * ns);
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_namespace_prefix (guththila_environment_t *
-                                                environment,
-                                                guththila_xml_pull_parser_t *
-                                                p,
-                                                guththila_namespace_t * ns);
+guththila_xml_pull_parser_get_namespace_count 
+                                        (guththila_environment_t *environment,
+                                         guththila_xml_pull_parser_t *p);
+                                         
+                                         
+GUTHTHILA_DECLARE (guththila_char_t *)
+guththila_xml_pull_parser_get_namespace_uri 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_pull_parser_t * p,
+                                 guththila_namespace_t * ns);
+                                             
+                                             
+GUTHTHILA_DECLARE (guththila_char_t *)
+guththila_xml_pull_parser_get_namespace_prefix 
+                                    (guththila_environment_t *environment,
+                                     guththila_xml_pull_parser_t *p,
+                                     guththila_namespace_t * ns);
+                                     
+                                     
 GUTHTHILA_DECLARE (guththila_char_t *)
 guththila_xml_pull_parser_get_namespace_prefix_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * p, int i);
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_namespace_uri_by_number (guththila_environment_t
-                                                       * environment,
-                                                       guththila_xml_pull_parser_t
-                                                       * p, int i);
+                                    (guththila_environment_t * environment,
+                                     guththila_xml_pull_parser_t * p,
+                                     int i);
+                                     
+                                     
+GUTHTHILA_DECLARE (guththila_char_t *)
+guththila_xml_pull_parser_get_namespace_uri_by_number 
+                                      (guththila_environment_t *environment,
+                                       guththila_xml_pull_parser_t * p,
+                                       int i);
+                                       
+                                       
 GUTHTHILA_DECLARE (guththila_char_t *)
 guththila_xml_pull_parser_get_attribute_namespace_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * p, int i);
+                                      (guththila_environment_t * environment,
+                                       guththila_xml_pull_parser_t * p,
+                                       int i);
 
 #endif /* GUTHTHILA_XML_PULL_PARSER_H */

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c?rev=345821&r1=345820&r2=345821&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c Sun Nov 20 19:53:26 2005
@@ -18,6 +18,7 @@
 #include "guththila_xml_stream_writer.h"
 #include "guththila_array.h"
 #include "guththila_hash.h"
+#include "guththila_string.h"
 
 
 struct guththila_xml_stream_writer
@@ -44,13 +45,14 @@
         return 0;
 
     stream_writer =
-        (guththila_xml_stream_writer_t *) guththila_malloc (environment->
-                                                            allocator,
-                                                            sizeof
-                                                            (guththila_xml_stream_writer_t));
-    stream_writer->writer = writer;
+        (guththila_xml_stream_writer_t *) GUTHTHILA_MALLOC (environment->allocator,
+                                          sizeof(guththila_xml_stream_writer_t));
+    stream_writer->writer = stdout;
+    stream_writer->encoding = NULL;
     if (encoding)
-        stream_writer->encoding = encoding;
+        stream_writer->encoding = GUTHTHILA_STRDUP(environment, encoding);
+   
+        
     stream_writer->prefix_defaulting = prefix_defaulting;
 
 
@@ -67,10 +69,9 @@
 }
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_end_start_element (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_stream_writer_t *
-                                               stream_writer)
+guththila_xml_stream_writer_end_start_element 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer)
 {
     guththila_char_t ***del_element;
     if (!stream_writer)
@@ -86,15 +87,14 @@
 
         /*pop last element and delete that elelemt */
         del_element =
-            (guththila_char_t ***) guththila_array_pop (stream_writer->
-                                                        element_stack);
+            (guththila_char_t ***) guththila_array_pop (stream_writer->element_stack);
         if (del_element)
         {
             if ((*del_element)[0])
-                guththila_free (environment->allocator, (*del_element)[0]);
+                GUTHTHILA_FREE (environment->allocator, (*del_element)[0]);
             if ((*del_element)[1])
-                guththila_free (environment->allocator, (*del_element)[1]);
-            guththila_free (environment->allocator, del_element);
+                GUTHTHILA_FREE (environment->allocator, (*del_element)[1]);
+            GUTHTHILA_FREE (environment->allocator, del_element);
         }
         del_element = 0;
 
@@ -110,34 +110,30 @@
 }
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_start_element (guththila_environment_t *
-                                                 environment,
-                                                 guththila_xml_stream_writer_t
-                                                 * stream_writer,
-                                                 guththila_char_t *
-                                                 local_name)
+guththila_xml_stream_writer_write_start_element 
+                (guththila_environment_t *environment,
+                 guththila_xml_stream_writer_t *stream_writer,
+                 guththila_char_t *local_name)
 {
     guththila_char_t ***new_element;
     if (!stream_writer)
         return GUTHTHILA_STREAM_WRITER_ERROR_STREAM_STRUCT_NULL;
     if (!local_name)
         return GUTHTHILA_STREAM_WRITER_ERROR_LOCAL_NAME_NULL;
-    guththila_xml_stream_writer_end_start_element (environment,
-                                                   stream_writer);
+    guththila_xml_stream_writer_end_start_element (environment, stream_writer);
+    
     /*namespaces.pushContext(); */
     fputs ("<", stream_writer->writer);
     fputs (local_name, stream_writer->writer);
 
     /*push element to stack */
     new_element =
-        (guththila_char_t ***) guththila_array_push (stream_writer->
-                                                     element_stack);
+        (guththila_char_t ***) guththila_array_push (stream_writer->element_stack);
     *new_element =
-        (guththila_char_t **) guththila_malloc (environment->allocator,
-                                                sizeof (guththila_char_t **) *
-                                                2);
+        (guththila_char_t **) GUTHTHILA_MALLOC (environment->allocator,
+                                        sizeof (guththila_char_t **) *2);
     (*new_element)[0] = 0;
-    (*new_element)[1] = guththila_strdup (environment->string, local_name);
+    (*new_element)[1] = GUTHTHILA_STRDUP (environment, local_name);
     /*end push element */
 
     stream_writer->in_start_element = 1;
@@ -148,8 +144,10 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_start_element_with_namespace
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * local_name, guththila_char_t * namespace_uri)
+                               (guththila_environment_t * environment,
+                                guththila_xml_stream_writer_t * stream_writer,
+                                guththila_char_t * local_name,
+                                guththila_char_t * namespace_uri)
 {
     int is_declared;
     guththila_char_t ***new_element;
@@ -181,7 +179,7 @@
 
     fputs ("<", stream_writer->writer);
 
-    if (prefix && guththila_strlen (environment->string, prefix) != 0)
+    if (prefix && GUTHTHILA_STRLEN ( prefix) != 0)
     {
         fputs (prefix, stream_writer->writer);
         fputs (":", stream_writer->writer);
@@ -203,14 +201,14 @@
         (guththila_char_t ***) guththila_array_push (stream_writer->
                                                      element_stack);
     *new_element =
-        (guththila_char_t **) guththila_malloc (environment->allocator,
+        (guththila_char_t **) GUTHTHILA_MALLOC (environment->allocator,
                                                 sizeof (guththila_char_t **) *
                                                 2);
     if (prefix)
-        (*new_element)[0] = guththila_strdup (environment->string, prefix);
+        (*new_element)[0] = GUTHTHILA_STRDUP (environment, prefix);
     else
         (*new_element)[0] = 0;
-    (*new_element)[1] = guththila_strdup (environment->string, local_name);
+    (*new_element)[1] = GUTHTHILA_STRDUP (environment, local_name);
     /*end push element */
 
     stream_writer->in_start_element = 1;
@@ -220,8 +218,11 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_start_element_with_namespace_prefix
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * local_name, guththila_char_t * namespace_uri, guththila_char_t * prefix)
+                        (guththila_environment_t * environment,
+                         guththila_xml_stream_writer_t * stream_writer,
+                         guththila_char_t * local_name,
+                         guththila_char_t * namespace_uri,
+                         guththila_char_t * prefix)
 {
     guththila_char_t *current_prefix;
     int is_current = 0;
@@ -244,11 +245,11 @@
 
     if (current_prefix)
         is_current =
-            (guththila_strcmp (environment->string, prefix, current_prefix) !=
+            (GUTHTHILA_STRCMP ( prefix, current_prefix) !=
              0);
     fputs ("<", stream_writer->writer);
 
-    if (prefix && guththila_strlen (environment->string, prefix) != 0)
+    if (prefix && GUTHTHILA_STRLEN ( prefix) != 0)
     {
         fputs (prefix, stream_writer->writer);
         fputs (":", stream_writer->writer);
@@ -272,14 +273,14 @@
                                                      element_stack);
 
     *new_element =
-        (guththila_char_t **) guththila_malloc (environment->allocator,
+        (guththila_char_t **) GUTHTHILA_MALLOC (environment->allocator,
                                                 sizeof (guththila_char_t **) *
                                                 2);
     if (prefix)
-        (*new_element)[0] = guththila_strdup (environment->string, prefix);
+        (*new_element)[0] = GUTHTHILA_STRDUP (environment, prefix);
     else
         (*new_element)[0] = 0;
-    (*new_element)[1] = guththila_strdup (environment->string, local_name);
+    (*new_element)[1] = GUTHTHILA_STRDUP (environment, local_name);
     /*end push element */
 
     stream_writer->in_start_element = 1;
@@ -289,12 +290,10 @@
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_empty_element (guththila_environment_t *
-                                                 environment,
-                                                 guththila_xml_stream_writer_t
-                                                 * stream_writer,
-                                                 guththila_char_t *
-                                                 local_name)
+guththila_xml_stream_writer_write_empty_element 
+                        (guththila_environment_t *environment,
+                         guththila_xml_stream_writer_t *stream_writer,
+                         guththila_char_t *local_name)
 {
     int ret =
         guththila_xml_stream_writer_write_start_element (environment,
@@ -311,8 +310,10 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_empty_element_with_namespace
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * local_name, guththila_char_t * namespace_uri)
+                    (guththila_environment_t * environment,
+                     guththila_xml_stream_writer_t * stream_writer,
+                     guththila_char_t * local_name,
+                     guththila_char_t * namespace_uri)
 {
     int ret =
         guththila_xml_stream_writer_write_start_element_with_namespace
@@ -328,8 +329,11 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_empty_element_with_namespace_prefix
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * local_name, guththila_char_t * namespace_uri, guththila_char_t * prefix)
+                    (guththila_environment_t * environment, 
+                     guththila_xml_stream_writer_t * stream_writer,
+                     guththila_char_t * local_name, 
+                     guththila_char_t * namespace_uri,
+                     guththila_char_t * prefix)
 {
     int ret =
         guththila_xml_stream_writer_write_start_element_with_namespace_prefix
@@ -344,10 +348,9 @@
 }
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_end_element (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_stream_writer_t *
-                                               stream_writer)
+guththila_xml_stream_writer_write_end_element 
+                        (guththila_environment_t *environment,
+                         guththila_xml_stream_writer_t *stream_writer)
 {
     guththila_char_t ***element_data;
     guththila_xml_stream_writer_end_start_element (environment,
@@ -366,18 +369,18 @@
     fputs ("</", stream_writer->writer);
 
     if ((*element_data)[0]
-        && guththila_strlen (environment->string, (*element_data)[0]) > 0)
+        && GUTHTHILA_STRLEN ((*element_data)[0]) > 0)
     {
         fputs ((*element_data)[0], stream_writer->writer);
         fputs (":", stream_writer->writer);
-        free ((*element_data)[0]);
+        GUTHTHILA_FREE(environment->allocator ,((*element_data)[0]));
     }
 
     if ((*element_data)[1]
-        && guththila_strlen (environment->string, (*element_data)[1]) > 0)
+        && GUTHTHILA_STRLEN ((*element_data)[1]) > 0)
     {
         fputs ((*element_data)[1], stream_writer->writer);
-        free ((*element_data)[1]);
+        GUTHTHILA_FREE(environment->allocator ,((*element_data)[1]));
     }
     else
         return
@@ -392,10 +395,9 @@
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_end_document (guththila_environment_t *
-                                                environment,
-                                                guththila_xml_stream_writer_t
-                                                * stream_writer)
+guththila_xml_stream_writer_write_end_document 
+                        (guththila_environment_t *environment,
+                         guththila_xml_stream_writer_t *stream_writer)
 {
     while (!guththila_is_empty_array (stream_writer->element_stack))
     {
@@ -411,12 +413,11 @@
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_attribute (guththila_environment_t *
-                                             environment,
-                                             guththila_xml_stream_writer_t *
-                                             stream_writer,
-                                             guththila_char_t * local_name,
-                                             guththila_char_t * value)
+guththila_xml_stream_writer_write_attribute 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * local_name,
+                             guththila_char_t * value)
 {
     if (!stream_writer->in_start_element)
         return GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_STATE;
@@ -434,8 +435,11 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_attribute_with_namespace
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * local_name, guththila_char_t * value, guththila_char_t * namespace_uri)
+                        (guththila_environment_t * environment, 
+                         guththila_xml_stream_writer_t * stream_writer,
+                         guththila_char_t * local_name,
+                         guththila_char_t * value, 
+                         guththila_char_t * namespace_uri)
 {
     guththila_char_t *prefix;
     if (!stream_writer->in_start_element)
@@ -461,7 +465,7 @@
 
     fputs (" ", stream_writer->writer);
 
-    if (prefix && guththila_strlen (environment->string, prefix) > 0)
+    if (prefix && GUTHTHILA_STRLEN (prefix) > 0)
     {
         fputs (prefix, stream_writer->writer);
         fputs (":", stream_writer->writer);
@@ -477,9 +481,12 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_attribute_with_namespace_prefix
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * local_name, guththila_char_t * value, guththila_char_t * namespace_uri,
-guththila_char_t * prefix)
+                    (guththila_environment_t * environment, 
+                     guththila_xml_stream_writer_t * stream_writer,
+                     guththila_char_t * local_name, 
+                     guththila_char_t * value, 
+                     guththila_char_t * namespace_uri,
+                     guththila_char_t * prefix)
 {
     guththila_char_t *current_prefix;
     if (!stream_writer->in_start_element)
@@ -499,14 +506,14 @@
             return
                 GUTHTHILA_STREAM_WRITER_ERROR_guththila_namespace_t_NOT_DECLARED;
     }
-    else if (guththila_strcmp (environment->string, current_prefix, prefix) !=
+    else if (GUTHTHILA_STRCMP (current_prefix, prefix) !=
              0)
         return
             GUTHTHILA_STREAM_WRITER_ERROR_guththila_namespace_t_NOT_DECLARED;
 
     fputs (" ", stream_writer->writer);
 
-    if (prefix && guththila_strlen (environment->string, prefix) > 0)
+    if (prefix && GUTHTHILA_STRLEN ( prefix) > 0)
     {
         fputs (prefix, stream_writer->writer);
         fputs (":", stream_writer->writer);
@@ -521,12 +528,11 @@
 }
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_namespace (guththila_environment_t *
-                                             environment,
-                                             guththila_xml_stream_writer_t *
-                                             stream_writer,
-                                             guththila_char_t * prefix,
-                                             guththila_char_t * namespace_uri)
+guththila_xml_stream_writer_write_namespace 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * prefix,
+                             guththila_char_t * namespace_uri)
 {
     guththila_char_t *declared_prefix;
     if (!stream_writer->in_start_element)
@@ -539,8 +545,7 @@
         guththila_xml_stream_writer_get_prefix (environment, stream_writer,
                                                 namespace_uri);
     if (declared_prefix
-        && guththila_strcmp (environment->string, prefix,
-                             declared_prefix) == 0)
+        && GUTHTHILA_STRCMP ( prefix,  declared_prefix) == 0)
         return GUTHTHILA_SUCCESS;
     guththila_xml_stream_writer_set_prefix (environment, stream_writer,
                                             prefix, namespace_uri);
@@ -548,8 +553,7 @@
     fputs (" ", stream_writer->writer);
     fputs ("xmlns", stream_writer->writer);
 
-    if (guththila_strcmp
-        (environment->string, GUTHTHILA_DEFAULT_NS_PREFIX, prefix) != 0)
+    if (GUTHTHILA_STRCMP ( GUTHTHILA_DEFAULT_NS_PREFIX, prefix) != 0)
     {
         fputs (":", stream_writer->writer);
         fputs (prefix, stream_writer->writer);
@@ -561,28 +565,23 @@
 }
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_default_namespace (guththila_environment_t *
-                                                     environment,
-                                                     guththila_xml_stream_writer_t
-                                                     * stream_writer,
-                                                     guththila_char_t *
-                                                     namespace_uri)
+guththila_xml_stream_writer_write_default_namespace 
+                        (guththila_environment_t *environment,
+                         guththila_xml_stream_writer_t *stream_writer,
+                         guththila_char_t *namespace_uri)
 {
     int ret =
         guththila_xml_stream_writer_write_namespace (environment,
-                                                     stream_writer,
-                                                     GUTHTHILA_DEFAULT_NS_PREFIX,
-                                                     namespace_uri);
+                stream_writer, GUTHTHILA_DEFAULT_NS_PREFIX, namespace_uri);
     return ret;
 }
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_comment (guththila_environment_t *
-                                           environment,
-                                           guththila_xml_stream_writer_t *
-                                           stream_writer,
-                                           guththila_char_t * data)
+guththila_xml_stream_writer_write_comment 
+                    (guththila_environment_t *environment,
+                     guththila_xml_stream_writer_t *stream_writer,
+                     guththila_char_t * data)
 {
     guththila_char_t *ptr;
     guththila_xml_stream_writer_end_start_element (environment,
@@ -610,8 +609,9 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_processing_instruction
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * target)
+                        (guththila_environment_t * environment, 
+                         guththila_xml_stream_writer_t * stream_writer,
+                         guththila_char_t * target)
 {
     int ret =
         guththila_xml_stream_writer_write_processing_instruction_data
@@ -621,8 +621,10 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_processing_instruction_data
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * target, guththila_char_t * data)
+                        (guththila_environment_t * environment, 
+                         guththila_xml_stream_writer_t * stream_writer,
+                         guththila_char_t * target, 
+                         guththila_char_t * data)
 {
     if (!target)
         return
@@ -647,11 +649,10 @@
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_cdata (guththila_environment_t *
-                                         environment,
-                                         guththila_xml_stream_writer_t *
-                                         stream_writer,
-                                         guththila_char_t * data)
+guththila_xml_stream_writer_write_cdata 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * data)
 {
     guththila_char_t *ptr;
     if (!data)
@@ -677,9 +678,10 @@
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_dtd (guththila_environment_t * environment,
-                                       guththila_xml_stream_writer_t *
-                                       stream_writer, guththila_char_t * dtd)
+guththila_xml_stream_writer_write_dtd 
+                        (guththila_environment_t * environment,
+                         guththila_xml_stream_writer_t *stream_writer,
+                         guththila_char_t * dtd)
 {
     if (!dtd)
         return GUTHTHILA_STREAM_WRITER_ERROR_DTD_NULL;
@@ -693,11 +695,10 @@
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_entity_ref (guththila_environment_t *
-                                              environment,
-                                              guththila_xml_stream_writer_t *
-                                              stream_writer,
-                                              guththila_char_t * name)
+guththila_xml_stream_writer_write_entity_ref 
+                    (guththila_environment_t *environment,
+                     guththila_xml_stream_writer_t *stream_writer,
+                     guththila_char_t * name)
 {
     if (!name)
         return GUTHTHILA_STREAM_WRITER_ERROR_ENTITY_REF_NULL;
@@ -714,10 +715,9 @@
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_start_document (guththila_environment_t *
-                                                  environment,
-                                                  guththila_xml_stream_writer_t
-                                                  * stream_writer)
+guththila_xml_stream_writer_write_start_document 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer)
 {
     int ret =
         guththila_xml_stream_writer_write_start_document_with_version_encoding
@@ -728,8 +728,9 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_start_document_with_version
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * version)
+                            (guththila_environment_t * environment, 
+                             guththila_xml_stream_writer_t * stream_writer,
+                             guththila_char_t * version)
 {
     int ret =
         guththila_xml_stream_writer_write_start_document_with_version_encoding
@@ -741,16 +742,18 @@
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_start_document_with_version_encoding
-(guththila_environment_t * environment, guththila_xml_stream_writer_t * stream_writer,
-guththila_char_t * encoding, guththila_char_t * version)
+                            (guththila_environment_t * environment, 
+                             guththila_xml_stream_writer_t * stream_writer,
+                             guththila_char_t * encoding,
+                             guththila_char_t * version)
 {
     if (!version)
         version = "1.0";
 
     encoding = "UTF-8";         /* The parameter is ignored */
 
-    if ((guththila_strcmp (environment->string, "1.0", version) != 0)
-        && (guththila_strcmp (environment->string, "1.1", version) != 0))
+    if ((GUTHTHILA_STRCMP ( "1.0", version) != 0)
+        && (GUTHTHILA_STRCMP ( "1.1", version) != 0))
         return GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_XML_VERSION;
 
     fputs ("<?xml version=\"", stream_writer->writer);
@@ -764,11 +767,10 @@
 }
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_characters (guththila_environment_t *
-                                              environment,
-                                              guththila_xml_stream_writer_t *
-                                              stream_writer,
-                                              guththila_char_t * text)
+guththila_xml_stream_writer_write_characters 
+                        (guththila_environment_t *environment,
+                         guththila_xml_stream_writer_t *stream_writer,
+                         guththila_char_t * text)
 {
     if (!text)
         return GUTHTHILA_STREAM_WRITER_ERROR_TEXT_NULL;
@@ -784,9 +786,10 @@
 }
 
 GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_stream_writer_get_prefix (guththila_environment_t * environment,
-                                        guththila_xml_stream_writer_t *
-                                        stream_writer, guththila_char_t * uri)
+guththila_xml_stream_writer_get_prefix 
+                                (guththila_environment_t * environment,
+                                 guththila_xml_stream_writer_t *stream_writer, 
+                                 guththila_char_t * uri)
 {
     guththila_char_t *prefix;
     if (!uri)
@@ -799,11 +802,11 @@
 }
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_set_prefix (guththila_environment_t * environment,
-                                        guththila_xml_stream_writer_t *
-                                        stream_writer,
-                                        guththila_char_t * prefix,
-                                        guththila_char_t * uri)
+guththila_xml_stream_writer_set_prefix 
+                            (guththila_environment_t * environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * prefix,
+                             guththila_char_t * uri)
 {
     if (!prefix)
         return GUTHTHILA_STREAM_WRITER_ERROR_PREFIX_NULL;
@@ -811,8 +814,8 @@
     if (!uri)
         return GUTHTHILA_STREAM_WRITER_ERROR_guththila_namespace_t_NULL;
 
-    if (guththila_strcmp (environment->string, prefix, "xml") == 0
-        || guththila_strcmp (environment->string, prefix, "xmlns") == 0)
+    if (GUTHTHILA_STRCMP ( prefix, "xml") == 0
+        || GUTHTHILA_STRCMP ( prefix, "xmlns") == 0)
         return GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_PREFIX;
 
     guththila_hash_set (stream_writer->namespace_hash, uri,
@@ -823,11 +826,10 @@
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_set_default_prefix (guththila_environment_t *
-                                                environment,
-                                                guththila_xml_stream_writer_t
-                                                * stream_writer,
-                                                guththila_char_t * uri)
+guththila_xml_stream_writer_set_default_prefix 
+                        (guththila_environment_t *environment,
+                         guththila_xml_stream_writer_t *stream_writer,
+                         guththila_char_t * uri)
 {
     return guththila_xml_stream_writer_set_prefix (environment, stream_writer,
                                                    GUTHTHILA_DEFAULT_NS_PREFIX,
@@ -836,12 +838,11 @@
 }
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_encoded (guththila_environment_t *
-                                           environment,
-                                           guththila_xml_stream_writer_t *
-                                           stream_writer,
-                                           guththila_char_t * text,
-                                           int in_attr)
+guththila_xml_stream_writer_write_encoded 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * text,
+                             int in_attr)
 {
     guththila_char_t *start;
     guththila_char_t *ptr;
@@ -857,12 +858,11 @@
         if (c == '<' || c == '>' || c == '&')
         {
             guththila_char_t *to_write =
-                guththila_strndup (environment->string, start,
-                                   (guththila_ssize_t) (ptr - start));
+                GUTHTHILA_STRNDUP (environment,  start,  (guththila_ssize_t) (ptr - start));
             if (to_write)
             {
                 fputs (to_write, stream_writer->writer);
-
+                GUTHTHILA_FREE(environment->allocator, to_write);
                 /*free (to_write); */
             }
             else
@@ -881,12 +881,12 @@
         else if (in_attr && (c == '"' || c == '\''))
         {
             guththila_char_t *to_write =
-                guththila_strndup (environment->string, start,
+                GUTHTHILA_STRNDUP (environment , start,
                                    (guththila_ssize_t) (ptr - start));
             if (to_write)
             {
                 fputs (to_write, stream_writer->writer);
-
+                GUTHTHILA_FREE(environment->allocator, to_write);
                 /*free (to_write); */
             }
             else
@@ -906,12 +906,12 @@
     if (ptr - start)
     {
         guththila_char_t *to_write =
-            guththila_strndup (environment->string, start,
+            GUTHTHILA_STRNDUP (environment, start,
                                (guththila_ssize_t) (ptr - start));
         if (to_write)
         {
             fputs (to_write, stream_writer->writer);
-
+            GUTHTHILA_FREE(environment->allocator, to_write);
             /*free (to_write); */
         }
         else
@@ -919,4 +919,26 @@
     }
 
     return GUTHTHILA_SUCCESS;
+}
+
+GUTHTHILA_DECLARE(int)
+guththila_xml_stream_writer_free(guththila_environment_t *environment,
+                                 guththila_xml_stream_writer_t *writer)
+{
+    if(!environment) return GUTHTHILA_FAILURE;
+    if(!writer) return GUTHTHILA_FAILURE;
+   
+    if(writer->encoding)
+       GUTHTHILA_FREE(environment->allocator, writer->encoding);
+    
+    if(writer->namespace_hash)
+        guththila_hash_free(environment, writer->namespace_hash);
+    if(writer->prefix_hash)
+        guththila_hash_free(environment, writer->prefix_hash);
+    
+    if(writer->element_stack)
+        guththila_array_free(environment, writer->element_stack);
+    
+    GUTHTHILA_FREE(environment->allocator, writer);
+    return GUTHTHILA_SUCCESS;   
 }

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.h?rev=345821&r1=345820&r2=345821&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.h (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.h Sun Nov 20 19:53:26 2005
@@ -42,177 +42,171 @@
                                     int is_prefix_defaulting);
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_end_start_element (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_stream_writer_t *
-                                               stream_writer);
+guththila_xml_stream_writer_end_start_element 
+                                (guththila_environment_t *environment,
+                                guththila_xml_stream_writer_t *stream_writer);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_start_element (guththila_environment_t *
-                                                 environment,
-                                                 guththila_xml_stream_writer_t
-                                                 * stream_writer,
-                                                 guththila_char_t *
-                                                 local_name);
+guththila_xml_stream_writer_write_start_element 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_stream_writer_t *stream_writer,
+                                 guththila_char_t *local_name);
 
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_start_element_with_namespace
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * local_name, guththila_char_t * namespace_uri);
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t *local_name,
+                             guththila_char_t * namespace_uri);
+                             
 
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_start_element_with_namespace_prefix
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * local_name, guththila_char_t * namespace_uri,
-     guththila_char_t * prefix);
+                                (guththila_environment_t * environment,
+                                 guththila_xml_stream_writer_t * stream_writer,
+                                 guththila_char_t * local_name,
+                                 guththila_char_t * namespace_uri,
+                                 guththila_char_t * prefix);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_empty_element (guththila_environment_t *
-                                                 environment,
-                                                 guththila_xml_stream_writer_t
-                                                 * stream_writer,
-                                                 guththila_char_t *
-                                                 local_name);
+guththila_xml_stream_writer_write_empty_element 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_stream_writer_t *stream_writer,
+                                 guththila_char_t *local_name);
 
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_empty_element_with_namespace
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * local_name, guththila_char_t * namespace_uri);
-
-
-
+                                (guththila_environment_t * environment,
+                                 guththila_xml_stream_writer_t * stream_writer,
+                                 guththila_char_t * local_name,
+                                 guththila_char_t * namespace_uri);
+                                 
+                                 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_empty_element_with_namespace_prefix
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * local_name, guththila_char_t * namespace_uri,
-     guththila_char_t * prefix);
+                                (guththila_environment_t * environment,
+                                 guththila_xml_stream_writer_t * stream_writer,
+                                 guththila_char_t *local_name,
+                                 guththila_char_t * namespace_uri,
+                                 guththila_char_t * prefix);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_end_element (guththila_environment_t *
-                                               environment,
-                                               guththila_xml_stream_writer_t *
-                                               stream_writer);
+guththila_xml_stream_writer_write_end_element 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_stream_writer_t *stream_writer);
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_end_document (guththila_environment_t *
-                                                environment,
-                                                guththila_xml_stream_writer_t
-                                                * stream_writer);
+guththila_xml_stream_writer_write_end_document 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_stream_writer_t *stream_writer);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_attribute (guththila_environment_t *
-                                             environment,
-                                             guththila_xml_stream_writer_t *
-                                             stream_writer,
-                                             guththila_char_t * local_name,
-                                             guththila_char_t * value);
+guththila_xml_stream_writer_write_attribute 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_stream_writer_t *stream_writer,
+                                 guththila_char_t * local_name,
+                                 guththila_char_t * value);
 
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_attribute_with_namespace
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * local_name, guththila_char_t * value,
-     guththila_char_t * namespace_uri);
+                                (guththila_environment_t * environment,
+                                 guththila_xml_stream_writer_t * stream_writer,
+                                 guththila_char_t * local_name,
+                                 guththila_char_t * value,
+                                 guththila_char_t * namespace_uri);
 
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_attribute_with_namespace_prefix
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * local_name, guththila_char_t * value,
-     guththila_char_t * namespace_uri, guththila_char_t * prefix);
-
-
+                                (guththila_environment_t * environment,
+                                 guththila_xml_stream_writer_t * stream_writer,
+                                 guththila_char_t * local_name,
+                                 guththila_char_t * value,
+                                 guththila_char_t * namespace_uri,
+                                 guththila_char_t * prefix);
+                                 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_namespace (guththila_environment_t *
-                                             environment,
-                                             guththila_xml_stream_writer_t *
-                                             stream_writer,
-                                             guththila_char_t * prefix,
-                                             guththila_char_t *
-                                             namespace_uri);
+guththila_xml_stream_writer_write_namespace 
+                                (guththila_environment_t *environment,
+                                 guththila_xml_stream_writer_t *stream_writer,
+                                 guththila_char_t * prefix,
+                                 guththila_char_t *namespace_uri);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_default_namespace (guththila_environment_t *
-                                                     environment,
-                                                     guththila_xml_stream_writer_t
-                                                     * stream_writer,
-                                                     guththila_char_t *
-                                                     namespace_uri);
+guththila_xml_stream_writer_write_default_namespace 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t * stream_writer,
+                             guththila_char_t *namespace_uri);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_comment (guththila_environment_t *
-                                           environment,
-                                           guththila_xml_stream_writer_t *
-                                           stream_writer,
-                                           guththila_char_t * data);
+guththila_xml_stream_writer_write_comment 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * data);
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_processing_instruction
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * target);
+                            (guththila_environment_t * environment,
+                             guththila_xml_stream_writer_t * stream_writer,
+                             guththila_char_t * target);
 
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_processing_instruction_data
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer, guththila_char_t * target,
-     guththila_char_t * data);
+                            (guththila_environment_t * environment,
+                             guththila_xml_stream_writer_t * stream_writer,
+                             guththila_char_t * target,
+                             guththila_char_t * data);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_cdata (guththila_environment_t *
-                                         environment,
-                                         guththila_xml_stream_writer_t *
-                                         stream_writer,
-                                         guththila_char_t * data);
+guththila_xml_stream_writer_write_cdata 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t *data);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_dtd (guththila_environment_t * environment,
-                                       guththila_xml_stream_writer_t *
-                                       stream_writer, guththila_char_t * dtd);
+guththila_xml_stream_writer_write_dtd 
+                            (guththila_environment_t * environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t *dtd);
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_entity_ref (guththila_environment_t *
-                                              environment,
-                                              guththila_xml_stream_writer_t *
-                                              stream_writer,
-                                              guththila_char_t * name);
+guththila_xml_stream_writer_write_entity_ref 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * name);
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_start_document (guththila_environment_t *
-                                                  environment,
-                                                  guththila_xml_stream_writer_t
-                                                  * stream_writer);
+guththila_xml_stream_writer_write_start_document 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer);
+
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_start_document_with_version
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * version);
+                            (guththila_environment_t * environment,
+                             guththila_xml_stream_writer_t * stream_writer,
+                             guththila_char_t * version);
 
 
 GUTHTHILA_DECLARE (int)
 guththila_xml_stream_writer_write_start_document_with_version_encoding
-    (guththila_environment_t * environment,
-     guththila_xml_stream_writer_t * stream_writer,
-     guththila_char_t * encoding, guththila_char_t * version);
+                                (guththila_environment_t * environment,
+                                 guththila_xml_stream_writer_t * stream_writer,
+                                 guththila_char_t * encoding, 
+                                 guththila_char_t * version);
 
 
 GUTHTHILA_DECLARE (int)
@@ -224,34 +218,36 @@
 
 
 GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_stream_writer_get_prefix (guththila_environment_t * environment,
-                                        guththila_xml_stream_writer_t *
-                                        stream_writer,
-                                        guththila_char_t * uri);
+guththila_xml_stream_writer_get_prefix 
+                                (guththila_environment_t * environment,
+                                 guththila_xml_stream_writer_t *stream_writer,
+                                 guththila_char_t * uri);
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_set_prefix (guththila_environment_t * environment,
-                                        guththila_xml_stream_writer_t *
-                                        stream_writer,
-                                        guththila_char_t * prefix,
-                                        guththila_char_t * uri);
+guththila_xml_stream_writer_set_prefix 
+                            (guththila_environment_t * environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * prefix,
+                             guththila_char_t * uri);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_set_default_prefix (guththila_environment_t *
-                                                environment,
-                                                guththila_xml_stream_writer_t
-                                                * stream_writer,
-                                                guththila_char_t * uri);
+guththila_xml_stream_writer_set_default_prefix 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * uri);
 
 
 GUTHTHILA_DECLARE (int)
-guththila_xml_stream_writer_write_encoded (guththila_environment_t *
-                                           environment,
-                                           guththila_xml_stream_writer_t *
-                                           stream_writer,
-                                           guththila_char_t * text,
-                                           int in_attr);
+guththila_xml_stream_writer_write_encoded 
+                            (guththila_environment_t *environment,
+                             guththila_xml_stream_writer_t *stream_writer,
+                             guththila_char_t * text,
+                             int in_attr);
+
+GUTHTHILA_DECLARE(int)
+guththila_xml_stream_writer_free(guththila_environment_t *environment,
+                                 guththila_xml_stream_writer_t *writer);
 
 
 #endif /*GUTHTHILA_XML_STREAM_WRITER_H */

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/src/Makefile
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/src/Makefile?rev=345821&r1=345820&r2=345821&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/src/Makefile (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/src/Makefile Sun Nov 20 19:53:26 2005
@@ -81,14 +81,14 @@
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /home/damitha/projects/c/conftools/missing --run aclocal-1.9
+ACLOCAL = ${SHELL} /home/nandika/axis2/c/conftools/missing --run aclocal-1.9
 AMDEP_FALSE = #
 AMDEP_TRUE = 
-AMTAR = ${SHELL} /home/damitha/projects/c/conftools/missing --run tar
+AMTAR = ${SHELL} /home/nandika/axis2/c/conftools/missing --run tar
 AR = ar
-AUTOCONF = ${SHELL} /home/damitha/projects/c/conftools/missing --run autoconf
-AUTOHEADER = ${SHELL} /home/damitha/projects/c/conftools/missing --run autoheader
-AUTOMAKE = ${SHELL} /home/damitha/projects/c/conftools/missing --run automake-1.9
+AUTOCONF = ${SHELL} /home/nandika/axis2/c/conftools/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/nandika/axis2/c/conftools/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/nandika/axis2/c/conftools/missing --run automake-1.9
 AWK = gawk
 CC = gcc
 CCDEPMODE = depmode=gcc3
@@ -114,19 +114,19 @@
 ECHO_T = 
 EGREP = grep -E
 EXEEXT = 
-F77 = g77
+F77 = f95
 FFLAGS = -g -O2
 INSTALL_DATA = ${INSTALL} -m 644
 INSTALL_PROGRAM = ${INSTALL}
 INSTALL_SCRIPT = ${INSTALL}
 INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
-LDFLAGS =  -L/home/damitha/programs/cutest/lib/
+LDFLAGS =  -L/home/nandika/software/cutest/lib/
 LIBOBJS = 
 LIBS = -lcutest -ldl
 LIBTOOL = $(SHELL) $(top_builddir)/libtool
 LN_S = ln -s
 LTLIBOBJS = 
-MAKEINFO = ${SHELL} /home/damitha/projects/c/conftools/missing --run makeinfo
+MAKEINFO = ${SHELL} /home/nandika/axis2/c/conftools/missing --run makeinfo
 OBJEXT = o
 PACKAGE = axis2
 PACKAGE_BUGREPORT = 
@@ -144,7 +144,7 @@
 ac_ct_AR = ar
 ac_ct_CC = gcc
 ac_ct_CXX = g++
-ac_ct_F77 = g77
+ac_ct_F77 = f95
 ac_ct_RANLIB = ranlib
 ac_ct_STRIP = strip
 am__fastdepCC_FALSE = #
@@ -171,7 +171,7 @@
 host_vendor = redhat
 includedir = ${prefix}/include
 infodir = ${prefix}/info
-install_sh = /home/damitha/projects/c/conftools/install-sh
+install_sh = /home/nandika/axis2/c/conftools/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
 localstatedir = ${prefix}/var



Mime
View raw message