Patch from Scott McKellar; use camelCase instead of under_score function names
[OpenSRF.git] / src / libopensrf / osrf_settings.c
index a732b08..a189932 100644 (file)
@@ -2,7 +2,7 @@
 
 osrf_host_config* config = NULL;
 
-char* osrf_settings_host_value(char* format, ...) {
+char* osrf_settings_host_value(const char* format, ...) {
        VA_LIST_TO_STRING(format);
 
        if( ! config ) {
@@ -18,7 +18,7 @@ char* osrf_settings_host_value(char* format, ...) {
        return val;
 }
 
-jsonObject* osrf_settings_host_value_object(char* format, ...) {
+jsonObject* osrf_settings_host_value_object(const char* format, ...) {
        VA_LIST_TO_STRING(format);
 
        if( ! config ) {
@@ -32,16 +32,16 @@ jsonObject* osrf_settings_host_value_object(char* format, ...) {
 }
 
 
-int osrf_settings_retrieve(char* hostname) {
+int osrf_settings_retrieve(const char* hostname) {
 
        if(!config) {
 
-               osrf_app_session* session = osrf_app_client_session_init("opensrf.settings");
+               osrfAppSession* session = osrf_app_client_session_init("opensrf.settings");
                jsonObject* params = jsonNewObject(NULL);
                jsonObjectPush(params, jsonNewObject(hostname));
-               int req_id = osrf_app_session_make_req
+               int req_id = osrfAppSessionMakeRequest
                        session, params, "opensrf.settings.host_config.get", 1, NULL );
-               osrf_message* omsg = osrf_app_session_request_recv( session, req_id, 60 );
+               osrf_message* omsg = osrfAppSessionRequestRecv( session, req_id, 60 );
                jsonObjectFree(params);
 
                if(!omsg) {
@@ -61,7 +61,7 @@ int osrf_settings_retrieve(char* hostname) {
                }
 
                osrf_app_session_request_finish( session, req_id );
-               osrf_app_session_destroy( session );
+               osrfAppSessionFree( session );
 
                if(!config) {
                        osrfLogError( OSRF_LOG_MARK, "Unable to load config for host %s", hostname);
@@ -72,10 +72,11 @@ int osrf_settings_retrieve(char* hostname) {
        return 0;
 }
 
-osrf_host_config* osrf_settings_new_host_config(char* hostname) {
+osrf_host_config* osrf_settings_new_host_config(const char* hostname) {
        if(!hostname) return NULL;
        osrf_host_config* c = safe_malloc(sizeof(osrf_host_config));
        c->hostname = strdup(hostname);
+       c->config = NULL;
        return c;
 }