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 sh...@apache.org on 2009/08/18 13:08:44 UTC
svn commit: r805360 [7/13] - in /webservices/axis2/trunk/c/axiom/src:
attachments/ om/ parser/ parser/guththila/ parser/libxml2/ soap/ util/ xpath/
Modified: webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c?rev=805360&r1=805359&r2=805360&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c (original)
+++ webservices/axis2/trunk/c/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c Tue Aug 18 11:08:42 2009
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -27,12 +26,14 @@
axiom_xml_writer_t * writer,
const axutil_env_t * env);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_start_element(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_start_element(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * localname);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_end_start_element(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_end_start_element(
axiom_xml_writer_t * writer,
const axutil_env_t * env);
@@ -51,7 +52,8 @@
axis2_char_t * namespace_uri,
axis2_char_t * prefix);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_empty_element(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_empty_element(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * localname);
@@ -71,15 +73,18 @@
axis2_char_t * namespace_uri,
axis2_char_t * prefix);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_end_element(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_end_element(
axiom_xml_writer_t * writer,
const axutil_env_t * env);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_end_document(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_end_document(
axiom_xml_writer_t * writer,
const axutil_env_t * env);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_attribute(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_attribute(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * localname,
@@ -102,18 +107,21 @@
axis2_char_t * namespace_uri,
axis2_char_t * prefix);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_namespace(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_namespace(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * prefix,
axis2_char_t * namespace_uri);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_default_namespace(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_default_namespace(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * namespace_uri);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_comment(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_comment(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * value);
@@ -131,22 +139,26 @@
axis2_char_t * target,
axis2_char_t * data);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_cdata(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_cdata(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * data);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_dtd(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_dtd(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * dtd);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_entity_ref(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_entity_ref(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * name);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_start_document(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_start_document(
axiom_xml_writer_t * writer,
const axutil_env_t * env);
@@ -163,7 +175,8 @@
axis2_char_t * encoding,
axis2_char_t * version);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_characters(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_characters(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * text);
@@ -173,18 +186,21 @@
const axutil_env_t * env,
axis2_char_t * uri);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_set_prefix(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_set_prefix(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * prefix,
axis2_char_t * uri);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_set_default_prefix(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_set_default_prefix(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * uri);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_encoded(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_encoded(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * text,
@@ -202,12 +218,14 @@
axiom_xml_writer_t * writer,
const axutil_env_t * env);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_write_raw(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_write_raw(
axiom_xml_writer_t * writer,
const axutil_env_t * env,
axis2_char_t * content);
-axis2_status_t AXIS2_CALL guththila_xml_writer_wrapper_flush(
+axis2_status_t AXIS2_CALL
+guththila_xml_writer_wrapper_flush(
axiom_xml_writer_t * writer,
const axutil_env_t * env);
@@ -217,11 +235,9 @@
{
axiom_xml_writer_t writer;
guththila_xml_writer_t *wr;
-}
-guththila_xml_writer_wrapper_impl_t;
+} guththila_xml_writer_wrapper_impl_t;
-static const axiom_xml_writer_ops_t axiom_xml_writer_ops_var = {
- guththila_xml_writer_wrapper_free,
+static const axiom_xml_writer_ops_t axiom_xml_writer_ops_var = { guththila_xml_writer_wrapper_free,
guththila_xml_writer_wrapper_write_start_element,
guththila_xml_writer_wrapper_end_start_element,
guththila_xml_writer_wrapper_write_start_element_with_namespace,
@@ -230,8 +246,7 @@
guththila_xml_writer_wrapper_write_empty_element_with_namespace,
guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix,
guththila_xml_writer_wrapper_write_end_element,
- guththila_xml_writer_wrapper_write_end_document,
- guththila_xml_writer_wrapper_write_attribute,
+ guththila_xml_writer_wrapper_write_end_document, guththila_xml_writer_wrapper_write_attribute,
guththila_xml_writer_wrapper_write_attribute_with_namespace,
guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix,
guththila_xml_writer_wrapper_write_namespace,
@@ -239,23 +254,16 @@
guththila_xml_writer_wrapper_write_comment,
guththila_xml_writer_wrapper_write_processing_instruction,
guththila_xml_writer_wrapper_write_processing_instruction_data,
- guththila_xml_writer_wrapper_write_cdata,
- guththila_xml_writer_wrapper_write_dtd,
+ guththila_xml_writer_wrapper_write_cdata, guththila_xml_writer_wrapper_write_dtd,
guththila_xml_writer_wrapper_write_entity_ref,
guththila_xml_writer_wrapper_write_start_document,
guththila_xml_writer_wrapper_write_start_document_with_version,
guththila_xml_writer_wrapper_write_start_document_with_version_encoding,
- guththila_xml_writer_wrapper_write_characters,
- guththila_xml_writer_wrapper_get_prefix,
- guththila_xml_writer_wrapper_set_prefix,
- guththila_xml_writer_wrapper_set_default_prefix,
- guththila_xml_writer_wrapper_write_encoded,
- guththila_xml_writer_wrapper_get_xml,
- guththila_xml_writer_wrapper_get_xml_size,
- guththila_xml_writer_wrapper_get_type,
- guththila_xml_writer_wrapper_write_raw,
- guththila_xml_writer_wrapper_flush
-};
+ guththila_xml_writer_wrapper_write_characters, guththila_xml_writer_wrapper_get_prefix,
+ guththila_xml_writer_wrapper_set_prefix, guththila_xml_writer_wrapper_set_default_prefix,
+ guththila_xml_writer_wrapper_write_encoded, guththila_xml_writer_wrapper_get_xml,
+ guththila_xml_writer_wrapper_get_xml_size, guththila_xml_writer_wrapper_get_type,
+ guththila_xml_writer_wrapper_write_raw, guththila_xml_writer_wrapper_flush };
/****************************** Macros *******************************************/
@@ -275,10 +283,8 @@
AXIS2_ENV_CHECK(env, NULL);
- writer_impl =
- (guththila_xml_writer_wrapper_impl_t *) AXIS2_MALLOC(env->allocator,
- sizeof
- (guththila_xml_writer_wrapper_impl_t));
+ writer_impl = (guththila_xml_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator,
+ sizeof(guththila_xml_writer_wrapper_impl_t));
return &(writer_impl->writer);
}
@@ -294,12 +300,10 @@
AXIS2_ENV_CHECK(env, NULL);
- writer_impl =
- (guththila_xml_writer_wrapper_impl_t *) AXIS2_MALLOC(env->allocator,
- sizeof
- (guththila_xml_writer_wrapper_impl_t));
+ writer_impl = (guththila_xml_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator,
+ sizeof(guththila_xml_writer_wrapper_impl_t));
- if (!writer_impl)
+ if(!writer_impl)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
@@ -310,7 +314,7 @@
writer_impl->wr = guththila_create_xml_stream_writer_for_memory(env);
- if (!(writer_impl->wr))
+ if(!(writer_impl->wr))
{
AXIS2_FREE(env->allocator, writer_impl->wr);
AXIS2_FREE(env->allocator, writer_impl);
@@ -331,12 +335,12 @@
const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- if (AXIS2_INTF_TO_IMPL(writer)->wr)
+ if(AXIS2_INTF_TO_IMPL(writer)->wr)
{
guththila_xml_writer_free(AXIS2_INTF_TO_IMPL(writer)->wr, env);
}
- if (writer)
+ if(writer)
{
AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(writer));
}
@@ -352,8 +356,7 @@
int status = AXIS2_SUCCESS;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
- guththila_write_start_element(AXIS2_INTF_TO_IMPL(writer)->wr, localname,
- env);
+ guththila_write_start_element(AXIS2_INTF_TO_IMPL(writer)->wr, localname, env);
return status;
}
@@ -368,8 +371,8 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
- guththila_write_start_element_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr,
- namespace_uri, localname, env);
+ guththila_write_start_element_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri,
+ localname, env);
return status;
}
@@ -386,10 +389,7 @@
AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE);
guththila_write_start_element_with_prefix_and_namespace(AXIS2_INTF_TO_IMPL
- (writer)->wr,
- prefix,
- namespace_uri,
- localname, env);
+ (writer)->wr, prefix, namespace_uri, localname, env);
return AXIS2_SUCCESS;
}
@@ -402,8 +402,7 @@
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
- guththila_write_empty_element(AXIS2_INTF_TO_IMPL(writer)->wr, localname,
- env);
+ guththila_write_empty_element(AXIS2_INTF_TO_IMPL(writer)->wr, localname, env);
return AXIS2_SUCCESS;
}
@@ -417,8 +416,8 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
- guththila_write_empty_element_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr,
- namespace_uri, localname, env);
+ guththila_write_empty_element_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri,
+ localname, env);
return AXIS2_SUCCESS;
}
@@ -436,10 +435,7 @@
AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE);
guththila_write_empty_element_with_prefix_and_namespace(AXIS2_INTF_TO_IMPL
- (writer)->wr,
- prefix,
- namespace_uri,
- localname, env);
+ (writer)->wr, prefix, namespace_uri, localname, env);
return AXIS2_SUCCESS;
}
@@ -477,8 +473,7 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
- guththila_write_attribute(AXIS2_INTF_TO_IMPL(writer)->wr,
- localname, value, env);
+ guththila_write_attribute(AXIS2_INTF_TO_IMPL(writer)->wr, localname, value, env);
return AXIS2_SUCCESS;
}
@@ -497,9 +492,8 @@
AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
- guththila_write_attribute_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr,
- namespace_uri, localname, value,
- env);
+ guththila_write_attribute_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri,
+ localname, value, env);
return AXIS2_SUCCESS;
}
@@ -518,9 +512,7 @@
AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE);
guththila_write_attribute_with_prefix_and_namespace(AXIS2_INTF_TO_IMPL
- (writer)->wr, prefix,
- namespace_uri,
- localname, value, env);
+ (writer)->wr, prefix, namespace_uri, localname, value, env);
return AXIS2_SUCCESS;
}
@@ -534,12 +526,10 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
/* when default namespace comes is passed, prefix is null */
- if (prefix)
- guththila_write_namespace(AXIS2_INTF_TO_IMPL(writer)->wr,
- prefix, namespace_uri, env);
+ if(prefix)
+ guththila_write_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, prefix, namespace_uri, env);
else
- guththila_write_default_namespace(AXIS2_INTF_TO_IMPL(writer)->wr,
- namespace_uri, env);
+ guththila_write_default_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri, env);
return AXIS2_SUCCESS;
}
@@ -551,8 +541,7 @@
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE);
- guththila_write_default_namespace(AXIS2_INTF_TO_IMPL(writer)->wr,
- namespace_uri, env);
+ guththila_write_default_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri, env);
return AXIS2_SUCCESS;
}
@@ -640,8 +629,7 @@
const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env,
- NULL, NULL);
+ guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env, NULL, NULL);
return AXIS2_SUCCESS;
}
@@ -653,8 +641,7 @@
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, version, AXIS2_FAILURE);
- guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env,
- NULL, version);
+ guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env, NULL, version);
return AXIS2_SUCCESS;
}
@@ -668,8 +655,7 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, version, AXIS2_FAILURE);
- guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env,
- encoding, version);
+ guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env, encoding, version);
return AXIS2_SUCCESS;
}
@@ -693,8 +679,7 @@
{
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, uri, NULL);
- return guththila_get_prefix_for_namespace(AXIS2_INTF_TO_IMPL(writer)->wr,
- uri, env);
+ return guththila_get_prefix_for_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, uri, env);
}
axis2_status_t AXIS2_CALL
@@ -744,7 +729,7 @@
char *buffer = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
buffer = guththila_get_memory_buffer(AXIS2_INTF_TO_IMPL(writer)->wr, env);
- return (void *) buffer;
+ return (void *)buffer;
}
axis2_status_t AXIS2_CALL
@@ -753,14 +738,14 @@
const axutil_env_t * env,
axis2_char_t * content)
{
- if (!content)
+ if(!content)
{
return AXIS2_FAILURE;
}
else
{
- guththila_write_to_buffer(AXIS2_INTF_TO_IMPL(writer)->wr,
- (char *) content, (int) strlen(content), env);
+ guththila_write_to_buffer(AXIS2_INTF_TO_IMPL(writer)->wr, (char *)content, (int)strlen(
+ content), env);
return AXIS2_SUCCESS;
}
}
@@ -771,8 +756,7 @@
const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- return guththila_get_memory_buffer_size(AXIS2_INTF_TO_IMPL(writer)->wr,
- env);
+ return guththila_get_memory_buffer_size(AXIS2_INTF_TO_IMPL(writer)->wr, env);
}
int AXIS2_CALL
@@ -798,6 +782,6 @@
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
/* nothing to do ,
- it is automatically taken care by the libxml2 writer */
+ it is automatically taken care by the libxml2 writer */
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/axiom/src/parser/libxml2/libxml2_reader_wrapper.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/parser/libxml2/libxml2_reader_wrapper.c?rev=805360&r1=805359&r2=805360&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/parser/libxml2/libxml2_reader_wrapper.c (original)
+++ webservices/axis2/trunk/c/axiom/src/parser/libxml2/libxml2_reader_wrapper.c Tue Aug 18 11:08:42 2009
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -120,22 +119,26 @@
const axutil_env_t * env,
axis2_char_t * prefix);
-axis2_status_t axis2_libxml2_reader_wrapper_fill_maps(
+axis2_status_t
+axis2_libxml2_reader_wrapper_fill_maps(
axiom_xml_reader_t * parser,
const axutil_env_t * env);
-void axis2_libxml2_reader_wrapper_error_handler(
+void
+axis2_libxml2_reader_wrapper_error_handler(
void *arg,
const char *msg,
int severities,
void *locator_ptr);
-static int axis2_libxml2_reader_wrapper_read_input_callback(
+static int
+axis2_libxml2_reader_wrapper_read_input_callback(
void *ctx,
char *buffer,
int size);
-static int axis2_libxml2_reader_wrapper_close_input_callback(
+static int
+axis2_libxml2_reader_wrapper_close_input_callback(
void *ctx);
typedef struct axis2_libxml2_reader_wrapper_impl_t
@@ -159,82 +162,67 @@
AXIS2_CLOSE_INPUT_CALLBACK close_input_callback;
-}
-axis2_libxml2_reader_wrapper_impl_t;
+} axis2_libxml2_reader_wrapper_impl_t;
#define AXIS2_INTF_TO_IMPL(p) ((axis2_libxml2_reader_wrapper_impl_t*)p)
#define AXIS2_IMPL_TO_INTF(p) &(p->parser)
-static const axiom_xml_reader_ops_t axiom_xml_reader_ops_var = {
- axis2_libxml2_reader_wrapper_next,
- axis2_libxml2_reader_wrapper_free,
- axis2_libxml2_reader_wrapper_get_attribute_count,
+static const axiom_xml_reader_ops_t axiom_xml_reader_ops_var = { axis2_libxml2_reader_wrapper_next,
+ axis2_libxml2_reader_wrapper_free, axis2_libxml2_reader_wrapper_get_attribute_count,
axis2_libxml2_reader_wrapper_get_attribute_name_by_number,
axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number,
axis2_libxml2_reader_wrapper_get_attribute_value_by_number,
axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number,
- axis2_libxml2_reader_wrapper_get_value,
- axis2_libxml2_reader_wrapper_get_namespace_count,
+ axis2_libxml2_reader_wrapper_get_value, axis2_libxml2_reader_wrapper_get_namespace_count,
axis2_libxml2_reader_wrapper_get_namespace_uri_by_number,
axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number,
- axis2_libxml2_reader_wrapper_get_prefix,
- axis2_libxml2_reader_wrapper_get_name,
- axis2_libxml2_reader_wrapper_get_pi_target,
- axis2_libxml2_reader_wrapper_get_pi_data,
- axis2_libxml2_reader_wrapper_get_dtd,
- axis2_libxml2_reader_wrapper_xml_free,
+ axis2_libxml2_reader_wrapper_get_prefix, axis2_libxml2_reader_wrapper_get_name,
+ axis2_libxml2_reader_wrapper_get_pi_target, axis2_libxml2_reader_wrapper_get_pi_data,
+ axis2_libxml2_reader_wrapper_get_dtd, axis2_libxml2_reader_wrapper_xml_free,
axis2_libxml2_reader_wrapper_get_char_set_encoding,
axis2_libxml2_reader_wrapper_get_namespace_uri,
- axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix
-};
+ axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix };
static axis2_status_t
axis2_libxml2_reader_wrapper_init_map(
axis2_libxml2_reader_wrapper_impl_t * parser)
{
int i = 0;
- if (parser)
+ if(parser)
{
- for (i = 0; i < 18; i++)
+ for(i = 0; i < 18; i++)
{
parser->event_map[i] = -1;
}
- parser->event_map[XML_READER_TYPE_ELEMENT] =
- AXIOM_XML_READER_START_ELEMENT;
+ parser->event_map[XML_READER_TYPE_ELEMENT] = AXIOM_XML_READER_START_ELEMENT;
- parser->event_map[XML_READER_TYPE_ELEMENT] =
- AXIOM_XML_READER_START_ELEMENT;
+ parser->event_map[XML_READER_TYPE_ELEMENT] = AXIOM_XML_READER_START_ELEMENT;
- parser->event_map[XML_READER_TYPE_DOCUMENT] =
- AXIOM_XML_READER_START_DOCUMENT;
+ parser->event_map[XML_READER_TYPE_DOCUMENT] = AXIOM_XML_READER_START_DOCUMENT;
parser->event_map[XML_READER_TYPE_TEXT] = AXIOM_XML_READER_CHARACTER;
parser->event_map[XML_READER_TYPE_CDATA] = AXIOM_XML_READER_CHARACTER;
- parser->event_map[XML_READER_TYPE_SIGNIFICANT_WHITESPACE] =
- AXIOM_XML_READER_SPACE;
+ parser->event_map[XML_READER_TYPE_SIGNIFICANT_WHITESPACE] = AXIOM_XML_READER_SPACE;
parser->event_map[XML_READER_TYPE_WHITESPACE] = AXIOM_XML_READER_SPACE;
- parser->event_map[XML_READER_TYPE_END_ELEMENT] =
- AXIOM_XML_READER_END_ELEMENT;
+ parser->event_map[XML_READER_TYPE_END_ELEMENT] = AXIOM_XML_READER_END_ELEMENT;
- parser->event_map[XML_READER_TYPE_ENTITY_REFERENCE] =
- AXIOM_XML_READER_ENTITY_REFERENCE;
+ parser->event_map[XML_READER_TYPE_ENTITY_REFERENCE] = AXIOM_XML_READER_ENTITY_REFERENCE;
parser->event_map[XML_READER_TYPE_END_ENTITY] = AXIOM_XML_READER_SPACE;
parser->event_map[XML_READER_TYPE_ENTITY] = AXIOM_XML_READER_SPACE;
- parser->event_map[XML_READER_TYPE_PROCESSING_INSTRUCTION] =
- AXIOM_XML_READER_PROCESSING_INSTRUCTION;
+ parser->event_map[XML_READER_TYPE_PROCESSING_INSTRUCTION]
+ = AXIOM_XML_READER_PROCESSING_INSTRUCTION;
parser->event_map[XML_READER_TYPE_COMMENT] = AXIOM_XML_READER_COMMENT;
- parser->event_map[XML_READER_TYPE_DOCUMENT_TYPE] =
- AXIOM_XML_READER_DOCUMENT_TYPE;
+ parser->event_map[XML_READER_TYPE_DOCUMENT_TYPE] = AXIOM_XML_READER_DOCUMENT_TYPE;
return AXIS2_SUCCESS;
}
return AXIS2_FAILURE;
@@ -255,30 +243,30 @@
}
static axis2_libxml2_reader_wrapper_impl_t*
-libxml2_reader_wrapper_create(const axutil_env_t *env)
+libxml2_reader_wrapper_create(
+ const axutil_env_t *env)
{
- axis2_libxml2_reader_wrapper_impl_t *wrapper_impl = NULL;
- wrapper_impl = (axis2_libxml2_reader_wrapper_impl_t *)AXIS2_MALLOC(env->allocator,
- sizeof(axis2_libxml2_reader_wrapper_impl_t));
-
- if (!wrapper_impl)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create libxml2 reader wrapper");
- return NULL;
- }
- memset(wrapper_impl, 0, sizeof(axis2_libxml2_reader_wrapper_impl_t));
- wrapper_impl->attribute_map = NULL;
- wrapper_impl->namespace_map = NULL;
- wrapper_impl->close_input_callback = NULL;
- wrapper_impl->read_input_callback = NULL;
- wrapper_impl->ctx = NULL;
- wrapper_impl->current_namespace_count = 0;
- wrapper_impl->current_attribute_count = 0;
- wrapper_impl->current_event = -1;
- return wrapper_impl;
-}
+ axis2_libxml2_reader_wrapper_impl_t *wrapper_impl = NULL;
+ wrapper_impl = (axis2_libxml2_reader_wrapper_impl_t *)AXIS2_MALLOC(env->allocator,
+ sizeof(axis2_libxml2_reader_wrapper_impl_t));
+ if(!wrapper_impl)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create libxml2 reader wrapper");
+ return NULL;
+ }
+ memset(wrapper_impl, 0, sizeof(axis2_libxml2_reader_wrapper_impl_t));
+ wrapper_impl->attribute_map = NULL;
+ wrapper_impl->namespace_map = NULL;
+ wrapper_impl->close_input_callback = NULL;
+ wrapper_impl->read_input_callback = NULL;
+ wrapper_impl->ctx = NULL;
+ wrapper_impl->current_namespace_count = 0;
+ wrapper_impl->current_attribute_count = 0;
+ wrapper_impl->current_event = -1;
+ return wrapper_impl;
+}
AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL
axiom_xml_reader_create_for_file(
@@ -292,24 +280,21 @@
AXIS2_PARAM_CHECK(env->error, filename, NULL);
wrapper_impl = libxml2_reader_wrapper_create(env);
- if (!wrapper_impl)
+ if(!wrapper_impl)
{
return NULL;
}
wrapper_impl->reader = xmlReaderForFile(filename, encoding, XML_PARSE_RECOVER);
- if (!(wrapper_impl->reader))
+ if(!(wrapper_impl->reader))
{
AXIS2_FREE(env->allocator, wrapper_impl);
- AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_READER,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_READER, AXIS2_FAILURE);
return NULL;
}
xmlTextReaderSetErrorHandler(wrapper_impl->reader,
- (xmlTextReaderErrorFunc)
- axis2_libxml2_reader_wrapper_error_handler,
- (void *) env);
+ (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler, (void *)env);
wrapper_impl->current_event = -1;
wrapper_impl->ctx = NULL;
axis2_libxml2_reader_wrapper_init_map(wrapper_impl);
@@ -330,13 +315,13 @@
AXIS2_ENV_CHECK(env, NULL);
- if (!read_input_callback)
+ if(!read_input_callback)
{
return NULL;
}
wrapper_impl = libxml2_reader_wrapper_create(env);
- if (!wrapper_impl)
+ if(!wrapper_impl)
{
return NULL;
}
@@ -345,32 +330,26 @@
wrapper_impl->read_input_callback = read_input_callback;
wrapper_impl->close_input_callback = close_input_callback;
wrapper_impl->ctx = ctx;
- if (wrapper_impl->close_input_callback)
+ if(wrapper_impl->close_input_callback)
{
- wrapper_impl->reader =
- xmlReaderForIO(axis2_libxml2_reader_wrapper_read_input_callback,
- axis2_libxml2_reader_wrapper_close_input_callback,
- wrapper_impl, NULL, encoding, XML_PARSE_RECOVER);
+ wrapper_impl->reader = xmlReaderForIO(axis2_libxml2_reader_wrapper_read_input_callback,
+ axis2_libxml2_reader_wrapper_close_input_callback, wrapper_impl, NULL, encoding,
+ XML_PARSE_RECOVER);
}
else
{
- wrapper_impl->reader =
- xmlReaderForIO(axis2_libxml2_reader_wrapper_read_input_callback,
- NULL, wrapper_impl, NULL, encoding,
- XML_PARSE_RECOVER);
+ wrapper_impl->reader = xmlReaderForIO(axis2_libxml2_reader_wrapper_read_input_callback,
+ NULL, wrapper_impl, NULL, encoding, XML_PARSE_RECOVER);
}
- if (!(wrapper_impl->reader))
+ if(!(wrapper_impl->reader))
{
AXIS2_FREE(env->allocator, wrapper_impl);
- AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_READER,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_READER, AXIS2_FAILURE);
return NULL;
}
xmlTextReaderSetErrorHandler(wrapper_impl->reader,
- (xmlTextReaderErrorFunc)
- axis2_libxml2_reader_wrapper_error_handler,
- (void *) env);
+ (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler, (void *)env);
wrapper_impl->current_event = -1;
@@ -393,7 +372,7 @@
AXIS2_PARAM_CHECK(env->error, container, NULL);
wrapper_impl = libxml2_reader_wrapper_create(env);
- if (!wrapper_impl)
+ if(!wrapper_impl)
{
return NULL;
}
@@ -401,38 +380,33 @@
wrapper_impl->read_input_callback = NULL;
wrapper_impl->ctx = NULL;
- if (AXIS2_XML_PARSER_TYPE_BUFFER == type)
+ if(AXIS2_XML_PARSER_TYPE_BUFFER == type)
{
- wrapper_impl->reader =
- xmlReaderForMemory((axis2_char_t *) container, size, NULL, encoding,
- XML_PARSE_RECOVER);
+ wrapper_impl->reader = xmlReaderForMemory((axis2_char_t *)container, size, NULL, encoding,
+ XML_PARSE_RECOVER);
}
- else if (AXIS2_XML_PARSER_TYPE_DOC == type)
+ else if(AXIS2_XML_PARSER_TYPE_DOC == type)
{
- wrapper_impl->reader = xmlReaderWalker((xmlDocPtr) container);
+ wrapper_impl->reader = xmlReaderWalker((xmlDocPtr)container);
}
else
{
AXIS2_FREE(env->allocator, wrapper_impl);
- AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_XML_PARSER_INVALID_MEM_TYPE,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_XML_PARSER_INVALID_MEM_TYPE, AXIS2_FAILURE);
return NULL;
}
- if (!(wrapper_impl->reader))
+ if(!(wrapper_impl->reader))
{
AXIS2_FREE(env->allocator, wrapper_impl);
- AXIS2_HANDLE_ERROR(env,
- AXIS2_ERROR_CREATING_XML_STREAM_READER, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_READER, AXIS2_FAILURE);
return NULL;
}
- if (AXIS2_XML_PARSER_TYPE_BUFFER == type)
+ if(AXIS2_XML_PARSER_TYPE_BUFFER == type)
{
xmlTextReaderSetErrorHandler(wrapper_impl->reader,
- (xmlTextReaderErrorFunc)
- axis2_libxml2_reader_wrapper_error_handler,
- (void *) env);
+ (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler, (void *)env);
}
wrapper_impl->current_event = -1;
@@ -455,30 +429,29 @@
AXIS2_ENV_CHECK(env, -1);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
ret_val = xmlTextReaderRead(parser_impl->reader);
- if (ret_val == 0)
+ if(ret_val == 0)
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "xml stream is over ");
}
- if (ret_val == -1)
+ if(ret_val == -1)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- " error occurred in reading xml stream ");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, " error occurred in reading xml stream ");
return -1;
}
- if (ret_val == 1)
+ if(ret_val == 1)
{
node = xmlTextReaderNodeType(parser_impl->reader);
parser_impl->current_event = parser_impl->event_map[node];
parser_impl->current_attribute_count = 0;
parser_impl->current_namespace_count = 0;
- if (node == XML_READER_TYPE_ELEMENT)
+ if(node == XML_READER_TYPE_ELEMENT)
{
empty_check = xmlTextReaderIsEmptyElement(parser_impl->reader);
axis2_libxml2_reader_wrapper_fill_maps(parser, env);
}
- if (empty_check == 1)
+ if(empty_check == 1)
{
parser_impl->current_event = AXIOM_XML_READER_EMPTY_ELEMENT;
return AXIOM_XML_READER_EMPTY_ELEMENT;
@@ -491,42 +464,41 @@
}
}
-
/**
-* If your application crashes here, it may be due to an earlier call to
-* xmlCleanupParser() function. In client API, op_client create function has a call
-* to axiom_xml_reader_init and op_client_free function has a call to axiom_xml_reader_cleanup
-* function. You can avoid the call to axiom_xml_reader_cleanup using
-* axis2_options_set_xml_parser_reset function in client API.
-* refer to jira issue: https://issues.apache.org/jira/browse/AXIS2C-884
-*/
+ * If your application crashes here, it may be due to an earlier call to
+ * xmlCleanupParser() function. In client API, op_client create function has a call
+ * to axiom_xml_reader_init and op_client_free function has a call to axiom_xml_reader_cleanup
+ * function. You can avoid the call to axiom_xml_reader_cleanup using
+ * axis2_options_set_xml_parser_reset function in client API.
+ * refer to jira issue: https://issues.apache.org/jira/browse/AXIS2C-884
+ */
void AXIS2_CALL
axis2_libxml2_reader_wrapper_free(
axiom_xml_reader_t * parser,
const axutil_env_t * env)
{
- axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
- parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->ctx)
+ axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
+ parser_impl = AXIS2_INTF_TO_IMPL(parser);
+ if(parser_impl->ctx)
{
AXIS2_FREE(env->allocator, parser_impl->ctx);
}
- if (parser_impl->reader)
+ if(parser_impl->reader)
{
xmlTextReaderClose(parser_impl->reader);
xmlFreeTextReader(parser_impl->reader);
}
- if(parser_impl->namespace_map)
- {
- AXIS2_FREE(env->allocator,parser_impl->namespace_map);
- parser_impl->namespace_map = NULL;
- }
- if(parser_impl->attribute_map)
- {
- AXIS2_FREE(env->allocator, parser_impl->attribute_map);
- parser_impl->attribute_map = NULL;
- }
+ if(parser_impl->namespace_map)
+ {
+ AXIS2_FREE(env->allocator, parser_impl->namespace_map);
+ parser_impl->namespace_map = NULL;
+ }
+ if(parser_impl->attribute_map)
+ {
+ AXIS2_FREE(env->allocator, parser_impl->attribute_map);
+ parser_impl->attribute_map = NULL;
+ }
AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(parser));
return;
}
@@ -539,8 +511,8 @@
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_event == AXIOM_XML_READER_START_ELEMENT ||
- parser_impl->current_event == AXIOM_XML_READER_EMPTY_ELEMENT)
+ if(parser_impl->current_event == AXIOM_XML_READER_START_ELEMENT || parser_impl->current_event
+ == AXIOM_XML_READER_EMPTY_ELEMENT)
{
return parser_impl->current_attribute_count;
}
@@ -560,14 +532,13 @@
AXIS2_ENV_CHECK(env, NULL);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_attribute_count > 0 &&
- parser_impl->current_attribute_count >= i)
+ if(parser_impl->current_attribute_count > 0 && parser_impl->current_attribute_count >= i)
{
- int ret = xmlTextReaderMoveToAttributeNo(parser_impl->reader,
- parser_impl->attribute_map[i]);
- if (ret == 1)
+ int ret =
+ xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->attribute_map[i]);
+ if(ret == 1)
{
- return (axis2_char_t *) xmlTextReaderLocalName(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader);
}
else
{
@@ -587,14 +558,13 @@
AXIS2_ENV_CHECK(env, NULL);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_attribute_count > 0 &&
- parser_impl->current_attribute_count >= i)
+ if(parser_impl->current_attribute_count > 0 && parser_impl->current_attribute_count >= i)
{
- int ret = xmlTextReaderMoveToAttributeNo(parser_impl->reader,
- parser_impl->attribute_map[i]);
- if (ret == 1)
+ int ret =
+ xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->attribute_map[i]);
+ if(ret == 1)
{
- return (axis2_char_t *) xmlTextReaderPrefix(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderPrefix(parser_impl->reader);
}
else
{
@@ -615,14 +585,13 @@
AXIS2_ENV_CHECK(env, NULL);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_attribute_count > 0 &&
- parser_impl->current_attribute_count >= i)
+ if(parser_impl->current_attribute_count > 0 && parser_impl->current_attribute_count >= i)
{
- int ret = xmlTextReaderMoveToAttributeNo(parser_impl->reader,
- parser_impl->attribute_map[i]);
- if (ret == 1)
+ int ret =
+ xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->attribute_map[i]);
+ if(ret == 1)
{
- return (axis2_char_t *) xmlTextReaderValue(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderValue(parser_impl->reader);
}
else
{
@@ -642,16 +611,14 @@
AXIS2_ENV_CHECK(env, NULL);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_attribute_count > 0 &&
- parser_impl->current_attribute_count >= i)
+ if(parser_impl->current_attribute_count > 0 && parser_impl->current_attribute_count >= i)
{
- int ret = xmlTextReaderMoveToAttributeNo(parser_impl->reader,
- parser_impl->attribute_map[i]);
+ int ret =
+ xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->attribute_map[i]);
- if (ret == 1)
+ if(ret == 1)
{
- return (axis2_char_t *) xmlTextReaderNamespaceUri(parser_impl->
- reader);
+ return (axis2_char_t *)xmlTextReaderNamespaceUri(parser_impl-> reader);
}
else
{
@@ -670,7 +637,7 @@
AXIS2_ENV_CHECK(env, NULL);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- return (axis2_char_t *) xmlTextReaderValue(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderValue(parser_impl->reader);
}
@@ -682,8 +649,8 @@
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_event == AXIOM_XML_READER_START_ELEMENT ||
- parser_impl->current_event == AXIOM_XML_READER_EMPTY_ELEMENT)
+ if(parser_impl->current_event == AXIOM_XML_READER_START_ELEMENT || parser_impl->current_event
+ == AXIOM_XML_READER_EMPTY_ELEMENT)
{
return parser_impl->current_namespace_count;
}
@@ -703,15 +670,14 @@
AXIS2_ENV_CHECK(env, NULL);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_namespace_count > 0 &&
- parser_impl->current_namespace_count >= i)
+ if(parser_impl->current_namespace_count > 0 && parser_impl->current_namespace_count >= i)
{
- int ret = xmlTextReaderMoveToAttributeNo(parser_impl->reader,
- parser_impl->namespace_map[i]);
- if (ret == 1)
+ int ret =
+ xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->namespace_map[i]);
+ if(ret == 1)
{
- return (axis2_char_t *) xmlTextReaderValue(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderValue(parser_impl->reader);
}
else
return NULL;
@@ -729,15 +695,14 @@
AXIS2_ENV_CHECK(env, NULL);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_namespace_count > 0 &&
- parser_impl->current_namespace_count >= i)
+ if(parser_impl->current_namespace_count > 0 && parser_impl->current_namespace_count >= i)
{
- int ret = xmlTextReaderMoveToAttributeNo(parser_impl->reader,
- parser_impl->namespace_map[i]);
+ int ret =
+ xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->namespace_map[i]);
- if (ret == 1)
+ if(ret == 1)
{
- return (axis2_char_t *) xmlTextReaderLocalName(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader);
}
else
{
@@ -755,7 +720,7 @@
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
parser_impl = AXIS2_INTF_TO_IMPL(parser);
xmlTextReaderMoveToElement(parser_impl->reader);
- return (axis2_char_t *) xmlTextReaderPrefix(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderPrefix(parser_impl->reader);
}
axis2_char_t *AXIS2_CALL
@@ -766,7 +731,7 @@
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
parser_impl = AXIS2_INTF_TO_IMPL(parser);
xmlTextReaderMoveToElement(parser_impl->reader);
- return (axis2_char_t *) xmlTextReaderLocalName(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader);
}
axis2_char_t *AXIS2_CALL
@@ -776,9 +741,9 @@
{
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_event == AXIOM_XML_READER_PROCESSING_INSTRUCTION)
+ if(parser_impl->current_event == AXIOM_XML_READER_PROCESSING_INSTRUCTION)
{
- return (axis2_char_t *) xmlTextReaderLocalName(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader);
}
else
{
@@ -793,9 +758,9 @@
{
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_event == AXIOM_XML_READER_DOCUMENT_TYPE)
+ if(parser_impl->current_event == AXIOM_XML_READER_DOCUMENT_TYPE)
{
- return (axis2_char_t *) xmlTextReaderLocalName(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader);
}
else
{
@@ -810,9 +775,9 @@
{
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (parser_impl->current_event == AXIOM_XML_READER_PROCESSING_INSTRUCTION)
+ if(parser_impl->current_event == AXIOM_XML_READER_PROCESSING_INSTRUCTION)
{
- return (axis2_char_t *) xmlTextReaderValue(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderValue(parser_impl->reader);
}
else
{
@@ -827,7 +792,7 @@
void *data)
{
AXIS2_ENV_CHECK(env, void);
- if (data)
+ if(data)
xmlFree(data);
return;
}
@@ -839,7 +804,7 @@
{
axis2_libxml2_reader_wrapper_impl_t *reader_impl = NULL;
reader_impl = AXIS2_INTF_TO_IMPL(parser);
- return (axis2_char_t *) xmlTextReaderConstEncoding(reader_impl->reader);
+ return (axis2_char_t *)xmlTextReaderConstEncoding(reader_impl->reader);
}
axis2_char_t *AXIS2_CALL
@@ -849,7 +814,7 @@
{
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- return (axis2_char_t *) xmlTextReaderNamespaceUri(parser_impl->reader);
+ return (axis2_char_t *)xmlTextReaderNamespaceUri(parser_impl->reader);
}
axis2_char_t *AXIS2_CALL
@@ -860,13 +825,12 @@
{
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
parser_impl = AXIS2_INTF_TO_IMPL(parser);
- if (!prefix || axutil_strcmp(prefix, "") == 0)
+ if(!prefix || axutil_strcmp(prefix, "") == 0)
{
return NULL;
}
- return (axis2_char_t *) xmlTextReaderLookupNamespace(parser_impl->reader,
- (const xmlChar *)
- prefix);
+ return (axis2_char_t *)xmlTextReaderLookupNamespace(parser_impl->reader,
+ (const xmlChar *)prefix);
}
axis2_status_t
@@ -880,48 +844,47 @@
int i = 0;
char *q_name = NULL;
axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL;
- int map_size = 0;
+ int map_size = 0;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
parser_impl = AXIS2_INTF_TO_IMPL(parser);
libxml2_attribute_count = xmlTextReaderAttributeCount(parser_impl->reader);
- if (libxml2_attribute_count == 0)
+ if(libxml2_attribute_count == 0)
{
- parser_impl->current_attribute_count = 0;
- parser_impl->current_namespace_count = 0;
+ parser_impl->current_attribute_count = 0;
+ parser_impl->current_namespace_count = 0;
return AXIS2_SUCCESS;
}
- map_size = libxml2_attribute_count +1;
- if(parser_impl->namespace_map)
- {
- AXIS2_FREE(env->allocator, parser_impl->namespace_map);
- parser_impl->namespace_map = NULL;
- }
- if(parser_impl->attribute_map)
- {
- AXIS2_FREE(env->allocator, parser_impl->attribute_map);
- parser_impl->attribute_map = NULL;
- }
- parser_impl->attribute_map = AXIS2_MALLOC(env->allocator, sizeof(int)* map_size);
- memset(parser_impl->attribute_map, 0, map_size*sizeof(int));
-
- parser_impl->namespace_map = AXIS2_MALLOC(env->allocator, sizeof(int)*map_size);
- memset(parser_impl->namespace_map,0, map_size*sizeof(int));
-
- for (i = 0; i < map_size ; i++)
+ map_size = libxml2_attribute_count + 1;
+ if(parser_impl->namespace_map)
+ {
+ AXIS2_FREE(env->allocator, parser_impl->namespace_map);
+ parser_impl->namespace_map = NULL;
+ }
+ if(parser_impl->attribute_map)
+ {
+ AXIS2_FREE(env->allocator, parser_impl->attribute_map);
+ parser_impl->attribute_map = NULL;
+ }
+ parser_impl->attribute_map = AXIS2_MALLOC(env->allocator, sizeof(int) * map_size);
+ memset(parser_impl->attribute_map, 0, map_size * sizeof(int));
+
+ parser_impl->namespace_map = AXIS2_MALLOC(env->allocator, sizeof(int) * map_size);
+ memset(parser_impl->namespace_map, 0, map_size * sizeof(int));
+
+ for(i = 0; i < map_size; i++)
{
parser_impl->namespace_map[i] = -1;
parser_impl->attribute_map[i] = -1;
}
- for (i = 0; i < libxml2_attribute_count; i++)
+ for(i = 0; i < libxml2_attribute_count; i++)
{
xmlTextReaderMoveToAttributeNo(parser_impl->reader, i);
- q_name = (char *) xmlTextReaderName(parser_impl->reader);
- if (q_name)
+ q_name = (char *)xmlTextReaderName(parser_impl->reader);
+ if(q_name)
{
- if ((strcmp(q_name, "xmlns") == 0) ||
- (strncmp(q_name, "xmlns:", 6) == 0))
+ if((strcmp(q_name, "xmlns") == 0) || (strncmp(q_name, "xmlns:", 6) == 0))
{
/* found a namespace */
ns_count++;
@@ -950,9 +913,8 @@
char *buffer,
int size)
{
- return ((axis2_libxml2_reader_wrapper_impl_t *) ctx)->
- read_input_callback(buffer, size,
- ((axis2_libxml2_reader_wrapper_impl_t *) ctx)->ctx);
+ return ((axis2_libxml2_reader_wrapper_impl_t *)ctx)-> read_input_callback(buffer, size,
+ ((axis2_libxml2_reader_wrapper_impl_t *)ctx)->ctx);
}
void
@@ -963,36 +925,32 @@
void *locator_ptr)
{
const axutil_env_t *env = NULL;
- env = (const axutil_env_t *) arg;
+ env = (const axutil_env_t *)arg;
- switch (severities)
+ switch(severities)
{
- case XML_PARSER_SEVERITY_VALIDITY_WARNING:
+ case XML_PARSER_SEVERITY_VALIDITY_WARNING:
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s VALIDITY WARNTING",
- msg);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s VALIDITY WARNTING", msg);
}
- break;
- case XML_PARSER_SEVERITY_VALIDITY_ERROR:
+ break;
+ case XML_PARSER_SEVERITY_VALIDITY_ERROR:
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- VALIDITY ERROR",
- msg);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- VALIDITY ERROR", msg);
}
- break;
- case XML_PARSER_SEVERITY_WARNING:
+ break;
+ case XML_PARSER_SEVERITY_WARNING:
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- VALIDITY ERROR",
- msg);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- VALIDITY ERROR", msg);
}
- break;
- case XML_PARSER_SEVERITY_ERROR:
+ break;
+ case XML_PARSER_SEVERITY_ERROR:
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- SEVERITY_ERROR",
- msg);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- SEVERITY_ERROR", msg);
}
- break;
- default:
- break;
+ break;
+ default:
+ break;
}
}
@@ -1000,7 +958,6 @@
axis2_libxml2_reader_wrapper_close_input_callback(
void *ctx)
{
- return ((axis2_libxml2_reader_wrapper_impl_t *) ctx)->
- close_input_callback(((axis2_libxml2_reader_wrapper_impl_t *) ctx)->
- ctx);
+ return ((axis2_libxml2_reader_wrapper_impl_t *)ctx)-> close_input_callback(
+ ((axis2_libxml2_reader_wrapper_impl_t *)ctx)-> ctx);
}