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 di...@apache.org on 2006/09/19 19:33:35 UTC
svn commit: r447921 [1/2] - in /webservices/axis2/trunk/c/guththila/src:
guththila_reader.c guththila_writer_main.c guththila_xml_pull_parser.c
Author: dinesh
Date: Tue Sep 19 10:33:34 2006
New Revision: 447921
URL: http://svn.apache.org/viewvc?view=rev&rev=447921
Log:
guththila_xml_pull_parser.c conflict resolved
Modified:
webservices/axis2/trunk/c/guththila/src/guththila_reader.c
webservices/axis2/trunk/c/guththila/src/guththila_writer_main.c
webservices/axis2/trunk/c/guththila/src/guththila_xml_pull_parser.c
Modified: webservices/axis2/trunk/c/guththila/src/guththila_reader.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_reader.c?view=diff&rev=447921&r1=447920&r2=447921
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_reader.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_reader.c Tue Sep 19 10:33:34 2006
@@ -1,139 +1,139 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-
-#include "guththila_reader.h"
-#include "guththila_defines.h"
-
-
-
-
-
-AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
-guththila_reader_create_for_file (axis2_env_t * environment,
- char *filename)
-{
- guththila_reader_impl_t *file_reader = NULL;
- if(!filename)
- return NULL;
-
- file_reader = (guththila_reader_impl_t *) AXIS2_MALLOC ( environment->allocator,
- sizeof (guththila_reader_impl_t));
- if(!file_reader)
- return NULL;
-
- file_reader->fp = fopen(filename,"r");
-
- if(!(file_reader->fp ))
- {
- AXIS2_FREE(environment->allocator,file_reader);
- return NULL;
- }
-
- file_reader->reader.guththila_reader_type = GUTHTHILA_FILE_READER;
-
- return &(file_reader->reader);
-}
-
-
-AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
-guththila_reader_create_for_io(
- axis2_env_t *environment,
- int (*input_read_callback)(char *buffer,int size,void* ctx),void* ctx)
-{
- guththila_reader_impl_t *io_reader =
- (guththila_reader_impl_t *) AXIS2_MALLOC (environment->allocator,
- sizeof (guththila_reader_impl_t));
- if(!io_reader)
- {
- return NULL;
- }
-
- io_reader->input_read_callback = input_read_callback;
- io_reader->context = ctx;
- io_reader->reader.guththila_reader_type = GUTHTHILA_IO_READER;
-
- return &(io_reader->reader);
-}
-
-AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
-guththila_reader_create_for_memory(
- axis2_env_t *environment,
- void *buffer,
- int size,
- void* ctx)
-{
- guththila_reader_impl_t *memory_reader =
- (guththila_reader_impl_t *) AXIS2_MALLOC (environment->allocator,
- sizeof (guththila_reader_impl_t));
- if(!memory_reader)
- {
- return NULL;
- }
-
- if (buffer)
- {
- memory_reader->buffer = (char *)buffer;
- memory_reader->buffer_size = strlen ((const char *) buffer);
- }
- memory_reader->context = ctx;
- memory_reader->reader.guththila_reader_type = GUTHTHILA_MEMORY_READER;
-
- return &(memory_reader->reader);
-}
-
-AXIS2_EXTERN void AXIS2_CALL
-guththila_reader_free (axis2_env_t * environment,
- guththila_reader_t * r)
-{
-
- if (!r)
- return;
-
- if(r->guththila_reader_type == GUTHTHILA_FILE_READER)
- {
- if(((guththila_reader_impl_t*)r)->fp)
- fclose(((guththila_reader_impl_t*)r)->fp);
- }
- AXIS2_FREE(environment->allocator, (guththila_reader_impl_t*)r);
- return;
-}
-
-
-AXIS2_EXTERN int AXIS2_CALL
-guththila_reader_read (axis2_env_t * environment,
- guththila_char_t * buffer,
- int offset,
- int length,
- guththila_reader_t * r)
-{
-
- if(r->guththila_reader_type == GUTHTHILA_FILE_READER)
- {
- return (int)fread (buffer + offset, 1, length,((guththila_reader_impl_t*)r)->fp);
- }
- else if(r->guththila_reader_type == GUTHTHILA_IO_READER)
- return ((guththila_reader_impl_t*)r)->input_read_callback((buffer + offset), length,
- ((guththila_reader_impl_t*)r)->context);
- else if (r->guththila_reader_type == GUTHTHILA_MEMORY_READER)
- {
- return ((guththila_reader_impl_t *)r)->buffer_size;
- }
-
- return GUTHTHILA_FAILURE;
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+
+
+#include "guththila_reader.h"
+#include "guththila_defines.h"
+
+
+
+
+
+AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
+guththila_reader_create_for_file (axis2_env_t * environment,
+ char *filename)
+{
+ guththila_reader_impl_t *file_reader = NULL;
+ if(!filename)
+ return NULL;
+
+ file_reader = (guththila_reader_impl_t *) AXIS2_MALLOC ( environment->allocator,
+ sizeof (guththila_reader_impl_t));
+ if(!file_reader)
+ return NULL;
+
+ file_reader->fp = fopen(filename,"r");
+
+ if(!(file_reader->fp ))
+ {
+ AXIS2_FREE(environment->allocator,file_reader);
+ return NULL;
+ }
+
+ file_reader->reader.guththila_reader_type = GUTHTHILA_FILE_READER;
+
+ return &(file_reader->reader);
+}
+
+
+AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
+guththila_reader_create_for_io(
+ axis2_env_t *environment,
+ int (*input_read_callback)(char *buffer,int size,void* ctx),void* ctx)
+{
+ guththila_reader_impl_t *io_reader =
+ (guththila_reader_impl_t *) AXIS2_MALLOC (environment->allocator,
+ sizeof (guththila_reader_impl_t));
+ if(!io_reader)
+ {
+ return NULL;
+ }
+
+ io_reader->input_read_callback = input_read_callback;
+ io_reader->context = ctx;
+ io_reader->reader.guththila_reader_type = GUTHTHILA_IO_READER;
+
+ return &(io_reader->reader);
+}
+
+AXIS2_EXTERN guththila_reader_t * AXIS2_CALL
+guththila_reader_create_for_memory(
+ axis2_env_t *environment,
+ void *buffer,
+ int size,
+ void* ctx)
+{
+ guththila_reader_impl_t *memory_reader =
+ (guththila_reader_impl_t *) AXIS2_MALLOC (environment->allocator,
+ sizeof (guththila_reader_impl_t));
+ if(!memory_reader)
+ {
+ return NULL;
+ }
+
+ if (buffer)
+ {
+ memory_reader->buffer = (char *)buffer;
+ memory_reader->buffer_size = strlen ((const char *) buffer);
+ }
+ memory_reader->context = ctx;
+ memory_reader->reader.guththila_reader_type = GUTHTHILA_MEMORY_READER;
+
+ return &(memory_reader->reader);
+}
+
+AXIS2_EXTERN void AXIS2_CALL
+guththila_reader_free (axis2_env_t * environment,
+ guththila_reader_t * r)
+{
+
+ if (!r)
+ return;
+
+ if(r->guththila_reader_type == GUTHTHILA_FILE_READER)
+ {
+ if(((guththila_reader_impl_t*)r)->fp)
+ fclose(((guththila_reader_impl_t*)r)->fp);
+ }
+ AXIS2_FREE(environment->allocator, (guththila_reader_impl_t*)r);
+ return;
+}
+
+
+AXIS2_EXTERN int AXIS2_CALL
+guththila_reader_read (axis2_env_t * environment,
+ guththila_char_t * buffer,
+ int offset,
+ int length,
+ guththila_reader_t * r)
+{
+
+ if(r->guththila_reader_type == GUTHTHILA_FILE_READER)
+ {
+ return (int)fread (buffer + offset, 1, length,((guththila_reader_impl_t*)r)->fp);
+ }
+ else if(r->guththila_reader_type == GUTHTHILA_IO_READER)
+ return ((guththila_reader_impl_t*)r)->input_read_callback((buffer + offset), length,
+ ((guththila_reader_impl_t*)r)->context);
+ else if (r->guththila_reader_type == GUTHTHILA_MEMORY_READER)
+ {
+ return ((guththila_reader_impl_t *)r)->buffer_size;
+ }
+
+ return GUTHTHILA_FAILURE;
+}
Modified: webservices/axis2/trunk/c/guththila/src/guththila_writer_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_writer_main.c?view=diff&rev=447921&r1=447920&r2=447921
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_writer_main.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_writer_main.c Tue Sep 19 10:33:34 2006
@@ -1,32 +1,32 @@
-#include <stdio.h>
-#include <guththila_buffer.h>
-#include <guththila_reader.h>
-#include <guththila.h>
-int main ()
-{
- axis2_allocator_t *allocator = axis2_allocator_init (NULL);
- axis2_env_t *env = axis2_env_create (allocator);
- guththila_t *parser = guththila_create (env, NULL);
- guththila_create_xml_stream_writer (env, parser, "w.xml");
- guththila_write_start_document (env, parser);
- guththila_write_start_element (env, parser, "person");
- guththila_write_start_element (env, parser, "name");
- guththila_write_characters (env, parser, "guththila");
- guththila_write_start_element (env, parser, "escape");
- guththila_write_escape_character (env, parser, "&");
- guththila_write_escape_character (env, parser, ">");
- guththila_write_end_element (env, parser);
- guththila_write_start_element (env, parser, "escape");
- guththila_write_default_namespace (env, parser, "http://www.cse.mrt.ac.lk");
- guththila_write_namespace (env, parser, "a", "http://ws.apache.org");
- guththila_write_attribute_with_prefix(env, parser, "a", "web", "false");
- guththila_write_start_element (env, parser, "one");
- guththila_write_start_element_with_prefix (env, parser, "a", "two");
- guththila_write_characters (env, parser, "it works !");
- guththila_write_end_document (env, parser);
- guththila_xml_writer_free (env, parser);
- guththila_free (env, parser);
- axis2_allocator_free (allocator);
- axis2_env_free (env);
- return 0;
-}
+#include <stdio.h>
+#include <guththila_buffer.h>
+#include <guththila_reader.h>
+#include <guththila.h>
+int main ()
+{
+ axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+ axis2_env_t *env = axis2_env_create (allocator);
+ guththila_t *parser = guththila_create (env, NULL);
+ guththila_create_xml_stream_writer (env, parser, "w.xml");
+ guththila_write_start_document (env, parser);
+ guththila_write_start_element (env, parser, "person");
+ guththila_write_start_element (env, parser, "name");
+ guththila_write_characters (env, parser, "guththila");
+ guththila_write_start_element (env, parser, "escape");
+ guththila_write_escape_character (env, parser, "&");
+ guththila_write_escape_character (env, parser, ">");
+ guththila_write_end_element (env, parser);
+ guththila_write_start_element (env, parser, "escape");
+ guththila_write_default_namespace (env, parser, "http://www.cse.mrt.ac.lk");
+ guththila_write_namespace (env, parser, "a", "http://ws.apache.org");
+ guththila_write_attribute_with_prefix(env, parser, "a", "web", "false");
+ guththila_write_start_element (env, parser, "one");
+ guththila_write_start_element_with_prefix (env, parser, "a", "two");
+ guththila_write_characters (env, parser, "it works !");
+ guththila_write_end_document (env, parser);
+ guththila_xml_writer_free (env, parser);
+ guththila_free (env, parser);
+ axis2_allocator_free (allocator);
+ axis2_env_free (env);
+ return 0;
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org