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 pi...@apache.org on 2006/08/23 07:12:40 UTC
svn commit: r433906 - in /webservices/axis2/trunk/c:
include/axis2_phase_holder.h modules/core/phaseresolver/phase_holder.c
Author: pini
Date: Tue Aug 22 22:12:39 2006
New Revision: 433906
URL: http://svn.apache.org/viewvc?rev=433906&view=rev
Log:
Fomatting fixes and parameter changes to const
Modified:
webservices/axis2/trunk/c/include/axis2_phase_holder.h
webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c
Modified: webservices/axis2/trunk/c/include/axis2_phase_holder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_phase_holder.h?rev=433906&r1=433905&r2=433906&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_phase_holder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_phase_holder.h Tue Aug 22 22:12:39 2006
@@ -17,7 +17,8 @@
#ifndef AXIS2_PHASE_HOLDER_H
#define AXIS2_PHASE_HOLDER_H
-/** @defgroup axis2_phase_holder phase holder
+/**
+ * @defgroup axis2_phase_holder phase holder
* @ingroup axis2_phase_resolver
* Description
* @{
@@ -58,12 +59,13 @@
* Wsdl Phase Holder ops struct
* Encapsulator struct for ops of axis2_phase_holder
*/
- AXIS2_DECLARE_DATA struct axis2_phase_holder_ops
+ struct axis2_phase_holder_ops
{
- /** De-allocate memory
- * @param phase_holder pointer to phase holder
- * @param env pointer to environment struct
- */
+ /**
+ * De-allocate memory
+ * @param phase_holder pointer to phase holder
+ * @param env pointer to environment struct
+ */
axis2_status_t (AXIS2_CALL *
free)(
axis2_phase_holder_t *phase_holder,
@@ -72,9 +74,8 @@
/**
* Method isPhaseExist
* @param phase_holder pointer to phase holder
- * @param env pointer to environment struct
- * @param phase_name pointer to phase name
- * @return
+ * @param env pointer to environment struct
+ * @param phase_name pointer to phase name
*/
axis2_bool_t (AXIS2_CALL *
is_phase_exist)(
@@ -84,8 +85,8 @@
/**
* @param phase_holder pointer to phase holder
- * @param env pointer to environment struct
- * @para handler pointer to handler
+ * @param env pointer to environment struct
+ * @para handler pointer to handler
*/
axis2_status_t (AXIS2_CALL *
add_handler)(
@@ -96,13 +97,13 @@
/**
* this method is used to get the actual phase object given in the phase
* array list
- * @param phase_holder pointer to phase holder
- * @param env pointer to environment struct
- * @param phase_name pointer to phase name
+ * @param phase_holder pointer to phase holder
+ * @param env pointer to environment struct
+ * @param phase_name pointer to phase name
*/
- struct axis2_phase * (AXIS2_CALL *
+ struct axis2_phase *(AXIS2_CALL *
get_phase)(
- axis2_phase_holder_t *phase_holder,
+ const axis2_phase_holder_t *phase_holder,
const axis2_env_t *env,
axis2_char_t *phase_name);
@@ -110,10 +111,10 @@
* This method is to build the transport phase , here load the corresponding
* handlers and added them
* in to correct phase
- * @param phase_holder pointer to phase holder
- * @param env pointer to environment struct
- * @param phase pointer to phase
- * @param handlers pointer to handlers
+ * @param phase_holder pointer to phase holder
+ * @param env pointer to environment struct
+ * @param phase pointer to phase
+ * @param handlers pointer to handlers
*/
axis2_status_t (AXIS2_CALL *
build_transport_handler_chain)(
@@ -121,15 +122,12 @@
const axis2_env_t *env,
struct axis2_phase *phase,
axis2_array_list_t *handlers);
-
-
-
};
/**
* phase holder struct
*/
- AXIS2_DECLARE_DATA struct axis2_phase_holder
+ struct axis2_phase_holder
{
/** operations of phase holder struct */
axis2_phase_holder_ops_t *ops;
@@ -140,9 +138,9 @@
* @param env pointer to environment struct
* @return pointer to newly created phase holder
*/
- AXIS2_EXTERN axis2_phase_holder_t * AXIS2_CALL
- axis2_phase_holder_create (
- const axis2_env_t *env);
+ AXIS2_EXTERN axis2_phase_holder_t *AXIS2_CALL
+ axis2_phase_holder_create (
+ const axis2_env_t *env);
/**
* Creates phase holder struct
@@ -150,10 +148,10 @@
* @param phases pointer to phases
* @return pointer to newly created phase holder
*/
- AXIS2_EXTERN axis2_phase_holder_t * AXIS2_CALL
- axis2_phase_holder_create_with_phases (
- const axis2_env_t *env,
- axis2_array_list_t *phases);
+ AXIS2_EXTERN axis2_phase_holder_t *AXIS2_CALL
+ axis2_phase_holder_create_with_phases (
+ const axis2_env_t *env,
+ axis2_array_list_t *phases);
/*************************** Function macros **********************************/
Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c?rev=433906&r1=433905&r2=433906&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c Tue Aug 22 22:12:39 2006
@@ -13,130 +13,138 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <axis2_phase_holder.h>
-
-/**
+
+/**
* @brief Wsdl phase holder struct impl
* Phase Holder
* This class hold all the phases found in the services.xml and server.xml
- */
+ */
typedef struct axis2_phase_holder_impl
{
- axis2_phase_holder_t phase_holder;
+ axis2_phase_holder_t phase_holder;
axis2_array_list_t *phase_list;
-
-} axis2_phase_holder_impl_t;
+}
+axis2_phase_holder_impl_t;
#define AXIS2_INTF_TO_IMPL(phase_holder) ((axis2_phase_holder_impl_t *)phase_holder)
/************************* Function prototypes ********************************/
axis2_status_t AXIS2_CALL
- axis2_phase_holder_free (
- axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env);
+axis2_phase_holder_free (
+ axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env);
axis2_bool_t AXIS2_CALL
-axis2_phase_holder_is_phase_exist(axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env,
- axis2_char_t *phase_name);
+axis2_phase_holder_is_phase_exist(
+ axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env,
+ axis2_char_t *phase_name);
axis2_status_t AXIS2_CALL
-axis2_phase_holder_add_handler(axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env,
- axis2_handler_desc_t *handler);
-
-axis2_phase_t * AXIS2_CALL
-axis2_phase_holder_get_phase(axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env,
- axis2_char_t *phase_name);
+axis2_phase_holder_add_handler(
+ axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env,
+ axis2_handler_desc_t *handler);
+
+axis2_phase_t *AXIS2_CALL
+axis2_phase_holder_get_phase(
+ const axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env,
+ axis2_char_t *phase_name);
axis2_status_t AXIS2_CALL
-axis2_phase_holder_build_transport_handler_chain(axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env,
- axis2_phase_t *phase,
- axis2_array_list_t *handlers);
+axis2_phase_holder_build_transport_handler_chain(
+ axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env,
+ axis2_phase_t *phase,
+ axis2_array_list_t *handlers);
/************************** End of function prototypes ************************/
-AXIS2_EXTERN axis2_phase_holder_t * AXIS2_CALL
-axis2_phase_holder_create (const axis2_env_t *env)
+AXIS2_EXTERN axis2_phase_holder_t *AXIS2_CALL
+axis2_phase_holder_create(
+ const axis2_env_t *env)
{
axis2_phase_holder_impl_t *phase_holder_impl = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
-
- phase_holder_impl = (axis2_phase_holder_impl_t *) AXIS2_MALLOC(env->
- allocator, sizeof(axis2_phase_holder_impl_t));
-
- if(NULL == phase_holder_impl)
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ phase_holder_impl = (axis2_phase_holder_impl_t *) AXIS2_MALLOC(env->
+ allocator, sizeof(axis2_phase_holder_impl_t));
+
+ if(NULL == phase_holder_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
-
+
phase_holder_impl->phase_list = NULL;
phase_holder_impl->phase_holder.ops = NULL;
-
- phase_holder_impl->phase_holder.ops =
- AXIS2_MALLOC (env->allocator, sizeof(axis2_phase_holder_ops_t));
- if(NULL == phase_holder_impl->phase_holder.ops)
+
+ phase_holder_impl->phase_holder.ops =
+ AXIS2_MALLOC (env->allocator, sizeof(axis2_phase_holder_ops_t));
+ if(NULL == phase_holder_impl->phase_holder.ops)
{
axis2_phase_holder_free(&(phase_holder_impl->phase_holder), env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
-
- phase_holder_impl->phase_holder.ops->free = axis2_phase_holder_free;
- phase_holder_impl->phase_holder.ops->is_phase_exist =
- axis2_phase_holder_is_phase_exist;
- phase_holder_impl->phase_holder.ops->add_handler =
- axis2_phase_holder_add_handler;
- phase_holder_impl->phase_holder.ops->get_phase =
- axis2_phase_holder_get_phase;
- phase_holder_impl->phase_holder.ops->build_transport_handler_chain =
- axis2_phase_holder_build_transport_handler_chain;
-
- return &(phase_holder_impl->phase_holder);
+
+ phase_holder_impl->phase_holder.ops->free = axis2_phase_holder_free;
+ phase_holder_impl->phase_holder.ops->is_phase_exist =
+ axis2_phase_holder_is_phase_exist;
+ phase_holder_impl->phase_holder.ops->add_handler =
+ axis2_phase_holder_add_handler;
+ phase_holder_impl->phase_holder.ops->get_phase =
+ axis2_phase_holder_get_phase;
+ phase_holder_impl->phase_holder.ops->build_transport_handler_chain =
+ axis2_phase_holder_build_transport_handler_chain;
+
+ return &(phase_holder_impl->phase_holder);
}
-AXIS2_EXTERN axis2_phase_holder_t * AXIS2_CALL
-axis2_phase_holder_create_with_phases (const axis2_env_t *env, axis2_array_list_t *phases)
+AXIS2_EXTERN axis2_phase_holder_t *AXIS2_CALL
+axis2_phase_holder_create_with_phases(
+ const axis2_env_t *env,
+ axis2_array_list_t *phases)
{
axis2_phase_holder_impl_t *phase_holder_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
if (!phases)
return NULL;
/*AXIS2_PARAM_CHECK(env->error, phases, NULL);*/
-
+
phase_holder_impl = (axis2_phase_holder_impl_t *)axis2_phase_holder_create(env);
-
+
phase_holder_impl->phase_list = phases;
-
+
return &(phase_holder_impl->phase_holder);
}
/***************************Function implementation****************************/
-axis2_status_t AXIS2_CALL
-axis2_phase_holder_free (axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env)
+axis2_status_t AXIS2_CALL
+axis2_phase_holder_free(
+ axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env)
{
axis2_phase_holder_impl_t *phase_holder_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+
phase_holder_impl = AXIS2_INTF_TO_IMPL(phase_holder);
-
+
/*if(NULL != phase_holder_impl->phase_list)
{
AXIS2_ARRAY_LIST_FREE(phase_holder_impl->phase_list, env);
phase_holder_impl->phase_list = NULL;
}*/
-
+
if(NULL != phase_holder->ops)
{
AXIS2_FREE(env->allocator, phase_holder->ops);
@@ -148,8 +156,8 @@
AXIS2_FREE(env->allocator, phase_holder_impl);
phase_holder_impl = NULL;
}
-
- return AXIS2_SUCCESS;
+
+ return AXIS2_SUCCESS;
}
/**
@@ -159,27 +167,28 @@
* @return
*/
axis2_bool_t AXIS2_CALL
-axis2_phase_holder_is_phase_exist(axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env,
- axis2_char_t *phase_name)
+axis2_phase_holder_is_phase_exist(
+ axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env,
+ axis2_char_t *phase_name)
{
int size = 0;
int i = 0;
axis2_phase_t *phase = NULL;
axis2_phase_holder_impl_t *phase_holder_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, phase_name, AXIS2_FALSE);
phase_holder_impl = AXIS2_INTF_TO_IMPL(phase_holder);
-
+
size = AXIS2_ARRAY_LIST_SIZE(phase_holder_impl->phase_list, env);
-
- for (i = 0; i < size; i++)
+
+ for (i = 0; i < size; i++)
{
const axis2_char_t *phase_name_l = NULL;
-
+
phase = (axis2_phase_t *) AXIS2_ARRAY_LIST_GET(phase_holder_impl->
- phase_list, env, i);
+ phase_list, env, i);
phase_name_l = AXIS2_PHASE_GET_NAME(phase, env);
if (0 == AXIS2_STRCMP(phase_name_l, phase_name))
{
@@ -195,36 +204,37 @@
* @param handler
*/
axis2_status_t AXIS2_CALL
-axis2_phase_holder_add_handler(axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env,
- axis2_handler_desc_t *handler)
+axis2_phase_holder_add_handler(
+ axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env,
+ axis2_handler_desc_t *handler)
{
axis2_char_t *phase_name = NULL;
axis2_status_t status = AXIS2_FAILURE;
-
+
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_phase_holder_add_handler start");
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, handler, AXIS2_FAILURE);
-
+
phase_name = AXIS2_PHASE_RULE_GET_NAME(
- AXIS2_HANDLER_DESC_GET_RULES(handler, env), env);
- if (AXIS2_TRUE == axis2_phase_holder_is_phase_exist(phase_holder, env,
- phase_name))
+ AXIS2_HANDLER_DESC_GET_RULES(handler, env), env);
+ if (AXIS2_TRUE == axis2_phase_holder_is_phase_exist(phase_holder, env,
+ phase_name))
{
axis2_phase_t *phase = NULL;
-
+
phase = axis2_phase_holder_get_phase(phase_holder, env, phase_name);
status = AXIS2_PHASE_ADD_HANDLER_DESC(phase, env, handler);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Add handler %s to phase %s",
- AXIS2_QNAME_TO_STRING(AXIS2_HANDLER_DESC_GET_QNAME(handler, env), env), phase_name);
- }
- else
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Add handler %s to phase %s",
+ AXIS2_QNAME_TO_STRING(AXIS2_HANDLER_DESC_GET_QNAME(handler, env), env), phase_name);
+ }
+ else
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_PHASE, AXIS2_FAILURE);
status = AXIS2_FAILURE;
}
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_phase_holder_add_handler end status = %s",
- status ? "SUCCESS" : "FAILURE");
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_phase_holder_add_handler end status = %s",
+ status ? "SUCCESS" : "FAILURE");
return status;
}
@@ -234,35 +244,36 @@
* @param phaseName
* @return
*/
-axis2_phase_t * AXIS2_CALL
-axis2_phase_holder_get_phase(axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env,
- axis2_char_t *phase_name)
+axis2_phase_t *AXIS2_CALL
+axis2_phase_holder_get_phase(
+ const axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env,
+ axis2_char_t *phase_name)
{
int size = 0;
int i = 0;
axis2_phase_holder_impl_t *phase_holder_impl = NULL;
axis2_phase_t *phase = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, phase_name, NULL);
-
+
phase_holder_impl = AXIS2_INTF_TO_IMPL(phase_holder);
-
+
size = AXIS2_ARRAY_LIST_SIZE(phase_holder_impl->phase_list, env);
-
- for (i = 0; i < size; i++)
+
+ for (i = 0; i < size; i++)
{
const axis2_char_t *phase_name_l = NULL;
phase = (axis2_phase_t *) AXIS2_ARRAY_LIST_GET(phase_holder_impl->
- phase_list, env, i);
+ phase_list, env, i);
phase_name_l = AXIS2_PHASE_GET_NAME(phase, env);
if(0 == AXIS2_STRCMP(phase_name_l, phase_name))
{
return phase;
}
}
-
+
return NULL;
}
@@ -274,35 +285,36 @@
* @param handlers
*/
axis2_status_t AXIS2_CALL
-axis2_phase_holder_build_transport_handler_chain(axis2_phase_holder_t *phase_holder,
- const axis2_env_t *env,
- axis2_phase_t *phase,
- axis2_array_list_t *handlers)
+axis2_phase_holder_build_transport_handler_chain(
+ axis2_phase_holder_t *phase_holder,
+ const axis2_env_t *env,
+ axis2_phase_t *phase,
+ axis2_array_list_t *handlers)
{
axis2_handler_t *handler = NULL;
int size = 0;
int status = AXIS2_FAILURE;
int i = 0;
axis2_handler_desc_t *handler_desc = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, phase, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, handlers, AXIS2_FAILURE);
-
+
size = AXIS2_ARRAY_LIST_SIZE(handlers, env);
-
- for (i = 0; i < size; i++)
+
+ for (i = 0; i < size; i++)
{
handler_desc = (axis2_handler_desc_t *) AXIS2_ARRAY_LIST_GET(
- handlers, env, i);
+ handlers, env, i);
status = AXIS2_HANDLER_INIT(handler, env, handler_desc);
if(AXIS2_FAILURE == status)
return status;
-
+
status = AXIS2_HANDLER_DESC_SET_HANDLER(handler_desc, env, handler);
if(AXIS2_FAILURE == status)
return status;
-
+
status = AXIS2_PHASE_ADD_HANDLER(phase, env, handler);
}
return status;
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org