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 07:50:57 UTC

svn commit: r524537 - in /webservices/axis2/trunk/c: include/axis2_module.h modules/mod_addr/mod_addr.c modules/mod_log/mod_log.c

Author: samisa
Date: Sat Mar 31 22:50:57 2007
New Revision: 524537

URL: http://svn.apache.org/viewvc?view=rev&rev=524537
Log:
Made ops struct static

Modified:
    webservices/axis2/trunk/c/include/axis2_module.h
    webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c
    webservices/axis2/trunk/c/modules/mod_log/mod_log.c

Modified: webservices/axis2/trunk/c/include/axis2_module.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_module.h?view=diff&rev=524537&r1=524536&r2=524537
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_module.h (original)
+++ webservices/axis2/trunk/c/include/axis2_module.h Sat Mar 31 22:50:57 2007
@@ -107,7 +107,7 @@
     struct axis2_module
     {
         /** operations of module */
-        axis2_module_ops_t *ops;
+        const axis2_module_ops_t *ops;
         /** hash map of handler create functions */
         axutil_hash_t *handler_create_func_map;
     };

Modified: webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c?view=diff&rev=524537&r1=524536&r2=524537
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c Sat Mar 31 22:50:57 2007
@@ -33,6 +33,12 @@
 axis2_mod_addr_fill_handler_create_func_map(axis2_module_t *module,
         const axutil_env_t *env);
 
+static const axis2_module_ops_t addr_module_ops_var = {
+    axis2_mod_addr_init,
+    axis2_mod_addr_shutdown,
+    axis2_mod_addr_fill_handler_create_func_map
+};
+
 axis2_module_t *
 axis2_mod_addr_create(const axutil_env_t *env)
 {
@@ -40,15 +46,8 @@
     module = AXIS2_MALLOC(env->allocator,
             sizeof(axis2_module_t));
 
-
-    module->ops = AXIS2_MALLOC(
-                env->allocator, sizeof(axis2_module_ops_t));
-
-    module->ops->shutdown = axis2_mod_addr_shutdown;
-    module->ops->init = axis2_mod_addr_init;
-    module->ops->fill_handler_create_func_map =
-        axis2_mod_addr_fill_handler_create_func_map;
-
+    module->ops = &addr_module_ops_var;
+    
     return module;
 }
 
@@ -67,12 +66,6 @@
 axis2_mod_addr_shutdown(axis2_module_t *module,
         const axutil_env_t *env)
 {
-    if (module->ops)
-    {
-        AXIS2_FREE(env->allocator, module->ops);
-        module->ops = NULL;
-    }
-
     if (module->handler_create_func_map)
     {
         /* TODO

Modified: webservices/axis2/trunk/c/modules/mod_log/mod_log.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/mod_log/mod_log.c?view=diff&rev=524537&r1=524536&r2=524537
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_log/mod_log.c (original)
+++ webservices/axis2/trunk/c/modules/mod_log/mod_log.c Sat Mar 31 22:50:57 2007
@@ -34,6 +34,12 @@
 axis2_mod_log_fill_handler_create_func_map(axis2_module_t *module,
                                             const axutil_env_t *env);
 
+static const axis2_module_ops_t log_module_ops_var = {
+    axis2_mod_log_init,
+    axis2_mod_log_shutdown,
+    axis2_mod_log_fill_handler_create_func_map
+};
+
 axis2_module_t *
 axis2_mod_log_create(const axutil_env_t *env)
 {
@@ -41,14 +47,7 @@
     module = AXIS2_MALLOC(env->allocator, 
         sizeof(axis2_module_t));
 
-    
-    module->ops = AXIS2_MALLOC(
-        env->allocator, sizeof(axis2_module_ops_t));
-
-    module->ops->shutdown = axis2_mod_log_shutdown;
-    module->ops->init = axis2_mod_log_init;
-    module->ops->fill_handler_create_func_map = 
-        axis2_mod_log_fill_handler_create_func_map;
+    module->ops = &log_module_ops_var;
 
     return module;
 }
@@ -68,12 +67,6 @@
 axis2_mod_log_shutdown(axis2_module_t *module,
                         const axutil_env_t *env)
 {
-    if(module->ops)
-    {
-        AXIS2_FREE(env->allocator, module->ops);
-        module->ops = NULL;
-    }
-
     if(module->handler_create_func_map)
     {
         /* TODO



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org