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 sa...@apache.org on 2005/11/11 05:57:40 UTC
svn commit: r332451 - in /webservices/axis2/trunk/c: ./ include/
modules/test/om/src/ modules/xml/om/src/
Author: samisa
Date: Thu Nov 10 20:57:18 2005
New Revision: 332451
URL: http://svn.apache.org/viewcvs?rev=332451&view=rev
Log:
om node serialize changed patch applied
Modified:
webservices/axis2/trunk/c/configure
webservices/axis2/trunk/c/configure.ac
webservices/axis2/trunk/c/include/axis2_om_attribute.h
webservices/axis2/trunk/c/include/axis2_om_doctype.h
webservices/axis2/trunk/c/include/axis2_om_element.h
webservices/axis2/trunk/c/include/axis2_om_namespace.h
webservices/axis2/trunk/c/include/axis2_om_node.h
webservices/axis2/trunk/c/include/axis2_om_output.h
webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h
webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
webservices/axis2/trunk/c/include/axis2_om_text.h
webservices/axis2/trunk/c/modules/test/om/src/test_om.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
Modified: webservices/axis2/trunk/c/configure
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/configure?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/configure (original)
+++ webservices/axis2/trunk/c/configure Thu Nov 10 20:57:18 2005
@@ -21953,7 +21953,7 @@
-CFLAGS="$CFLAGS -ansi -Wall -D_LARGEFILE64_SOURCE -g"
+CFLAGS="$CFLAGS -ansi -Wall -D_LARGEFILE64_SOURCE -g3 -O2"
#CFLAGS="$CFLAGS -Wall -ansi -Wshadow -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread"
LDFLAGS="$LDFLAGS -L${CUTEST_HOME}/lib/"
LIBS="-lcutest -ldl"
Modified: webservices/axis2/trunk/c/configure.ac
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/configure.ac?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/configure.ac (original)
+++ webservices/axis2/trunk/c/configure.ac Thu Nov 10 20:57:18 2005
@@ -25,7 +25,7 @@
#using libtool
AM_PROG_LIBTOOL
-CFLAGS="$CFLAGS -ansi -Wall -D_LARGEFILE64_SOURCE -g"
+CFLAGS="$CFLAGS -ansi -Wall -D_LARGEFILE64_SOURCE -g3 -O2"
#CFLAGS="$CFLAGS -Wall -ansi -Wshadow -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread"
LDFLAGS="$LDFLAGS -L${CUTEST_HOME}/lib/"
LIBS="-lcutest -ldl"
Modified: webservices/axis2/trunk/c/include/axis2_om_attribute.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_attribute.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_attribute.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_attribute.h Thu Nov 10 20:57:18 2005
@@ -159,14 +159,14 @@
#define AXIS2_OM_ATTRIBUTE_GET_VALUE(om_attribute, env) \
((om_attribute)->ops->get_value(om_attribute, env))
-#define AXIS2_OM_ATTRIBUTE_SET_NAMESPACE(om_attribute, env) \
- ((om_attribute)->ops->set_namespace(om_attribute, env))
+#define AXIS2_OM_ATTRIBUTE_SET_NAMESPACE(om_attribute, env,ns) \
+ ((om_attribute)->ops->set_namespace(om_attribute, env,ns))
-#define AXIS2_OM_ATTRIBUTE_SET_LOCALNAME(om_attribute, env) \
- ((om_attribute)->ops->set_localname(om_attribute, env))
+#define AXIS2_OM_ATTRIBUTE_SET_LOCALNAME(om_attribute, env,localname) \
+ ((om_attribute)->ops->set_localname(om_attribute, env,localname))
-#define AXIS2_OM_ATTRIBUTE_SET_VALUE(om_attribute, env) \
- ((om_attribute)->ops->set_value(om_attribute, env))
+#define AXIS2_OM_ATTRIBUTE_SET_VALUE(om_attribute, env,value) \
+ ((om_attribute)->ops->set_value(om_attribute, env,value))
Modified: webservices/axis2/trunk/c/include/axis2_om_doctype.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_doctype.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_doctype.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_doctype.h Thu Nov 10 20:57:18 2005
@@ -107,3 +107,5 @@
#endif
#endif /* AXIS2_OM_DOCTYPE_H */
+
+
Modified: webservices/axis2/trunk/c/include/axis2_om_element.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_element.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_element.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_element.h Thu Nov 10 20:57:18 2005
@@ -275,3 +275,6 @@
#endif
#endif /* AXIS2_OM_ELEMENT_H */
+
+
+
Modified: webservices/axis2/trunk/c/include/axis2_om_namespace.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_namespace.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_namespace.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_namespace.h Thu Nov 10 20:57:18 2005
@@ -150,3 +150,5 @@
#endif
#endif /* AXIS2_OM_NAMESPACE */
+
+
Modified: webservices/axis2/trunk/c/include/axis2_om_node.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_node.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_node.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_node.h Thu Nov 10 20:57:18 2005
@@ -138,27 +138,7 @@
axis2_env_t **env,
struct axis2_om_node *parent_node);
- /**
- * gets the first child of a given node
- * @param env Environment. MUST NOT be NULL, if NULL behaviour is undefined.
- * @param parent_node node whose first child is to be returnd.
- * @return a pointer to first child if there is one, else returns NULL.
- * On error sets the error and returns NULL
- */
- struct axis2_om_node *(AXIS2_CALL *iterator_get_first_child)(struct axis2_om_node *om_node,
- axis2_env_t **env);
-
- /**
- * Gets the next child of the given node.
- * This function should only be called after a call to get_first_child function
- * @param env Environment. MUST NOT be NULL, if NULL behaviour is undefined.
- * @param parent_node node whose next child is to be returned.
- * @return a pointer to next child if there is one, else returns NULL.
- * On error sets the error and returns NULL
- */
- struct axis2_om_node* (AXIS2_CALL *iterator_get_next_child) (struct axis2_om_node *om_node,
- axis2_env_t **env);
-
+
/**
* Serializes the given node. This operation makes the node go through its children and
* serialize them in order.
@@ -269,15 +249,7 @@
/** sets the parent of the given node */
#define AXIS2_OM_NODE_SET_PARENT(om_node,env,parent_node) \
((om_node)->ops->set_parent(om_node,env,parent_node))
-
-/** gets the first child of the given node */
-#define AXIS2_OM_NODE_ITERATOR_GET_FIRST_CHILD(om_node,env) \
- ((om_node)->ops->iterator_get_first_child(om_node,env))
-/** gets the next child of the given node */
-
-#define AXIS2_OM_NODE_ITERATOR_GET_NEXT_CHILD(om_node,env) \
- ((om_node)->ops->iterator_get_next_child(om_node,env))
-/** serializes the given node */
+
#define AXIS2_OM_NODE_SERIALIZE(om_node,env, om_output) \
((om_node)->ops->serialize(om_node,env,om_output))
Modified: webservices/axis2/trunk/c/include/axis2_om_output.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_output.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_output.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_output.h Thu Nov 10 20:57:18 2005
@@ -95,3 +95,5 @@
#endif
#endif /* AXIS2_OM_OUTPUT_H */
+
+
Modified: webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h Thu Nov 10 20:57:18 2005
@@ -123,3 +123,6 @@
#endif
#endif /* AXIS2_OM_PI_H */
+
+
+
Modified: webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_stax_builder.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_stax_builder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_stax_builder.h Thu Nov 10 20:57:18 2005
@@ -144,4 +144,4 @@
#endif
-#endif /* AXIS2_OM_STAX_BUILDER_H */
\ No newline at end of file
+#endif /* AXIS2_OM_STAX_BUILDER_H */
Modified: webservices/axis2/trunk/c/include/axis2_om_text.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_text.h?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_text.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_text.h Thu Nov 10 20:57:18 2005
@@ -118,7 +118,7 @@
#define AXIS2_OM_TEXT_SET_VALUE(om_text, env, value) \
((om_text)->ops->set_value(om_text, env, value))
-
+
/** @} */
Modified: webservices/axis2/trunk/c/modules/test/om/src/test_om.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/test/om/src/test_om.c?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/test/om/src/test_om.c (original)
+++ webservices/axis2/trunk/c/modules/test/om/src/test_om.c Thu Nov 10 20:57:18 2005
@@ -100,9 +100,6 @@
AXIS2_OM_NODE_SERIALIZE (node1, &environment , om_output);
AXIS2_FREE (environment->allocator, om_output);
- /* AXIS2_OM_NODE_FREE(node1,&environment); */
-
- AXIS2_OM_STAX_BUILDER_FREE ( builder, &environment);
guththila_xml_pull_parser_free (my_guththila_environment, parser);
printf ("\n\n");
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c?rev=332451&r1=332450&r2=332451&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c Thu Nov 10 20:57:18 2005
@@ -148,8 +148,6 @@
struct axis2_om_node *next_sibling;
/** first child */
struct axis2_om_node *first_child;
- /** current child */
- struct axis2_om_node *current_child;
/** last child */
struct axis2_om_node *last_child;
/** node type, indicates the type stored in data_element */
@@ -196,13 +194,12 @@
node->om_node.ops->add_child = axis2_om_node_add_child;
node->om_node.ops->free = axis2_om_node_free;
node->om_node.ops->detach = axis2_om_node_detach;
- node->om_node.ops->iterator_get_first_child = axis2_om_node_get_first_child;
+
node->om_node.ops->insert_sibling_after = axis2_om_node_insert_sibling_after;
node->om_node.ops->insert_sibling_before = axis2_om_node_insert_sibling_before;
node->om_node.ops->set_parent = axis2_om_node_set_parent;
node->om_node.ops->serialize = axis2_om_node_serialize;
- node->om_node.ops->iterator_get_next_child = axis2_om_node_iterator_get_next_child;
-
+
node->om_node.ops->get_first_child = axis2_om_node_get_first_child;
node->om_node.ops->get_last_child = axis2_om_node_get_last_child;
node->om_node.ops->get_next_sibling = axis2_om_node_get_next_sibling;
@@ -231,7 +228,7 @@
node->node_type = AXIS2_OM_INVALID;
node->done = AXIS2_FALSE;
node->data_element = NULL;
- node->current_child = NULL;
+
return &(node->om_node);
}
@@ -472,69 +469,15 @@
return AXIS2_SUCCESS;
}
-
-axis2_om_node_t* AXIS2_CALL
-axis2_om_node_iterator_get_first_child (axis2_om_node_t *om_node,
- axis2_env_t **env)
-{
- AXIS2_ENV_CHECK(env, NULL);
- AXIS2_FUNC_PARAM_CHECK( om_node, env, NULL);
-
- if(AXIS2_INTF_TO_IMPL(om_node)->first_child)
- {
-
- AXIS2_INTF_TO_IMPL(om_node)->current_child =
- AXIS2_INTF_TO_IMPL(om_node)->first_child;
- return AXIS2_INTF_TO_IMPL(om_node)->first_child;
-
- }
- return NULL;
-}
-
-axis2_om_node_t* AXIS2_CALL
-axis2_om_node_iterator_get_next_child (axis2_om_node_t *om_node,
- axis2_env_t **env)
-{
- axis2_om_node_t *node = NULL;
- axis2_om_node_t *current_child = NULL;
- AXIS2_ENV_CHECK(env, NULL);
- AXIS2_FUNC_PARAM_CHECK(om_node, env, NULL);
- AXIS2_FUNC_PARAM_CHECK(AXIS2_INTF_TO_IMPL(om_node)->first_child, env, NULL);
- if(!(AXIS2_INTF_TO_IMPL(om_node)->current_child))
- {
- (*env)->error->error_number = AXIS2_ERROR_INVALID_ITERATOR_STATE;
-
- return NULL;
-
- }
- current_child = AXIS2_INTF_TO_IMPL(om_node)->current_child;
-
- if(current_child && AXIS2_INTF_TO_IMPL(current_child)->next_sibling)
- {
- node = AXIS2_INTF_TO_IMPL(current_child)->next_sibling;
- AXIS2_INTF_TO_IMPL(om_node)->current_child = node;
- return node;
- }
- return NULL;
-}
-
axis2_status_t AXIS2_CALL
axis2_om_node_serialize (axis2_om_node_t *om_node,
axis2_env_t **env,
axis2_om_output_t *om_output)
{
- axis2_om_node_t *child_node = NULL;
int status = AXIS2_SUCCESS;
AXIS2_FUNC_PARAM_CHECK(om_node, env, AXIS2_FAILURE);
-
- if(!om_output)
- {
- AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error ,
- AXIS2_ERROR_INVALID_NULL_PARAM);
- AXIS2_ERROR_SET_STATUS_CODE((*env)->error , AXIS2_FAILURE);
- return AXIS2_FAILURE;
- }
+ AXIS2_PARAM_CHECK((*env)->error,om_output,AXIS2_FAILURE);
switch (AXIS2_INTF_TO_IMPL(om_node)->node_type)
@@ -559,17 +502,10 @@
default:
break;
}
-
-
- child_node = axis2_om_node_iterator_get_first_child ( om_node , env);
-
- while (child_node)
- {
- status = axis2_om_node_serialize (child_node, env, om_output);
- if (status != AXIS2_SUCCESS)
- return status;
- child_node = axis2_om_node_iterator_get_next_child (om_node, env);
- }
+
+ /* serialize children of this node */
+ if(AXIS2_INTF_TO_IMPL(om_node)->first_child)
+ status = axis2_om_node_serialize(AXIS2_INTF_TO_IMPL(om_node)->first_child, env, om_output);
switch (AXIS2_INTF_TO_IMPL(om_node)->node_type)
{
@@ -584,10 +520,11 @@
default:
break;
}
-
+ /* serialize next sibling */
+ if(AXIS2_INTF_TO_IMPL(om_node)->next_sibling)
+ status = axis2_om_node_serialize(AXIS2_INTF_TO_IMPL(om_node)->next_sibling, env, om_output);
+
return status;
-
- return AXIS2_SUCCESS;
}