From 96ba022adcf1102191ecebfe44654ed0f4cb0e5b Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 10 Mar 2008 04:53:26 +0000 Subject: [PATCH] Const correctness patch from Scott McKellar. git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1274 9efc2488-bf62-4759-914b-345cdb29e865 --- include/opensrf/osrfConfig.h | 7 ++++--- src/libopensrf/osrfConfig.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/opensrf/osrfConfig.h b/include/opensrf/osrfConfig.h index 90938d5..9c0f913 100644 --- a/include/opensrf/osrfConfig.h +++ b/include/opensrf/osrfConfig.h @@ -37,7 +37,7 @@ typedef struct { @return The config object if the file parses successfully. Otherwise it returns NULL; */ -osrfConfig* osrfConfigInit(char* configFile, char* configContext); +osrfConfig* osrfConfigInit(const char* configFile, const char* configContext); /** @return True if we have a default config defined @@ -83,7 +83,7 @@ void osrfConfigCleanup(); config should be used @param path The search path */ -char* osrfConfigGetValue(osrfConfig* cfg, char* path, ...); +char* osrfConfigGetValue(const osrfConfig* cfg, const char* path, ...); /** @@ -105,7 +105,8 @@ jsonObject* osrfConfigGetValueObject(osrfConfig* cfg, char* path, ...); @return the number of values added to the string array; */ -int osrfConfigGetValueList(osrfConfig* cfg, osrfStringArray* arr, char* path, ...); +int osrfConfigGetValueList(const osrfConfig* cfg, osrfStringArray* arr, + const char* path, ...); #endif diff --git a/src/libopensrf/osrfConfig.c b/src/libopensrf/osrfConfig.c index a315cc1..44ff14d 100644 --- a/src/libopensrf/osrfConfig.c +++ b/src/libopensrf/osrfConfig.c @@ -38,7 +38,7 @@ void osrfConfigReplaceConfig(osrfConfig* cfg, const jsonObject* obj) { cfg->config = jsonObjectClone(obj); } -osrfConfig* osrfConfigInit(char* configFile, char* configContext) { +osrfConfig* osrfConfigInit(const char* configFile, const char* configContext) { if(!configFile) return NULL; // Load XML from the configuration file @@ -72,7 +72,7 @@ osrfConfig* osrfConfigInit(char* configFile, char* configContext) { } -char* osrfConfigGetValue(osrfConfig* cfg, char* path, ...) { +char* osrfConfigGetValue(const osrfConfig* cfg, const char* path, ...) { if(!path) return NULL; if(!cfg) cfg = osrfConfigDefault; if(!cfg) { @@ -104,7 +104,8 @@ jsonObject* osrfConfigGetValueObject(osrfConfig* cfg, char* path, ...) { return jsonObjectFindPath(cfg->config, VA_BUF); } -int osrfConfigGetValueList(osrfConfig* cfg, osrfStringArray* arr, char* path, ...) { +int osrfConfigGetValueList(const osrfConfig* cfg, osrfStringArray* arr, + const char* path, ...) { if(!arr || !path) return 0; if(!cfg) cfg = osrfConfigDefault; -- 2.43.2