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 sa...@apache.org on 2007/04/01 08:47:49 UTC
svn commit: r524546 - in /webservices/axis2/trunk/c: include/
samples/server/Calculator/ samples/server/echo/ samples/server/math/
samples/server/mtom/ samples/server/notify/ samples/server/sg_math/
Author: samisa
Date: Sat Mar 31 23:47:48 2007
New Revision: 524546
URL: http://svn.apache.org/viewvc?view=rev&rev=524546
Log:
Made ops struct static
Modified:
webservices/axis2/trunk/c/include/axis2_svc_skeleton.h
webservices/axis2/trunk/c/samples/server/Calculator/calc_skeleton.c
webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c
webservices/axis2/trunk/c/samples/server/math/math_skeleton.c
webservices/axis2/trunk/c/samples/server/mtom/mtom_skeleton.c
webservices/axis2/trunk/c/samples/server/notify/notify_skeleton.c
webservices/axis2/trunk/c/samples/server/sg_math/add_skeleton.c
webservices/axis2/trunk/c/samples/server/sg_math/div_skeleton.c
webservices/axis2/trunk/c/samples/server/sg_math/mul_skeleton.c
webservices/axis2/trunk/c/samples/server/sg_math/sub_skeleton.c
Modified: webservices/axis2/trunk/c/include/axis2_svc_skeleton.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_svc_skeleton.h?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc_skeleton.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svc_skeleton.h Sat Mar 31 23:47:48 2007
@@ -121,7 +121,7 @@
struct axis2_svc_skeleton
{
/** operations of service skeleton */
- axis2_svc_skeleton_ops_t *ops;
+ const axis2_svc_skeleton_ops_t *ops;
/** Array list of functions, implementing the service operations */
axutil_array_list_t *func_array;
};
Modified: webservices/axis2/trunk/c/samples/server/Calculator/calc_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/Calculator/calc_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/Calculator/calc_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/Calculator/calc_skeleton.c Sat Mar 31 23:47:48 2007
@@ -35,6 +35,13 @@
int AXIS2_CALL calc_init(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env);
+static const axis2_svc_skeleton_ops_t calc_svc_skeleton_ops_var = {
+ calc_init,
+ calc_invoke,
+ NULL,
+ calc_free
+};
+
AXIS2_EXTERN axis2_svc_skeleton_t * AXIS2_CALL
axis2_calc_create(const axutil_env_t *env)
@@ -44,16 +51,10 @@
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = &calc_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- svc_skeleton->ops->free = calc_free;
- svc_skeleton->ops->init = calc_init;
- svc_skeleton->ops->invoke = calc_invoke;
- /*svc_skeleton->ops->on_fault = calc_on_fault;*/
-
return svc_skeleton;
}
@@ -75,18 +76,6 @@
calc_free(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env)
{
- /*if(svc_skeleton->func_array)
- {
- axutil_array_list_free(svc_skeleton->func_array, env);
- svc_skeleton->func_array = NULL;
- }*/
-
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
- }
-
if (svc_skeleton)
{
AXIS2_FREE(env->allocator, svc_skeleton);
Modified: webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c Sat Mar 31 23:47:48 2007
@@ -42,6 +42,13 @@
echo_on_fault(axis2_svc_skeleton_t *svc_skeli,
const axutil_env_t *env, axiom_node_t *node);
+static const axis2_svc_skeleton_ops_t echo_svc_skeleton_ops_var = {
+ echo_init,
+ echo_invoke,
+ echo_on_fault,
+ echo_free
+};
+
/*Create function */
axis2_svc_skeleton_t *
axis2_echo_create(const axutil_env_t *env)
@@ -51,15 +58,9 @@
svc_skeleton = AXIS2_MALLOC(env->allocator,
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = &echo_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- /* Assign function pointers */
- svc_skeleton->ops->free = echo_free;
- svc_skeleton->ops->init = echo_init;
- svc_skeleton->ops->invoke = echo_invoke;
- svc_skeleton->ops->on_fault = echo_on_fault;
return svc_skeleton;
}
@@ -124,13 +125,6 @@
{
axutil_array_list_free(svc_skeleton->func_array, env);
svc_skeleton->func_array = NULL;
- }
-
- /* Free the function array */
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
}
/* Free the service skeleton */
Modified: webservices/axis2/trunk/c/samples/server/math/math_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/math/math_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/math/math_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/math/math_skeleton.c Sat Mar 31 23:47:48 2007
@@ -35,6 +35,13 @@
int AXIS2_CALL math_init(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env);
+static const axis2_svc_skeleton_ops_t math_svc_skeleton_ops_var = {
+ math_init,
+ math_invoke,
+ NULL,
+ math_free
+};
+
AXIS2_EXTERN axis2_svc_skeleton_t * AXIS2_CALL
math_create(const axutil_env_t *env)
@@ -44,16 +51,10 @@
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = &math_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- svc_skeleton->ops->free = math_free;
- svc_skeleton->ops->init = math_init;
- svc_skeleton->ops->invoke = math_invoke;
- /*svc_skeleton->ops->on_fault = math_on_fault;*/
-
return svc_skeleton;
}
@@ -75,18 +76,6 @@
math_free(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env)
{
- /*if(svc_skeleton->func_array)
- {
- axutil_array_list_free(svc_skeleton->func_array, env);
- svc_skeleton->func_array = NULL;
- }*/
-
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
- }
-
if (svc_skeleton)
{
AXIS2_FREE(env->allocator, svc_skeleton);
Modified: webservices/axis2/trunk/c/samples/server/mtom/mtom_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/mtom/mtom_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/mtom/mtom_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/mtom/mtom_skeleton.c Sat Mar 31 23:47:48 2007
@@ -40,6 +40,13 @@
mtom_on_fault(axis2_svc_skeleton_t *svc_skeli,
const axutil_env_t *env, axiom_node_t *node);
+static const axis2_svc_skeleton_ops_t mtom_svc_skeleton_ops_var = {
+ mtom_init,
+ mtom_invoke,
+ mtom_on_fault,
+ mtom_free
+};
+
/*Create function */
axis2_svc_skeleton_t *
axis2_mtom_create(const axutil_env_t *env)
@@ -49,15 +56,9 @@
svc_skeleton = AXIS2_MALLOC(env->allocator,
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = &mtom_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- /* Assign function pointers */
- svc_skeleton->ops->free = mtom_free;
- svc_skeleton->ops->init = mtom_init;
- svc_skeleton->ops->invoke = mtom_invoke;
- svc_skeleton->ops->on_fault = mtom_on_fault;
return svc_skeleton;
}
@@ -122,13 +123,6 @@
{
axutil_array_list_free(svc_skeleton->func_array, env);
svc_skeleton->func_array = NULL;
- }
-
- /* Free the function array */
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
}
/* Free the service skeleton */
Modified: webservices/axis2/trunk/c/samples/server/notify/notify_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/notify/notify_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/notify/notify_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/notify/notify_skeleton.c Sat Mar 31 23:47:48 2007
@@ -40,6 +40,14 @@
notify_on_fault(axis2_svc_skeleton_t *svc_skeli,
const axutil_env_t *env, axiom_node_t *node);
+static const axis2_svc_skeleton_ops_t notify_svc_skeleton_ops_var = {
+ notify_init,
+ notify_invoke,
+ notify_on_fault,
+ notify_free
+};
+
+
/*Create function */
axis2_svc_skeleton_t *
axis2_notify_create(const axutil_env_t *env)
@@ -49,17 +57,10 @@
svc_skeleton = AXIS2_MALLOC(env->allocator,
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = ¬ify_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- /* Assign function pointers */
- svc_skeleton->ops->free = notify_free;
- svc_skeleton->ops->init = notify_init;
- svc_skeleton->ops->invoke = notify_invoke;
- svc_skeleton->ops->on_fault = notify_on_fault;
-
return svc_skeleton;
}
@@ -124,13 +125,6 @@
{
axutil_array_list_free(svc_skeleton->func_array, env);
svc_skeleton->func_array = NULL;
- }
-
- /* Free the function array */
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
}
/* Free the service skeleton */
Modified: webservices/axis2/trunk/c/samples/server/sg_math/add_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/sg_math/add_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/sg_math/add_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/sg_math/add_skeleton.c Sat Mar 31 23:47:48 2007
@@ -36,6 +36,13 @@
const axutil_env_t *env);
+static const axis2_svc_skeleton_ops_t add_svc_skeleton_ops_var = {
+ add_init,
+ add_invoke,
+ NULL,
+ add_free
+};
+
AXIS2_EXTERN axis2_svc_skeleton_t * AXIS2_CALL
axis2_add_create(const axutil_env_t *env)
{
@@ -44,16 +51,10 @@
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = &add_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- svc_skeleton->ops->free = add_free;
- svc_skeleton->ops->init = add_init;
- svc_skeleton->ops->invoke = add_invoke;
- /*svc_skeleton->ops->on_fault = add_on_fault;*/
-
return svc_skeleton;
}
@@ -72,12 +73,6 @@
add_free(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env)
{
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
- }
-
if (svc_skeleton)
{
AXIS2_FREE(env->allocator, svc_skeleton);
Modified: webservices/axis2/trunk/c/samples/server/sg_math/div_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/sg_math/div_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/sg_math/div_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/sg_math/div_skeleton.c Sat Mar 31 23:47:48 2007
@@ -35,6 +35,13 @@
int AXIS2_CALL div_init(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env);
+static const axis2_svc_skeleton_ops_t div_svc_skeleton_ops_var = {
+ div_init,
+ div_invoke,
+ NULL,
+ div_free
+};
+
AXIS2_EXTERN axis2_svc_skeleton_t * AXIS2_CALL
axis2_div_create(const axutil_env_t *env)
@@ -44,16 +51,10 @@
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = &div_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- svc_skeleton->ops->free = div_free;
- svc_skeleton->ops->init = div_init;
- svc_skeleton->ops->invoke = div_invoke;
- /*svc_skeleton->ops->on_fault = div_on_fault;*/
-
return svc_skeleton;
}
@@ -72,12 +73,6 @@
div_free(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env)
{
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
- }
-
if (svc_skeleton)
{
AXIS2_FREE(env->allocator, svc_skeleton);
Modified: webservices/axis2/trunk/c/samples/server/sg_math/mul_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/sg_math/mul_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/sg_math/mul_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/sg_math/mul_skeleton.c Sat Mar 31 23:47:48 2007
@@ -35,6 +35,13 @@
int AXIS2_CALL mul_init(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env);
+static const axis2_svc_skeleton_ops_t mul_svc_skeleton_ops_var = {
+ mul_init,
+ mul_invoke,
+ NULL,
+ mul_free
+};
+
AXIS2_EXTERN axis2_svc_skeleton_t * AXIS2_CALL
axis2_mul_create(const axutil_env_t *env)
@@ -44,16 +51,10 @@
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = &mul_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- svc_skeleton->ops->free = mul_free;
- svc_skeleton->ops->init = mul_init;
- svc_skeleton->ops->invoke = mul_invoke;
- /*svc_skeleton->ops->on_fault = mul_on_fault;*/
-
return svc_skeleton;
}
@@ -72,12 +73,6 @@
mul_free(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env)
{
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
- }
-
if (svc_skeleton)
{
AXIS2_FREE(env->allocator, svc_skeleton);
Modified: webservices/axis2/trunk/c/samples/server/sg_math/sub_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/sg_math/sub_skeleton.c?view=diff&rev=524546&r1=524545&r2=524546
==============================================================================
--- webservices/axis2/trunk/c/samples/server/sg_math/sub_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/sg_math/sub_skeleton.c Sat Mar 31 23:47:48 2007
@@ -35,6 +35,12 @@
int AXIS2_CALL sub_init(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env);
+static const axis2_svc_skeleton_ops_t sub_svc_skeleton_ops_var = {
+ sub_init,
+ sub_invoke,
+ NULL,
+ sub_free
+};
AXIS2_EXTERN axis2_svc_skeleton_t * AXIS2_CALL
axis2_sub_create(const axutil_env_t *env)
@@ -44,16 +50,10 @@
sizeof(axis2_svc_skeleton_t));
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+ svc_skeleton->ops = &sub_svc_skeleton_ops_var;
svc_skeleton->func_array = NULL;
- svc_skeleton->ops->free = sub_free;
- svc_skeleton->ops->init = sub_init;
- svc_skeleton->ops->invoke = sub_invoke;
- /*svc_skeleton->ops->on_fault = sub_on_fault;*/
-
return svc_skeleton;
}
@@ -72,12 +72,6 @@
sub_free(axis2_svc_skeleton_t *svc_skeleton,
const axutil_env_t *env)
{
- if (svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
- }
-
if (svc_skeleton)
{
AXIS2_FREE(env->allocator, svc_skeleton);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org