You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2007/07/09 07:56:57 UTC

svn commit: r554526 - in /webservices/axis2/trunk/c/axiom: include/axiom_document.h include/axiom_stax_builder.h src/om/om_document.c src/om/om_stax_builder.c

Author: nandika
Date: Sun Jul  8 22:56:56 2007
New Revision: 554526

URL: http://svn.apache.org/viewvc?view=rev&rev=554526
Log:
new free function added to axiom_stax_builder and axiom_document to free itself without freeing axiom tree

Modified:
    webservices/axis2/trunk/c/axiom/include/axiom_document.h
    webservices/axis2/trunk/c/axiom/include/axiom_stax_builder.h
    webservices/axis2/trunk/c/axiom/src/om/om_document.c
    webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c

Modified: webservices/axis2/trunk/c/axiom/include/axiom_document.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/include/axiom_document.h?view=diff&rev=554526&r1=554525&r2=554526
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_document.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_document.h Sun Jul  8 22:56:56 2007
@@ -67,6 +67,15 @@
     AXIS2_EXTERN void AXIS2_CALL
     axiom_document_free(struct axiom_document *document,
             const axutil_env_t *env);
+	 /**
+      * Free document struct only, Does not free the associated axiom struture.
+      * @param document pointer to axiom_document_t struct to be freed
+      * @param env Environment. MUST NOT be NULL  
+      * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE.
+      */
+    AXIS2_EXTERN void AXIS2_CALL
+    axiom_document_free_self(struct axiom_document *document,
+            const axutil_env_t *env);
 
     /** Builds the next node if the builder is not finished with input xml stream
       * @param document document whose next node is to be built. cannot be NULL

Modified: webservices/axis2/trunk/c/axiom/include/axiom_stax_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/include/axiom_stax_builder.h?view=diff&rev=554526&r1=554525&r2=554526
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_stax_builder.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_stax_builder.h Sun Jul  8 22:56:56 2007
@@ -69,7 +69,7 @@
             const axutil_env_t *env);
    
    /**
-     * Free op
+     * Free the build struct instance and its associated document,axiom tree.
      * @param builder pointer to builder struct
      * @param env environment, MUST NOT be NULL
      * @return status of the op AXIS2_SUCCESS on success,
@@ -77,6 +77,18 @@
      */
     AXIS2_EXTERN void AXIS2_CALL
     axiom_stax_builder_free(struct axiom_stax_builder *builder,
+        const axutil_env_t *env);
+
+	/**
+     * Free the build struct instance and its associated document.
+		does not free the associated axiom tree.
+     * @param builder pointer to builder struct
+     * @param env environment, MUST NOT be NULL
+     * @return status of the op AXIS2_SUCCESS on success,
+     *     AXIS2_FAILURE on error.
+     */
+    AXIS2_EXTERN void AXIS2_CALL
+    axiom_stax_builder_free_self(struct axiom_stax_builder *builder,
         const axutil_env_t *env);
 
    /** Gets the document associated with the builder

Modified: webservices/axis2/trunk/c/axiom/src/om/om_document.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_document.c?view=diff&rev=554526&r1=554525&r2=554526
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_document.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_document.c Sun Jul  8 22:56:56 2007
@@ -81,6 +81,14 @@
     return;
 }
 
+AXIS2_EXTERN void AXIS2_CALL
+axiom_document_free_self(axiom_document_t *document,
+    const axutil_env_t *env)
+{
+    AXIS2_FREE(env->allocator, document);
+    return;
+}
+
 
 AXIS2_EXTERN axiom_node_t *AXIS2_CALL
 axiom_document_build_next(axiom_document_t *document,

Modified: webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c?view=diff&rev=554526&r1=554525&r2=554526
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_stax_builder.c Sun Jul  8 22:56:56 2007
@@ -823,6 +823,38 @@
     return;
 }
 
+AXIS2_EXTERN void AXIS2_CALL 
+axiom_stax_builder_free_self(axiom_stax_builder_t *om_builder,
+    const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    if (!om_builder)
+    {
+        return;
+    }
+    if (om_builder->declared_namespaces)
+    {
+        axutil_hash_free(om_builder->declared_namespaces, env);
+        om_builder->declared_namespaces = NULL;
+    }
+
+	if (om_builder->parser)
+    {
+        axiom_xml_reader_free(om_builder->parser, env);
+        om_builder->parser = NULL;
+    }
+	if (om_builder->document)
+    {
+        axiom_document_free_self(om_builder->document, env);
+        om_builder->document = NULL;
+    }
+
+    AXIS2_FREE(env->allocator, om_builder);
+    
+    return;
+}
+
+
 AXIS2_EXTERN axiom_document_t* AXIS2_CALL
 axiom_stax_builder_get_document(axiom_stax_builder_t *om_builder,
     const axutil_env_t *env)



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