From a8081b269af07f189f6dd0d7a375ac4f7801b43e Mon Sep 17 00:00:00 2001 From: scottmk Date: Wed, 25 Nov 2009 16:05:55 +0000 Subject: [PATCH 1/1] 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 git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1862 9efc2488-bf62-4759-914b-345cdb29e865 --- src/c-apps/osrf_math.c | 2 +- src/c-apps/timejson.c | 2 +- src/gateway/osrf_json_gateway.c | 2 +- src/libopensrf/osrf_cache.c | 2 +- src/libopensrf/osrf_json_test.c | 2 +- src/libopensrf/osrf_message.c | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/c-apps/osrf_math.c b/src/c-apps/osrf_math.c index ea90947..ec6711d 100644 --- a/src/c-apps/osrf_math.c +++ b/src/c-apps/osrf_math.c @@ -76,7 +76,7 @@ int osrfMathRun( osrfMethodContext* ctx ) { 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 */ diff --git a/src/c-apps/timejson.c b/src/c-apps/timejson.c index 0ee1e94..009b50e 100644 --- a/src/c-apps/timejson.c +++ b/src/c-apps/timejson.c @@ -33,7 +33,7 @@ int main( void ) { for( i = 10000000; i; --i ) { -// pObj = jsonParseString( sample_json ); +// pObj = jsonParse( sample_json ); pObj = jsonNewObject( NULL ); jsonObject * p1 = jsonNewObject( NULL ); jsonObject * p2 = jsonNewObject( NULL ); diff --git a/src/gateway/osrf_json_gateway.c b/src/gateway/osrf_json_gateway.c index 5701ff0..f6e345b 100644 --- a/src/gateway/osrf_json_gateway.c +++ b/src/gateway/osrf_json_gateway.c @@ -112,7 +112,7 @@ static int osrf_json_gateway_method_handler (request_rec *r) { ap_log_rerror( APLOG_MARK, APLOG_DEBUG, 0, r, "Using legacy JSON"); } else { - parseJSONFunc = jsonParseString; + parseJSONFunc = jsonParse; jsonToStringFunc = jsonObjectToJSON; } diff --git a/src/libopensrf/osrf_cache.c b/src/libopensrf/osrf_cache.c index b8ce502..e88ae00 100644 --- a/src/libopensrf/osrf_cache.c +++ b/src/libopensrf/osrf_cache.c @@ -56,7 +56,7 @@ jsonObject* osrfCacheGetObject( const char* key, ... ) { 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); diff --git a/src/libopensrf/osrf_json_test.c b/src/libopensrf/osrf_json_test.c index 4d1994d..e50a364 100644 --- a/src/libopensrf/osrf_json_test.c +++ b/src/libopensrf/osrf_json_test.c @@ -44,7 +44,7 @@ static void speedTest() { jsonString = jsonObjectToJSON(hash); printf("%s\n\n", jsonString); - dupe = jsonParseString(jsonString); + dupe = jsonParse(jsonString); jsonObjectFree(dupe); free(jsonString); diff --git a/src/libopensrf/osrf_message.c b/src/libopensrf/osrf_message.c index 5a9c64b..a316c1c 100644 --- a/src/libopensrf/osrf_message.c +++ b/src/libopensrf/osrf_message.c @@ -196,7 +196,7 @@ void osrf_message_set_params( osrfMessage* msg, const jsonObject* o ) { 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 @@ void osrf_message_set_result_content( osrfMessage* msg, const char* json_string if( msg->_result_content ) jsonObjectFree( msg->_result_content ); - msg->_result_content = jsonParseString(json_string); + msg->_result_content = jsonParse(json_string); } @@ -463,7 +463,7 @@ osrfList* osrfMessageDeserialize( const char* string, osrfList* list ) { } // 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 osrf_message_deserialize(const char* string, osrfMessage* msgs[], int count) int numparsed = 0; // Parse the JSON - jsonObject* json = jsonParseString(string); + jsonObject* json = jsonParse(string); if(!json) { osrfLogWarning( OSRF_LOG_MARK, -- 2.43.2