Patch from Scott McKellar to clean up some const qualification and initialize a point...
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 25 Oct 2007 12:04:05 +0000 (12:04 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 25 Oct 2007 12:04:05 +0000 (12:04 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1113 9efc2488-bf62-4759-914b-345cdb29e865

include/opensrf/osrf_settings.h
src/libopensrf/osrf_settings.c

index d0e23df..94b399f 100644 (file)
@@ -20,11 +20,11 @@ typedef struct {
 } osrf_host_config;
 
 
-osrf_host_config* osrf_settings_new_host_config(char* hostname);
+osrf_host_config* osrf_settings_new_host_config(const char* hostname);
 void osrf_settings_free_host_config(osrf_host_config*);
-char* osrf_settings_host_value(char* path, ...);
-jsonObject* osrf_settings_host_value_object(char* format, ...);
-int osrf_settings_retrieve(char* hostname);
+char* osrf_settings_host_value(const char* path, ...);
+jsonObject* osrf_settings_host_value_object(const char* format, ...);
+int osrf_settings_retrieve(const char* hostname);
 
 #endif
 
index a732b08..9b9f944 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,7 +32,7 @@ jsonObject* osrf_settings_host_value_object(char* format, ...) {
 }
 
 
-int osrf_settings_retrieve(char* hostname) {
+int osrf_settings_retrieve(const char* hostname) {
 
        if(!config) {
 
@@ -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;
 }