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 sa...@apache.org on 2005/10/25 03:54:03 UTC

svn commit: r328228 - in /webservices/axis2/trunk/c/modules/test/om/src: Makefile.am Makefile.in test_om.c

Author: samisa
Date: Mon Oct 24 18:53:54 2005
New Revision: 328228

URL: http://svn.apache.org/viewcvs?rev=328228&view=rev
Log:
aplied changes in line with changes to Guththila

Modified:
    webservices/axis2/trunk/c/modules/test/om/src/Makefile.am
    webservices/axis2/trunk/c/modules/test/om/src/Makefile.in
    webservices/axis2/trunk/c/modules/test/om/src/test_om.c

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=328228&r1=328227&r2=328228&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 18:53:54 2005
@@ -1,7 +1,7 @@
 prgbindir=$(prefix)/bin/system_test
 prgbin_PROGRAMS = test_om
 SUBDIRS =
-AM_CPPFLAGS = $(CPPFLAGS) -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread
+AM_CPPFLAGS = $(CPPFLAGS) -g -O2 -pthread
 test_om_SOURCES = test_om.c
 
 test_om_LDADD   =  $(LDFLAGS) $(top_builddir)/modules/xml/om/src/libaxis2_om.la \

Modified: webservices/axis2/trunk/c/modules/test/om/src/Makefile.in
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/test/om/src/Makefile.in?rev=328228&r1=328227&r2=328228&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/test/om/src/Makefile.in (original)
+++ webservices/axis2/trunk/c/modules/test/om/src/Makefile.in Mon Oct 24 18:53:54 2005
@@ -195,7 +195,7 @@
 target_vendor = @target_vendor@
 prgbindir = $(prefix)/bin/system_test
 SUBDIRS = 
-AM_CPPFLAGS = $(CPPFLAGS) -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread
+AM_CPPFLAGS = $(CPPFLAGS) -g -O2 -pthread
 test_om_SOURCES = test_om.c
 test_om_LDADD = $(LDFLAGS) $(top_builddir)/modules/xml/om/src/libaxis2_om.la \
                     $(top_builddir)/modules/xml/guththila/src/libguththila.la

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=328228&r1=328227&r2=328228&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 18:53:54 2005
@@ -5,16 +5,18 @@
 #include <axis2_om_text.h>
 
 #include <stdio.h>
-#include <apr.h>
-#include <apr_general.h>
 #include <guththila_xml_pull_parser.h>
 
 axis2_allocator_t *allocator = NULL;
 axis2_string_t *string = NULL;
 axis2_environment_t *environment = NULL;
 
+guththila_environment_t *my_guththila_environment = NULL;
+guththila_allocator_t *my_guththila_allocator = NULL;
+
+
 int
-test_om_build ()
+test_om_build (char *file_name)
 {
     guththila_reader_t *reader = NULL;
     guththila_xml_pull_parser_t *parser = NULL;
@@ -25,20 +27,14 @@
     FILE *fp = NULL;
     axis2_om_output_t *om_output = NULL;
 
-    fp = fopen ("test.xml", "r");
-
-    reader = guththila_reader_create (fp);
+    fp = fopen (file_name, "r");
 
-    parser = guththila_xml_pull_parser_create (reader);
+    reader = guththila_reader_create (my_guththila_environment, fp);
 
-    guththila_xml_pull_parser_read (parser);
+    parser = guththila_xml_pull_parser_create (my_guththila_environment, reader);
 
+    guththila_xml_pull_parser_read (my_guththila_environment, parser);
 
-/*    if(apr_initialize() != APR_SUCCESS)
-    {
-       return;
-    }
-    */
     if (!fp)
     {
         printf ("Read Failed");
@@ -182,13 +178,18 @@
 }
 
 int
-main (void)
+main (int argc, char *argv[])
 {
+	char *file_name = "test.xml"; 
+	if (argc > 1)
+		file_name = argv[1];
     allocator = axis2_allocator_init (NULL);
     environment =
         axis2_environment_create (allocator, NULL, NULL, NULL, NULL);
-    if (apr_initialize () != APR_SUCCESS)
-        return -1;
-    test_om_build ();
+	
+	my_guththila_allocator = guththila_allocator_init(NULL);
+	my_guththila_environment = guththila_environment_create(my_guththila_allocator, NULL, NULL, NULL, NULL);
+
+    test_om_build (file_name);
     test_om_serialize ();
 }