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 na...@apache.org on 2006/12/05 06:31:56 UTC

svn commit: r482498 - in /webservices/axis2/trunk/c/util: include/axis2_properties.h src/properties.c

Author: nandika
Date: Mon Dec  4 21:31:51 2006
New Revision: 482498

URL: http://svn.apache.org/viewvc?view=rev&rev=482498
Log:
properties load function changed to take a filename instead of a file

Modified:
    webservices/axis2/trunk/c/util/include/axis2_properties.h
    webservices/axis2/trunk/c/util/src/properties.c

Modified: webservices/axis2/trunk/c/util/include/axis2_properties.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/axis2_properties.h?view=diff&rev=482498&r1=482497&r2=482498
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_properties.h (original)
+++ webservices/axis2/trunk/c/util/include/axis2_properties.h Mon Dec  4 21:31:51 2006
@@ -100,7 +100,7 @@
     axis2_status_t (AXIS2_CALL *
     load)(axis2_properties_t *properties,
                  const axis2_env_t *env,
-                 FILE *input);
+                 axis2_char_t *input_filename);
   
    /**
     * store properties

Modified: webservices/axis2/trunk/c/util/src/properties.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/properties.c?view=diff&rev=482498&r1=482497&r2=482498
==============================================================================
--- webservices/axis2/trunk/c/util/src/properties.c (original)
+++ webservices/axis2/trunk/c/util/src/properties.c Mon Dec  4 21:31:51 2006
@@ -50,7 +50,7 @@
 axis2_status_t AXIS2_CALL
 axis2_properties_load(axis2_properties_t *properties,
         const axis2_env_t *env,
-        FILE *input);
+		axis2_char_t  *input_filename);
 
 axis2_status_t AXIS2_CALL
 axis2_properties_store(axis2_properties_t *properties,
@@ -229,9 +229,10 @@
 axis2_status_t AXIS2_CALL
 axis2_properties_load(axis2_properties_t *properties,
         const axis2_env_t *env,
-        FILE *input)
+        axis2_char_t *input_filename)
 {
     axis2_properties_impl_t *properties_impl = NULL;
+	FILE *input = NULL;
     axis2_char_t *cur = NULL;
     axis2_char_t *tag = NULL;
     const int LINE_STARTED = -1;
@@ -246,11 +247,14 @@
     axis2_char_t loginfo[1024];
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env-> error, input, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env-> error, input_filename, AXIS2_FAILURE);
 
     properties_impl = AXIS2_INTF_TO_IMPL(properties);
     prop_hash = properties_impl-> prop_hash;
 
+	input = fopen(input_filename, "r+");
+		if(!input)
+			return AXIS2_FAILURE;
     buffer = axis2_properties_read(input, env);
 
     if (buffer == NULL)
@@ -326,6 +330,8 @@
         AXIS2_FREE(env-> allocator, buffer);
         return AXIS2_FAILURE;
     }
+	if(input)
+		fclose(input);			
     AXIS2_FREE(env-> allocator, buffer);
     return AXIS2_SUCCESS;
 }



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