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 du...@apache.org on 2007/03/13 10:45:52 UTC
svn commit: r517618 - in /webservices/axis2/trunk/c/axiom:
include/axiom_processing_instruction.h src/om/om_node.c
src/om/om_processing_instruction.c
Author: dushshantha
Date: Tue Mar 13 02:45:51 2007
New Revision: 517618
URL: http://svn.apache.org/viewvc?view=rev&rev=517618
Log:
removed macros and corrected indentation
Modified:
webservices/axis2/trunk/c/axiom/include/axiom_processing_instruction.h
webservices/axis2/trunk/c/axiom/src/om/om_node.c
webservices/axis2/trunk/c/axiom/src/om/om_processing_instruction.c
Modified: webservices/axis2/trunk/c/axiom/include/axiom_processing_instruction.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/include/axiom_processing_instruction.h?view=diff&rev=517618&r1=517617&r2=517618
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_processing_instruction.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_processing_instruction.h Tue Mar 13 02:45:51 2007
@@ -18,11 +18,6 @@
#ifndef AXIOM_PI_H
#define AXIOM_PI_H
-/**
- * @file axiom_processing_instruction.h
- * @brief represents a xml processing instruction also known as PI
- */
-
#include <axiom_node.h>
#include <axiom_output.h>
@@ -47,16 +42,16 @@
* @param target target of the processing instruction.cannot be NULL.
* @param value value of the processing instruction.cannot be NULL.
* @param node This is an out parameter. cannot be NULL.
- * Returns the node corresponding to the comment created.
- * Node type will be set to AXIOM_PROCESSING_INSTRUCTION
+ * Returns the node corresponding to the comment created.
+ * Node type will be set to AXIOM_PROCESSING_INSTRUCTION
* @return a pointer tonewly created processing instruction struct
*/
AXIS2_EXTERN axiom_processing_instruction_t * AXIS2_CALL
axiom_processing_instruction_create(const axis2_env_t *env,
- axiom_node_t * parent,
- const axis2_char_t * target,
- const axis2_char_t * value,
- axiom_node_t ** node);
+ axiom_node_t * parent,
+ const axis2_char_t * target,
+ const axis2_char_t * value,
+ axiom_node_t ** node);
/**
* Frees an instance of axiom_processing_instruction
@@ -66,42 +61,44 @@
*/
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_processing_instruction_free(struct axiom_processing_instruction * om_pi,
- const axis2_env_t *env);
+ const axis2_env_t *env);
+
/**
- * set processing instruction data
- *@param om_pi
- *@param env
- *@param value
+ * Set processing instruction data
+ * @param om_pi
+ * @param env
+ * @param value
*/
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_processing_instruction_set_value(struct axiom_processing_instruction *om_pi,
- const axis2_env_t *env,
- const axis2_char_t* value);
+ const axis2_env_t *env,
+ const axis2_char_t* value);
+
/**
- * set processing instruction target
- *@param om_pi processing_instruction struct
- *@param env environment, MUST NOT be NULL.
- *@param target
- *@return status of the op AXIS2_SUCCESS on success,
- * AXIS2_FAILURE on error.
+ * Set processing instruction target
+ * @param om_pi processing_instruction struct
+ * @param env environment, MUST NOT be NULL.
+ * @param target
+ * @return status of the op AXIS2_SUCCESS on success,
+ * AXIS2_FAILURE on error.
*/
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_processing_instruction_set_target(struct axiom_processing_instruction *om_pi,
- const axis2_env_t *env,
- const axis2_char_t* target);
+ const axis2_env_t *env,
+ const axis2_char_t* target);
+
/**
- * get PI target
+ * Get PI target
* @param om_pi processing_instruction struct
* @param env environment
* @return target text , NULL on error or if target is null
*/
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axiom_processing_instruction_get_target(struct axiom_processing_instruction *om_pi,
- const axis2_env_t *env);
+ const axis2_env_t *env);
+
/**
- * get data part of processing_instruction
+ * Get data part of processing_instruction
* @param om_pi processing instruction
* @param env environment , MUST NOT be NULL.
* @return data text , NULL if there is no data,
@@ -111,36 +108,17 @@
const axis2_env_t *env);
/**
- * serialize function
+ * Serialize function
* @param om_pi processing_instruction struct
* @param env environment, MUST NOT be NULL.
* @param om_output om_output handler struct
* @return status of the op, AXIS2_SUCCESS on success,
- * AXIS2_FAILURE on error
+ * AXIS2_FAILURE on error
*/
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_processing_instruction_serialize(struct axiom_processing_instruction *om_pi,
- const axis2_env_t *env,
- axiom_output_t *om_output);
-
- /** frees given processing instruction */
-#define AXIOM_PROCESSING_INSTRUCTION_FREE(pi, env) \
- axiom_processing_instruction_free(pi, env)
- /** set data text of processing_instruction */
-#define AXIOM_PROCESSING_INSTRUCION_SET_VALUE(pi, env, value) \
- axiom_processing_instruction_set_value(pi,env,value)
- /** get data text of processing_instruction */
-#define AXIOM_PROCESSING_INSTRUCTION_GET_VALUE(pi, env) \
- axiom_processing_instruction_get_value(pi, env)
- /** set target of processing instruction */
-#define AXIOM_PROCESSING_INSTRUCION_SET_TARGET(pi, env, value) \
- axiom_processing_instruction_set_target(pi, env, value)
- /** get target text */
-#define AXIOM_PROCESSING_INSTRUCTION_GET_TARGET(pi, env) \
- axiom_processing_instruction_get_target(pi, env)
- /** serialize */
-#define AXIOM_PROCESSING_INSTRUCTION_SERIALIZE(pi, env, om_output) \
- axiom_processing_instruction_serialize(pi, env, om_output)
+ const axis2_env_t *env,
+ axiom_output_t *om_output);
/** @} */
#ifdef __cplusplus
Modified: webservices/axis2/trunk/c/axiom/src/om/om_node.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_node.c?view=diff&rev=517618&r1=517617&r2=517618
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_node.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_node.c Tue Mar 13 02:45:51 2007
@@ -123,7 +123,7 @@
else if (om_node->node_type == AXIOM_PROCESSING_INSTRUCTION)
{
if (om_node->data_element)
- AXIOM_PROCESSING_INSTRUCTION_FREE(
+ axiom_processing_instruction_free(
(axiom_processing_instruction_t*)(om_node->data_element), env);
}
else if (om_node->node_type == AXIOM_TEXT)
@@ -401,7 +401,7 @@
{
if (om_node->data_element)
{
- status = AXIOM_PROCESSING_INSTRUCTION_SERIALIZE(
+ status = axiom_processing_instruction_serialize(
(axiom_processing_instruction_t*)(om_node->data_element),
env, om_output);
}
Modified: webservices/axis2/trunk/c/axiom/src/om/om_processing_instruction.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_processing_instruction.c?view=diff&rev=517618&r1=517617&r2=517618
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_processing_instruction.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_processing_instruction.c Tue Mar 13 02:45:51 2007
@@ -29,17 +29,18 @@
AXIS2_EXTERN axiom_processing_instruction_t *AXIS2_CALL
axiom_processing_instruction_create(const axis2_env_t *env,
- axiom_node_t * parent,
- const axis2_char_t * target,
- const axis2_char_t * value,
- axiom_node_t ** node)
+ axiom_node_t * parent,
+ const axis2_char_t * target,
+ const axis2_char_t * value,
+ axiom_node_t ** node)
{
axiom_processing_instruction_t *processing_instruction = NULL;
AXIS2_ENV_CHECK(env, NULL);
if (!node || !target || !value)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return NULL;
}
@@ -51,8 +52,9 @@
return NULL;
}
- processing_instruction = (axiom_processing_instruction_t *) AXIS2_MALLOC(
- env->allocator, sizeof(axiom_processing_instruction_t));
+ processing_instruction =
+ (axiom_processing_instruction_t *) AXIS2_MALLOC(env->allocator,
+ sizeof(axiom_processing_instruction_t));
if (!processing_instruction)
{
@@ -100,7 +102,7 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_processing_instruction_free(axiom_processing_instruction_t *om_pi,
- const axis2_env_t *env)
+ const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -122,8 +124,8 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_processing_instruction_set_value(axiom_processing_instruction_t *om_pi,
- const axis2_env_t *env,
- const axis2_char_t *value)
+ const axis2_env_t *env,
+ const axis2_char_t *value)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
@@ -134,50 +136,49 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_processing_instruction_set_target(axiom_processing_instruction_t *om_pi,
- const axis2_env_t *env,
- const axis2_char_t *target)
+ const axis2_env_t *env,
+ const axis2_char_t *target)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, target, AXIS2_FAILURE);
om_pi->target = (axis2_char_t*)AXIS2_STRDUP(target, env);
return AXIS2_SUCCESS;
-
}
-AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
axiom_processing_instruction_get_value(axiom_processing_instruction_t *om_pi,
- const axis2_env_t *env)
+ const axis2_env_t *env)
{
- AXIS2_ENV_CHECK(env, NULL);
return om_pi->value;
}
-AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
axiom_processing_instruction_get_target(axiom_processing_instruction_t *om_pi,
- const axis2_env_t *env)
+ const axis2_env_t *env)
{
- AXIS2_ENV_CHECK(env, NULL);
return om_pi->target;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_processing_instruction_serialize
-(axiom_processing_instruction_t *om_pi,
- const axis2_env_t *env,
- axiom_output_t *om_output)
+axiom_processing_instruction_serialize(axiom_processing_instruction_t *om_pi,
+ const axis2_env_t *env,
+ axiom_output_t *om_output)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE);
if (om_pi->target && om_pi->value)
+ {
return axiom_output_write(om_output, env,
- AXIOM_PROCESSING_INSTRUCTION,
- 2, om_pi->target, om_pi->value);
-
+ AXIOM_PROCESSING_INSTRUCTION,
+ 2, om_pi->target, om_pi->value);
+ }
else if (om_pi->target)
+ {
return axiom_output_write(om_output, env,
- AXIOM_PROCESSING_INSTRUCTION,
- 2, om_pi->target, om_pi->value);
+ AXIOM_PROCESSING_INSTRUCTION,
+ 2, om_pi->target, om_pi->value);
+ }
return AXIS2_FAILURE;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org