You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pi...@apache.org on 2007/11/30 13:02:08 UTC

svn commit: r599790 - in /webservices/axis2/trunk/c/guththila/src: guththila_namespace.c guththila_xml_parser.c guththila_xml_writer.c

Author: pini
Date: Fri Nov 30 04:01:52 2007
New Revision: 599790

URL: http://svn.apache.org/viewvc?rev=599790&view=rev
Log:
Fixing jira issue 785

Modified:
    webservices/axis2/trunk/c/guththila/src/guththila_namespace.c
    webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c
    webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c

Modified: webservices/axis2/trunk/c/guththila/src/guththila_namespace.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_namespace.c?rev=599790&r1=599789&r2=599790&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_namespace.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_namespace.c Fri Nov 30 04:01:52 2007
@@ -122,7 +122,8 @@
 void GUTHTHILA_CALL
 guththila_namespace_list_free(guththila_namespace_list_t * namesp_list,const axutil_env_t * env) 
 {
-    AXIS2_FREE(env->allocator, namesp_list->list);
+
     guththila_stack_un_init(&namesp_list->fr_stack, env);
+    AXIS2_FREE(env->allocator, namesp_list->list);
     AXIS2_FREE(env->allocator, namesp_list);
 } 

Modified: webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c?rev=599790&r1=599789&r2=599790&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c Fri Nov 30 04:01:52 2007
@@ -25,10 +25,10 @@
     
 #define GUTHTHILA_VALIDATION_PARSER
 
-static int GUTHTHILA_CALL 
+ int GUTHTHILA_CALL 
 guththila_next_char(guththila_t * m,int eof,const axutil_env_t * env);
 
-static int GUTHTHILA_CALL 
+int GUTHTHILA_CALL 
 guththila_next_no_char( 
     guththila_t * m,
     int eof,
@@ -36,14 +36,13 @@
     int no,
     const axutil_env_t * env);
 
-static void GUTHTHILA_CALL guththila_token_close(
+void GUTHTHILA_CALL guththila_token_close(
     guththila_t * m,
     guththila_token_t * tok,
     int tok_type,
     int referer,
     const axutil_env_t * env);
-
-static int GUTHTHILA_CALL guththila_process_xml_dec(
+int GUTHTHILA_CALL guththila_process_xml_dec(
     guththila_t * m,
     const axutil_env_t * env);
 
@@ -102,7 +101,7 @@
 #define GUTHTHILA_IS_VALID_STARTING_CHAR(c) (isalpha(c) || '_' == c || ':' == c)
 #endif  /*  */
 
-static void GUTHTHILA_CALL
+void GUTHTHILA_CALL
 guththila_token_close(
     guththila_t * m,
     guththila_token_t * tok,
@@ -408,6 +407,24 @@
         }
     }
     guththila_stack_un_init(&m->attrib, env);
+    size = GUTHTHILA_STACK_SIZE(m->elem);
+    for (i = 0; i < size; i++)
+    {
+        elem =
+            (guththila_element_t *) guththila_stack_pop(&m->elem, env);
+        if (elem)
+        {
+            if (elem->name)
+                guththila_tok_list_release_token(&m->tokens, elem->name, env);
+            if (elem->prefix)
+                guththila_tok_list_release_token(&m->tokens, elem->prefix, env);
+            AXIS2_FREE(env->allocator, elem);
+        }
+    }
+
+#ifndef GUTHTHILA_VALIDATION_PARSER
+    guththila_namespace_t * namesp = NULL;
+
     size = GUTHTHILA_STACK_SIZE(m->namesp);
     for (i = 0; i < size; i++)
     {
@@ -422,6 +439,32 @@
                 AXIS2_FREE(env->allocator, namesp);
         }
     }
+#else  /*   */
+    guththila_elem_namesp_t * e_namesp = NULL;
+
+    size = GUTHTHILA_STACK_SIZE(m->namesp);
+    for (i = 0; i < size; i++)
+    {
+        e_namesp =
+            (guththila_elem_namesp_t *) guththila_stack_pop(&m->namesp, env);
+                    for (i = 0; i < e_namesp->no; i++)
+                    {
+                        if(e_namesp->namesp[i].name)
+                        {
+                            guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[i].name,env);
+                        }
+
+                        if(e_namesp->namesp[i].uri)
+                        {
+                            guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[i].uri, env);
+                        }
+                        AXIS2_FREE(env->allocator, &(e_namesp->namesp[i]));
+                    }
+
+                    AXIS2_FREE(env->allocator,e_namesp);
+    }
+#endif  /*   */
+
 
         size = GUTHTHILA_STACK_SIZE(m->elem);
     for (i = 0; i < size; i++)
@@ -490,6 +533,10 @@
         }
     }
     guththila_stack_un_init(&m->attrib, env);
+
+#ifndef GUTHTHILA_VALIDATION_PARSER
+    guththila_namespace_t * namesp = NULL;
+
     size = GUTHTHILA_STACK_SIZE(m->namesp);
     for (i = 0; i < size; i++)
     {
@@ -501,9 +548,35 @@
                 guththila_tok_list_release_token(&m->tokens, namesp->name, env);
             if (namesp->uri)
                 guththila_tok_list_release_token(&m->tokens, namesp->uri, env);
-            AXIS2_FREE(env->allocator, namesp);
+                AXIS2_FREE(env->allocator, namesp);
         }
     }
+#else  /*   */
+    guththila_elem_namesp_t * e_namesp = NULL;
+
+    size = GUTHTHILA_STACK_SIZE(m->namesp);
+    for (i = 0; i < size; i++)
+    {
+        e_namesp =
+            (guththila_elem_namesp_t *) guththila_stack_pop(&m->namesp, env);
+                    for (i = 0; i < e_namesp->no; i++)
+                    {
+                        if(e_namesp->namesp[i].name)
+                        {
+                            guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[i].name,env);
+                        }
+
+                        if(e_namesp->namesp[i].uri)
+                        {
+                            guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[i].uri, env);
+                        }
+                        AXIS2_FREE(env->allocator, &(e_namesp->namesp[i]));
+                    }
+
+                    AXIS2_FREE(env->allocator,e_namesp);
+    }
+#endif  /*   */
+
     size = GUTHTHILA_STACK_SIZE(m->elem);
     for (i = 0; i < size; i++)
     {
@@ -576,6 +649,7 @@
                     guththila_tok_list_release_token(&m->tokens,
                                                      nmsp->namesp[nmsp_counter].
                                                      uri, env);
+                AXIS2_FREE(env->allocator,&(nmsp->namesp[nmsp_counter]));
             }
             AXIS2_FREE(env->allocator, nmsp);
         }
@@ -771,6 +845,7 @@
                                                                  namesp
                                                                  [nmsp_counter].
                                                                  uri, env);
+                            AXIS2_FREE(env->allocator,&(nmsp->namesp[nmsp_counter]));
                         }
                         AXIS2_FREE(env->allocator, nmsp);
                     }
@@ -883,7 +958,7 @@
     while (loop);
     return c;
 }
-static int GUTHTHILA_CALL
+int GUTHTHILA_CALL
 guththila_process_xml_dec(
     guththila_t * m,
     const axutil_env_t * env) 
@@ -1325,7 +1400,7 @@
 {
     return "UTF-8";
 }
-static int GUTHTHILA_CALL
+int GUTHTHILA_CALL
 guththila_next_char(
     guththila_t * m,
     int eof,
@@ -1442,7 +1517,7 @@
     }
     return -1;
 }
-static int GUTHTHILA_CALL
+ int GUTHTHILA_CALL
 guththila_next_no_char(
     guththila_t * m,
     int eof,

Modified: webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c?rev=599790&r1=599789&r2=599790&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c Fri Nov 30 04:01:52 2007
@@ -204,6 +204,7 @@
 #endif  /*  */
         guththila_stack_un_init(&wr->element, env);
     guththila_stack_un_init(&wr->namesp, env);
+    AXIS2_FREE(env->allocator,wr);
 }
 int GUTHTHILA_CALL
 guththila_write(



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