[Opensrf-commits] r1274 - in trunk: include/opensrf src/libopensrf
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 10 01:26:27 EDT 2008
Author: miker
Date: 2008-03-10 00:53:26 -0400 (Mon, 10 Mar 2008)
New Revision: 1274
Modified:
trunk/include/opensrf/osrfConfig.h
trunk/src/libopensrf/osrfConfig.c
Log:
Const correctness patch from Scott McKellar.
Modified: trunk/include/opensrf/osrfConfig.h
===================================================================
--- trunk/include/opensrf/osrfConfig.h 2008-03-10 04:07:53 UTC (rev 1273)
+++ trunk/include/opensrf/osrfConfig.h 2008-03-10 04:53:26 UTC (rev 1274)
@@ -37,7 +37,7 @@
@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 @@
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 @@
@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
Modified: trunk/src/libopensrf/osrfConfig.c
===================================================================
--- trunk/src/libopensrf/osrfConfig.c 2008-03-10 04:07:53 UTC (rev 1273)
+++ trunk/src/libopensrf/osrfConfig.c 2008-03-10 04:53:26 UTC (rev 1274)
@@ -38,7 +38,7 @@
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 @@
}
-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 @@
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;
More information about the opensrf-commits
mailing list