[Opensrf-commits] r1240 - trunk/src/gateway

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jan 31 14:56:47 EST 2008


Author: miker
Date: 2008-01-31 14:29:08 -0500 (Thu, 31 Jan 2008)
New Revision: 1240

Modified:
   trunk/src/gateway/apachetools.c
   trunk/src/gateway/apachetools.h
Log:
Patch from Scott McKellar to replace some deprecated identifiers

Modified: trunk/src/gateway/apachetools.c
===================================================================
--- trunk/src/gateway/apachetools.c	2008-01-31 19:23:27 UTC (rev 1239)
+++ trunk/src/gateway/apachetools.c	2008-01-31 19:29:08 UTC (rev 1240)
@@ -1,12 +1,12 @@
 #include "apachetools.h"
 
-string_array* apacheParseParms(request_rec* r) {
+osrfStringArray* apacheParseParms(request_rec* r) {
 
 	if( r == NULL ) return NULL;
 
 	char* arg = r->args;			/* url query string */
 	apr_pool_t *p = r->pool;	/* memory pool */
-	string_array* sarray			= init_string_array(12); /* method parameters */
+	osrfStringArray* sarray		= osrfNewStringArray(12); /* method parameters */
 
 	growing_buffer* buffer		= NULL;	/* POST data */
 	growing_buffer* tmp_buf		= NULL;	/* temp buffer */
@@ -97,13 +97,13 @@
 
 		osrfLogDebug(OSRF_LOG_MARK, "parsed URL params %s=%s", key, val);
 
-		string_array_add(sarray, key);
-		string_array_add(sarray, val);
+		osrfStringArrayAdd(sarray, key);
+		osrfStringArrayAdd(sarray, val);
 
 		if( sanity++ > 1000 ) {
 			osrfLogError(OSRF_LOG_MARK, 
 				"Parsing URL params failed sanity check: 1000 iterations");
-			string_array_destroy(sarray);
+			osrfStringArrayFree(sarray);
 			return NULL;
 		}
 
@@ -118,41 +118,41 @@
 
 
 
-string_array* apacheGetParamKeys(string_array* params) {
+osrfStringArray* apacheGetParamKeys(osrfStringArray* params) {
 	if(params == NULL) return NULL;	
-	string_array* sarray	= init_string_array(12); 
+	osrfStringArray* sarray = osrfNewStringArray(12);
 	int i;
 	osrfLogDebug(OSRF_LOG_MARK, "Fetching URL param keys");
 	for( i = 0; i < params->size; i++ ) 
-		string_array_add(sarray, string_array_get_string(params, i++));	
+		osrfStringArrayAdd(sarray, osrfStringArrayGetString(params, i++));
 	return sarray;
 }
 
-string_array* apacheGetParamValues(string_array* params, char* key) {
+osrfStringArray* apacheGetParamValues(osrfStringArray* params, char* key) {
 
 	if(params == NULL || key == NULL) return NULL;	
-	string_array* sarray	= init_string_array(12); 
+	osrfStringArray* sarray	= osrfNewStringArray(12);
 
 	osrfLogDebug(OSRF_LOG_MARK, "Fetching URL values for key %s", key);
 	int i;
 	for( i = 0; i < params->size; i++ ) {
-		char* nkey = string_array_get_string(params, i++);	
+		char* nkey = osrfStringArrayGetString(params, i++);
 		if(key && !strcmp(nkey, key)) 
-			string_array_add(sarray, string_array_get_string(params, i));	
+			osrfStringArrayAdd(sarray, osrfStringArrayGetString(params, i));
 	}
 	return sarray;
 }
 
 
-char* apacheGetFirstParamValue(string_array* params, char* key) {
+char* apacheGetFirstParamValue(osrfStringArray* params, char* key) {
 	if(params == NULL || key == NULL) return NULL;	
 
 	int i;
 	osrfLogDebug(OSRF_LOG_MARK, "Fetching first URL value for key %s", key);
 	for( i = 0; i < params->size; i++ ) {
-		char* nkey = string_array_get_string(params, i++);	
+		char* nkey = osrfStringArrayGetString(params, i++);
 		if(key && !strcmp(nkey, key)) 
-			return strdup(string_array_get_string(params, i));
+			return strdup(osrfStringArrayGetString(params, i));
 	}
 
 	return NULL;

Modified: trunk/src/gateway/apachetools.h
===================================================================
--- trunk/src/gateway/apachetools.h	2008-01-31 19:23:27 UTC (rev 1239)
+++ trunk/src/gateway/apachetools.h	2008-01-31 19:29:08 UTC (rev 1240)
@@ -19,25 +19,25 @@
 
 
 /* parses apache URL params (GET and POST).  
-	Returns a string_array of the form [ key, val, key, val, ...]
+	Returns a osrfStringArray of the form [ key, val, key, val, ...]
 	Returns NULL if there are no params */
-string_array* apacheParseParms(request_rec* r);
+osrfStringArray* apacheParseParms(request_rec* r);
 
 /* provide the params string array, and this will generate a 
 	string of array of param keys 
-	the returned string_array most be freed by the caller
+	the returned osrfStringArray most be freed by the caller
 	*/
-string_array* apacheGetParamKeys(string_array* params);
+osrfStringArray* apacheGetParamKeys(osrfStringArray* params);
 
 /* provide the params string array and a key name, and 
 	this will provide the value found for that key 
-	the returned string_array most be freed by the caller
+	the returned osrfStringArray most be freed by the caller
 	*/
-string_array* apacheGetParamValues(string_array* params, char* key);
+osrfStringArray* apacheGetParamValues(osrfStringArray* params, char* key);
 
 /* returns the first value found for the given param.  
 	char* must be freed by the caller */
-char* apacheGetFirstParamValue(string_array* params, char* key);
+char* apacheGetFirstParamValue(osrfStringArray* params, char* key);
 
 /* Writes msg to stderr, flushes stderr, and returns 0 */
 int apacheDebug( char* msg, ... );



More information about the opensrf-commits mailing list