Author: damitha
Date: Tue Nov  8 01:01:46 2005
New Revision: 331744

URL: http://svn.apache.org/viewcvs?rev=331744&view=rev
Log:
replace environment_create with env_create

Modified:
    webservices/axis2/trunk/c/include/axis2_env.h
    webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c
    webservices/axis2/trunk/c/modules/test/om/src/test_om.c
    webservices/axis2/trunk/c/modules/test/util/test_util.c
    webservices/axis2/trunk/c/modules/util/src/env.c
    webservices/axis2/trunk/c/modules/util/test/util_hash_test.c
    webservices/axis2/trunk/c/modules/util/test/util_log_test.c
    webservices/axis2/trunk/c/modules/util/test/util_stream_test.c
    webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c

Modified: webservices/axis2/trunk/c/include/axis2_env.h
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_env.h?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_env.h (original)
+++ webservices/axis2/trunk/c/include/axis2_env.h Tue Nov  8 01:01:46 2005
@@ -76,7 +76,7 @@
     * @param allocator pointer to an instance of allocator struct. Must be 
non-NULL    
     * @return pointer to the newly created environment struct 
     */
-    AXIS2_DECLARE(axis2_env_t *) axis2_environment_create (axis2_allocator_t
+    AXIS2_DECLARE(axis2_env_t *) axis2_env_create (axis2_allocator_t
                                                    *allocator);                
                                   
        
   /**
@@ -87,7 +87,7 @@
     * it would be taken as a flag for no logging.    
     * @return pointer to the newly created environment struct 
     */
-    AXIS2_DECLARE(axis2_env_t *) axis2_environment_create_with_error_stream 
+    AXIS2_DECLARE(axis2_env_t *) axis2_env_create_with_error_stream 
                                                                                
                        (axis2_allocator_t *allocator
                                                    , axis2_error_t *error
                                                    , axis2_stream_t *stream);
@@ -101,7 +101,7 @@
     * it would be taken as a flag for no logging.    
     * @return pointer to the newly created environment struct 
     */
-    AXIS2_DECLARE(axis2_env_t *) 
axis2_environment_create_with_error_stream_log 
+    AXIS2_DECLARE(axis2_env_t *) axis2_env_create_with_error_stream_log 
                                                                                
                        (axis2_allocator_t *allocator
                                                    , axis2_error_t *error
                                                    , axis2_stream_t *stream
@@ -127,7 +127,7 @@
     if(!env || !(*env))  \
        { \
                axis2_allocator_t *allocator = axis2_allocator_init (NULL); \
-        *env = axis2_environment_create (allocator); \
+        *env = axis2_env_create (allocator); \
                AXIS2_ERROR_SET_STATUS_CODE((*env)->error, 
AXIS2_CRTICAL_FAILURE);  \
                AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, \
                        AXIS2_ERROR_ENVIRONMENT_IS_NULL); \

Modified: webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c Tue Nov  8 
01:01:46 2005
@@ -159,7 +159,8 @@
     if(NULL != AXIS2_INTF_TO_IMPL(svc_grp)->svc_grp_name)
         AXIS2_FREE((*env)->allocator, 
AXIS2_INTF_TO_IMPL(svc_grp)->svc_grp_name);
     
-    axis2_hash_free(AXIS2_INTF_TO_IMPL(svc_grp)->svcs, env);
+    if(NULL != AXIS2_INTF_TO_IMPL(svc_grp)->svcs)
+        axis2_hash_free(AXIS2_INTF_TO_IMPL(svc_grp)->svcs, env);
     
        AXIS2_FREE((*env)->allocator, svc_grp);
        return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/modules/test/om/src/test_om.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/test/om/src/test_om.c?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/test/om/src/test_om.c (original)
+++ webservices/axis2/trunk/c/modules/test/om/src/test_om.c Tue Nov  8 01:01:46 
2005
@@ -199,7 +199,7 @@
         file_name = argv[1];
     allocator = axis2_allocator_init (NULL);
     environment =
-        axis2_environment_create (allocator, NULL, NULL, NULL, NULL);
+        axis2_env_create (allocator, NULL, NULL, NULL, NULL);
 
     my_guththila_allocator = guththila_allocator_init (NULL);
     my_guththila_environment =

Modified: webservices/axis2/trunk/c/modules/test/util/test_util.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/test/util/test_util.c?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/test/util/test_util.c (original)
+++ webservices/axis2/trunk/c/modules/test/util/test_util.c Tue Nov  8 01:01:46 
2005
@@ -31,7 +31,7 @@
        axis2_allocator_t *allocator = axis2_allocator_init (NULL);
     axis2_error_t *error = axis2_error_create (allocator);
        axis2_stream_t *stream = axis2_stream_create (allocator, NULL);
-    axis2_env_t *env = axis2_environment_create_with_error_stream (allocator, 
error, stream);
+    axis2_env_t *env = axis2_env_create_with_error_stream (allocator, error, 
stream);
        return env;
 }
 
@@ -108,7 +108,7 @@
                axis2_allocator_t *allocator = axis2_allocator_init (NULL);
                axis2_error_t *error = axis2_error_create (allocator);
                axis2_stream_t *stream = axis2_stream_create (allocator, NULL);
-        *env = axis2_environment_create_with_error_stream (allocator, error, 
stream);
+        *env = axis2_env_create_with_error_stream (allocator, error, stream);
                AXIS2_ERROR_SET_STATUS_CODE((*env)->error, AXIS2_FAILURE);
                AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, 
AXIS2_ERROR_ENVIRONMENT_IS_NULL);           
                return NULL;

Modified: webservices/axis2/trunk/c/modules/util/src/env.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/env.c?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/env.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/env.c Tue Nov  8 01:01:46 2005
@@ -38,7 +38,7 @@
 }
 
 AXIS2_DECLARE(axis2_env_t *)
-axis2_environment_create (axis2_allocator_t *allocator)
+axis2_env_create (axis2_allocator_t *allocator)
 {
        axis2_env_t *environment;
     if (NULL == allocator)
@@ -57,15 +57,15 @@
 }
 
 AXIS2_DECLARE(axis2_env_t *)
-axis2_environment_create_with_error_stream (axis2_allocator_t *allocator
+axis2_env_create_with_error_stream (axis2_allocator_t *allocator
                           , axis2_error_t *error, axis2_stream_t *stream)
 {
-       return axis2_environment_create_with_error_stream_log(allocator, error
+       return axis2_env_create_with_error_stream_log(allocator, error
                , stream, NULL);    
 }
 
 AXIS2_DECLARE(axis2_env_t *)
-axis2_environment_create_with_error_stream_log (axis2_allocator_t *allocator
+axis2_env_create_with_error_stream_log (axis2_allocator_t *allocator
                           , axis2_error_t *error, axis2_stream_t *stream
                           , axis2_log_t *log)
 {

Modified: webservices/axis2/trunk/c/modules/util/test/util_hash_test.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/test/util_hash_test.c?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/test/util_hash_test.c (original)
+++ webservices/axis2/trunk/c/modules/util/test/util_hash_test.c Tue Nov  8 
01:01:46 2005
@@ -9,7 +9,7 @@
 {
     axis2_allocator_t *allocator = axis2_allocator_init (NULL);
     axis2_env_t *environment =
-        axis2_environment_create (allocator);
+        axis2_env_create (allocator);
 
     axis2_hash_t *ht;
     a *actual, *expected;

Modified: webservices/axis2/trunk/c/modules/util/test/util_log_test.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/test/util_log_test.c?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/test/util_log_test.c (original)
+++ webservices/axis2/trunk/c/modules/util/test/util_log_test.c Tue Nov  8 
01:01:46 2005
@@ -8,7 +8,7 @@
     axis2_stream_t *stream = axis2_stream_create(allocator, NULL);
     axis2_error_t *error = axis2_error_create(allocator);
     axis2_log_t *log  = axis2_log_create (allocator, NULL);
-    axis2_env_t *env = 
axis2_environment_create_with_error_stream_log(allocator, error, stream, log);
+    axis2_env_t *env = axis2_env_create_with_error_stream_log(allocator, 
error, stream, log);
 
     char *expected = strdup("aaaaaaaaa");
     AXIS2_STREAM_READ(env->stream, actual, 10);

Modified: webservices/axis2/trunk/c/modules/util/test/util_stream_test.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/test/util_stream_test.c?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/test/util_stream_test.c (original)
+++ webservices/axis2/trunk/c/modules/util/test/util_stream_test.c Tue Nov  8 
01:01:46 2005
@@ -6,7 +6,7 @@
     axis2_allocator_t *allocator = axis2_allocator_init(NULL);
     axis2_stream_t *stream = axis2_stream_create(allocator, NULL);
     axis2_error_t *error = axis2_error_create(allocator);
-    axis2_env_t *env = axis2_environment_create_with_error_stream(allocator, 
error, stream);
+    axis2_env_t *env = axis2_env_create_with_error_stream(allocator, error, 
stream);
     char *expected = (char*) strdup("aaaaaaaaa");
     AXIS2_STREAM_READ(env->stream, actual, 10);
     CuAssertStrEquals(tc, expected, actual);
@@ -18,7 +18,7 @@
     axis2_allocator_t *allocator = axis2_allocator_init(NULL);
     axis2_stream_t *stream = axis2_stream_create(allocator, NULL);
     axis2_error_t *error = axis2_error_create(allocator);
-    axis2_env_t *env = axis2_environment_create_with_error_stream(allocator, 
error, stream);
+    axis2_env_t *env = axis2_env_create_with_error_stream(allocator, error, 
stream);
     char *expected = (char*) strdup("aaaaaaaaa");
     AXIS2_STREAM_READ(env->stream, actual, 10);
     AXIS2_STREAM_WRITE(env->stream, actual, 10);

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c?rev=331744&r1=331743&r2=331744&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c Tue Nov  8 
01:01:46 2005
@@ -59,75 +59,78 @@
                AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
        }
        
-       axis2_wsdl_component_t *wsdl_component_local 
-               = (axis2_wsdl_component_t *)
-               axis2_malloc (env->allocator, sizeof(axis2_wsdl_component_t));
-       if(!wsdl_component_local)
+       wsdl_impl_component->wsdl_component.ops = (axis2_wsdl_component_ops_t *)
+               AXIS2_MALLOC (env->allocator, 
sizeof(axis2_wsdl_component_ops_t));
+       if(NULL == wsdl_impl_component->wsdl_component.ops)
        {
-               axis2_free(env->allocator, wsdl_impl_component);
-               return AXIS2_ERROR_NO_MEMORY;
+               AXIS2_FREE ((*env)->allocator, wsdl_impl_component);
+               AXIS2_ERROR_SET ((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);   
        }
-       wsdl_component_local->ops 
-               = (axis2_wsdl_component_ops_t *)
-               axis2_malloc (env->allocator, 
sizeof(axis2_wsdl_component_ops_t));
-       if(!wsdl_component_local->ops)
-       {
-               axis2_free(env->allocator, wsdl_impl_component);
-               axis2_free(env->allocator, wsdl_component_local);
-               return AXIS2_ERROR_NO_MEMORY;   
-       }
-       (wsdl_component_local->ops)->free = axis2_wsdl_component_free;
-       
-       wsdl_impl_component->wsdl_component = *wsdl_component_local;
+    
+       wsdl_impl_component->wsdl_component.ops->free = 
axis2_wsdl_component_free;
        
        wsdl_impl_component->component_properties = axis2_hash_make (env);
        
-       *wsdl_component = &(wsdl_impl_component->wsdl_component);
-
-       return AXIS2_SUCCESS;   
+       return &(wsdl_impl_component->wsdl_component);
 }
 
 
/******************************************************************************/
 
 axis2_status_t AXIS2_CALL 
-axis2_wsdl_component_free (axis2_env_t *env
-               , axis2_wsdl_component_t *wsdl_component)
+axis2_wsdl_component_free (axis2_wsdl_component_t *wsdl_component, 
+                            axis2_env_t **env)
 {
-       if(NULL != wsdl_component)
-               axis2_free(env->allocator, wsdl_component);
-       return AXIS2_SUCCESS;
-}
-
-axis2_status_t AXIS2_CALL
-axis2_wsdl_component_get_component_properties(axis2_env_t *env
-               ,axis2_wsdl_component_t *wsdl_component, axis2_hash_t 
**properties)
-{
-       if(NULL == wsdl_component) return AXIS2_ERROR_INVALID_NULL_PARAM;
-       axis2_wsdl_component_impl_t *wsdl_impl_component 
-               = (axis2_wsdl_component_impl_t*)(wsdl_component);
-       *properties = wsdl_impl_component->component_properties;
+    AXIS2_FUNC_PARAM_CHECK(wsdl_component, env, AXIS2_FAILURE);
+       if(NULL != wsdl_component->ops)
+        AXIS2_FREE((*env)->allocator, wsdl_component->ops);
+    
+    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_component)->component_properties)
+        axis2_hash_free(AXIS2_INTF_TO_IMPL(wsdl_component)->
+            component_properties, env);
+    
+    AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_component));
+    
        return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
-axis2_wsdl_component_set_component_properties(axis2_env_t *env
-               , axis2_wsdl_component_t *wsdl_component, axis2_hash_t 
*properties) 
+axis2_wsdl_component_set_component_properties(
+                                               axis2_wsdl_component_t 
*wsdl_component, 
+                                        axis2_env_t **env,
+                                        axis2_hash_t *properties) 
 {
        if(NULL == wsdl_component || NULL == properties) 
                return AXIS2_ERROR_INVALID_NULL_PARAM;
        
-       axis2_wsdl_component_impl_t *wsdl_impl_component
-               = (axis2_wsdl_component_impl_t *) wsdl_component;
-       wsdl_impl_component->component_properties = axis2_malloc(env->allocator
-               , sizeof(axis2_wsdl_component_t));
+    AXIS2_FUNC_PARAM_CHECK(wsdl_component, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, properties, AXIS2_FAILURE);
+    
+       AXIS2_INTF_TO_IMPL(wsdl_component)->component_properties =
+        AXIS2_MALLOC((*env)->allocator, sizeof(axis2_wsdl_component_t));
+    
        memcpy(wsdl_impl_component->component_properties, properties
                , sizeof(properties));
        return AXIS2_SUCCESS;
 }
 
+axis2_hash_t * AXIS2_CALL
+axis2_wsdl_component_get_component_properties(
+                                        axis2_wsdl_component_t *wsdl_component,
+                                        axis2_env_t **env)
+{
+       if(NULL == wsdl_component) return AXIS2_ERROR_INVALID_NULL_PARAM;
+       axis2_wsdl_component_impl_t *wsdl_impl_component 
+               = (axis2_wsdl_component_impl_t*)(wsdl_component);
+       *properties = wsdl_impl_component->component_properties;
+       return AXIS2_SUCCESS;
+}
+
 axis2_status_t AXIS2_CALL
-axis2_wsdl_component_set_component_property(axis2_env_t *env
-       , axis2_wsdl_component_t *wsdl_component, const void *key, void *value) 
+axis2_wsdl_component_set_component_property(
+                                        axis2_wsdl_component_t 
*wsdl_component, 
+                                        axis2_env_t **env,
+                                        const void *key, 
+                                        void *value) 
 {
        if(NULL ==wsdl_component || NULL == key || NULL == value) 
                return AXIS2_ERROR_INVALID_NULL_PARAM;
@@ -140,8 +143,10 @@
 }
 
 void * AXIS2_CALL
-axis2_wsdl_component_get_component_property(axis2_env_t *env
-               , axis2_wsdl_component_t *wsdl_component,const void *key) 
+axis2_wsdl_component_get_component_property(
+                                               axis2_wsdl_component_t 
*wsdl_component,
+                                        axis2_env_t **env, 
+                                        const void *key) 
 {
        if(NULL == wsdl_component || NULL == key) 
                return AXIS2_ERROR_INVALID_NULL_PARAM;


Reply via email to