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/10/25 04:39:56 UTC
svn commit: r328241 - in /webservices/axis2/trunk/c: include/
modules/test/om/src/ modules/xml/guththila/src/ modules/xml/om/src/
Author: samisa
Date: Mon Oct 24 19:39:44 2005
New Revision: 328241
URL: http://svn.apache.org/viewcvs?rev=328241&view=rev
Log:
Fixed problems related to guththila environment
Modified:
webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
webservices/axis2/trunk/c/modules/test/om/src/Makefile.am
webservices/axis2/trunk/c/modules/test/om/src/test_om.c
webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c
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=328241&r1=328240&r2=328241&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_stax_builder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_stax_builder.h Mon Oct 24 19:39:44 2005
@@ -101,11 +101,12 @@
* @param parser pull parser to be used by the builder. Parser should implement the
* Guththila interface. If NULL, default xml parser
* (guththila pull parser) will be created with stdin as the input stream.
+ * @param parser_env parser envioronment. Optional, can be NULL.
* @return a pointer to the newly created builder struct.
*/
AXIS2_DECLARE( axis2_om_stax_builder_t *) axis2_om_stax_builder_create (axis2_environment_t
* environment,
- void *parser);
+ void *parser, void* parser_env);
/** builds next node */
#define axis2_om_stax_builder_next(environment, builder) ((builder)->ops->axis2_om_stax_builder_ops_next(environment, builder))
Modified: webservices/axis2/trunk/c/modules/test/om/src/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/test/om/src/Makefile.am?rev=328241&r1=328240&r2=328241&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/test/om/src/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/test/om/src/Makefile.am Mon Oct 24 19:39:44 2005
@@ -4,6 +4,12 @@
AM_CPPFLAGS = $(CPPFLAGS) -g -O2 -pthread
test_om_SOURCES = test_om.c
+<<<<<<< .mine
+test_om_LDADD = $(LDFLAGS) -L$(top_builddir)/modules/xml/om/src/.libs -laxis2_om \
+ -L$(top_builddir)/modules/xml/guththila/src/.libs -lguththila \
+ -L$(top_builddir)/modules/util/src/.libs -laxis2_util
+
+=======
#test_om_LDADD = $(LDFLAGS) $(top_builddir)/modules/xml/om/src/libaxis2_om.la \
# $(top_builddir)/modules/xml/guththila/src/libguththila.la
@@ -11,5 +17,6 @@
-L$(top_builddir)/modules/xml/guththila/src/.libs -lguththila \
-L$(top_builddir)/modules/util/src/.libs -laxis2_util
+>>>>>>> .r328240
INCLUDES = -I${CUTEST_HOME}/include -I$(top_builddir)/include \
-I$(top_builddir)/modules/xml/guththila/src
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=328241&r1=328240&r2=328241&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 Mon Oct 24 19:39:44 2005
@@ -40,7 +40,7 @@
printf ("Read Failed");
}
- builder = axis2_om_stax_builder_create (environment, parser);
+ builder = axis2_om_stax_builder_create (environment, parser, my_guththila_environment);
document = axis2_om_document_create (environment, NULL, builder);
printf ("START: pull document\n");
node1 = axis2_om_document_get_root_element (environment, document);
@@ -63,18 +63,21 @@
switch (node2->node_type)
{
- case AXIS2_OM_ELEMENT:
- if (((axis2_om_element_t *) (node2->data_element))->localname)
- printf ("Element localname %s\n",
+ case AXIS2_OM_ELEMENT:
+ if (((axis2_om_element_t *) (node2->data_element))->localname)
+ printf ("Element localname %s\n",
((axis2_om_element_t *) (node2->data_element))->
localname);
break;
- case AXIS2_OM_TEXT:
- if (((axis2_om_text_t *) (node2->data_element))
- && ((axis2_om_text_t *) (node2->data_element))->value)
- printf ("Element Text value %s\n",
+ case AXIS2_OM_TEXT:
+ if (((axis2_om_text_t *) (node2->data_element))
+ && ((axis2_om_text_t *) (node2->data_element))->value)
+ printf ("Element Text value %s\n",
((axis2_om_text_t *) (node2->data_element))->value);
break;
+
+ default:
+ break;
}
node2 = axis2_om_document_build_next (environment, document);
Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c?rev=328241&r1=328240&r2=328241&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c Mon Oct 24 19:39:44 2005
@@ -205,11 +205,11 @@
void
-guththila_xml_pull_parser_open_token (guththila_environment_t *environment,guththila_xml_pull_parser_t * parser)
+guththila_xml_pull_parser_open_token (guththila_environment_t *environment, guththila_xml_pull_parser_t * parser)
{
- guththila_token_t *t = (guththila_token_t *) guththila_malloc(environment->allocator,sizeof (guththila_token_t));
+ guththila_token_t *t = (guththila_token_t *) guththila_malloc(environment->allocator, sizeof (guththila_token_t));
t->type = Unknown;
- t->start = guththila_xml_pull_parser_last_char (environment,parser);
+ t->start = guththila_xml_pull_parser_last_char (environment, parser);
guththila_stack_push (environment,parser->stack, t, NULL);
}
@@ -217,10 +217,10 @@
void
guththila_xml_pull_parser_close_token (guththila_environment_t *environment,guththila_xml_pull_parser_t * parser, int t, int refer)
{
- guththila_element_t *e = guththila_stack_last (environment,parser->stack);
+ guththila_element_t *e = guththila_stack_last (environment, parser->stack);
e->token->type = t;
e->token->ref = refer;
- e->token->end = guththila_xml_pull_parser_last_char (environment,parser) - 1;
+ e->token->end = guththila_xml_pull_parser_last_char (environment, parser) - 1;
}
@@ -872,10 +872,20 @@
{
e = guththila_stack_pull (environment,parser->namesp);
if (e->namespace->name)
- free (e->namespace->name);
+ {
+ free (e->namespace->name);
+ e->namespace->name = NULL;
+ }
if (e->namespace->uri)
- free (e->namespace->uri);
- free (e);
+ {
+ free (e->namespace->uri);
+ e->namespace->uri = NULL;
+ }
+ if (e)
+ {
+ /*free (e);*/
+ e = NULL;
+ }
}
}
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c?rev=328241&r1=328240&r2=328241&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c Mon Oct 24 19:39:44 2005
@@ -43,7 +43,7 @@
{
om_output_guththila_allocator = guththila_allocator_init(NULL);
- om_output_guththila_environment = guththila_environment_create(om_output_guththila_allocator,NULL,NULL,NULL,NULL);
+ om_output_guththila_environment = guththila_environment_create(om_output_guththila_allocator, NULL, NULL, NULL, NULL);
om_output->xml_writer = guththila_create_xml_stream_writer (om_output_guththila_environment, stdout,
DEFAULT_CHAR_SET_ENCODING,
AXIS2_TRUE);
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c?rev=328241&r1=328240&r2=328241&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c Mon Oct 24 19:39:44 2005
@@ -36,7 +36,7 @@
builder);
axis2_om_stax_builder_t *
-axis2_om_stax_builder_create (axis2_environment_t * environment, void *parser)
+axis2_om_stax_builder_create (axis2_environment_t * environment, void *parser, void* parser_env)
{
axis2_om_stax_builder_t *builder =
(axis2_om_stax_builder_t *) axis2_malloc (environment->allocator,
@@ -51,7 +51,11 @@
builder->parser = NULL;
if (parser)
+ {
builder->parser = parser;
+ if (parser_env)
+ om_stax_builder_guththila_environment = (guththila_environment_t*) parser_env;
+ }
else
{
/* create the default Guththila pull parser */