[Opensrf-commits] r1862 - in trunk/src: c-apps gateway libopensrf (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Nov 25 11:05:58 EST 2009


Author: scottmk
Date: 2009-11-25 11:05:55 -0500 (Wed, 25 Nov 2009)
New Revision: 1862

Modified:
   trunk/src/c-apps/osrf_math.c
   trunk/src/c-apps/timejson.c
   trunk/src/gateway/osrf_json_gateway.c
   trunk/src/libopensrf/osrf_cache.c
   trunk/src/libopensrf/osrf_json_test.c
   trunk/src/libopensrf/osrf_message.c
Log:
Replacing calls to the old JSON parser with calls to the
new JSON parser.

M    src/gateway/osrf_json_gateway.c
M    src/c-apps/osrf_math.c
M    src/c-apps/timejson.c
M    src/libopensrf/osrf_json_test.c
M    src/libopensrf/osrf_message.c
M    src/libopensrf/osrf_cache.c


Modified: trunk/src/c-apps/osrf_math.c
===================================================================
--- trunk/src/c-apps/osrf_math.c	2009-11-20 20:56:25 UTC (rev 1861)
+++ trunk/src/c-apps/osrf_math.c	2009-11-25 16:05:55 UTC (rev 1862)
@@ -76,7 +76,7 @@
 					ctx->method->name, a, b );
 
 			/* construct a new params object to send to dbmath */
-			jsonObject* newParams = jsonParseStringFmt( "[ %s, %s ]", a, b );
+			jsonObject* newParams = jsonParseFmt( "[ %s, %s ]", a, b );
 			free(a); free(b);
 
 			/* connect to db math */

Modified: trunk/src/c-apps/timejson.c
===================================================================
--- trunk/src/c-apps/timejson.c	2009-11-20 20:56:25 UTC (rev 1861)
+++ trunk/src/c-apps/timejson.c	2009-11-25 16:05:55 UTC (rev 1862)
@@ -33,7 +33,7 @@
 
 	for( i = 10000000; i; --i )
 	{
-//		pObj = jsonParseString( sample_json );
+//		pObj = jsonParse( sample_json );
 		pObj = jsonNewObject( NULL );
 		jsonObject * p1 = jsonNewObject( NULL );
 		jsonObject * p2 = jsonNewObject( NULL );

Modified: trunk/src/gateway/osrf_json_gateway.c
===================================================================
--- trunk/src/gateway/osrf_json_gateway.c	2009-11-20 20:56:25 UTC (rev 1861)
+++ trunk/src/gateway/osrf_json_gateway.c	2009-11-25 16:05:55 UTC (rev 1862)
@@ -112,7 +112,7 @@
 		ap_log_rerror( APLOG_MARK, APLOG_DEBUG, 0, r, "Using legacy JSON");
 
 	} else {
-		parseJSONFunc = jsonParseString;
+		parseJSONFunc = jsonParse;
 		jsonToStringFunc = jsonObjectToJSON;
 	}
 

Modified: trunk/src/libopensrf/osrf_cache.c
===================================================================
--- trunk/src/libopensrf/osrf_cache.c	2009-11-20 20:56:25 UTC (rev 1861)
+++ trunk/src/libopensrf/osrf_cache.c	2009-11-25 16:05:55 UTC (rev 1862)
@@ -56,7 +56,7 @@
 		const char* data = (const char*) mc_aget( _osrfCache, VA_BUF, strlen(VA_BUF) );
 		if( data ) {
 			osrfLogInternal( OSRF_LOG_MARK, "osrfCacheGetObject(): Returning object (key=%s): %s", VA_BUF, data);
-			obj = jsonParseString( data );
+			obj = jsonParse( data );
 			return obj;
 		}
 		osrfLogDebug(OSRF_LOG_MARK, "No cache data exists with key %s", VA_BUF);

Modified: trunk/src/libopensrf/osrf_json_test.c
===================================================================
--- trunk/src/libopensrf/osrf_json_test.c	2009-11-20 20:56:25 UTC (rev 1861)
+++ trunk/src/libopensrf/osrf_json_test.c	2009-11-25 16:05:55 UTC (rev 1862)
@@ -44,7 +44,7 @@
 
         jsonString = jsonObjectToJSON(hash);
         printf("%s\n\n", jsonString);
-        dupe = jsonParseString(jsonString);
+        dupe = jsonParse(jsonString);
 
         jsonObjectFree(dupe);
         free(jsonString);

Modified: trunk/src/libopensrf/osrf_message.c
===================================================================
--- trunk/src/libopensrf/osrf_message.c	2009-11-20 20:56:25 UTC (rev 1861)
+++ trunk/src/libopensrf/osrf_message.c	2009-11-25 16:05:55 UTC (rev 1862)
@@ -196,7 +196,7 @@
 void osrf_message_add_param( osrfMessage* msg, const char* param_string ) {
 	if(msg == NULL || param_string == NULL) return;
 	if(!msg->_params) msg->_params = jsonNewObjectType( JSON_ARRAY );
-	jsonObjectPush(msg->_params, jsonParseString(param_string));
+	jsonObjectPush(msg->_params, jsonParse(param_string));
 }
 
 
@@ -244,7 +244,7 @@
 	if( msg->_result_content )
 		jsonObjectFree( msg->_result_content );
 
-	msg->_result_content = jsonParseString(json_string);
+	msg->_result_content = jsonParse(json_string);
 }
 
 
@@ -463,7 +463,7 @@
 	}
 	
 	// Parse the JSON
-	jsonObject* json = jsonParseString(string);
+	jsonObject* json = jsonParse(string);
 	if(!json) {
 		osrfLogWarning( OSRF_LOG_MARK,
 				"osrfMessageDeserialize() unable to parse data: \n%s\n", string);
@@ -514,7 +514,7 @@
 	int numparsed = 0;
 
 	// Parse the JSON
-	jsonObject* json = jsonParseString(string);
+	jsonObject* json = jsonParse(string);
 
 	if(!json) {
 		osrfLogWarning( OSRF_LOG_MARK,



More information about the opensrf-commits mailing list