[open-ils-commits] r8095 - in trunk/Open-ILS/src/c-apps: . openils
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 20 08:30:51 EST 2007
Author: miker
Date: 2007-11-20 08:13:20 -0500 (Tue, 20 Nov 2007)
New Revision: 8095
Modified:
trunk/Open-ILS/src/c-apps/oils_idl-core.c
trunk/Open-ILS/src/c-apps/openils/oils_idl.h
Log:
Patch from Scott McKellar to apply some const-correctness to the ILS C code
Modified: trunk/Open-ILS/src/c-apps/oils_idl-core.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_idl-core.c 2007-11-20 13:04:18 UTC (rev 8094)
+++ trunk/Open-ILS/src/c-apps/oils_idl-core.c 2007-11-20 13:13:20 UTC (rev 8095)
@@ -16,13 +16,13 @@
#define OBJECT_NS "http://open-ils.org/spec/opensrf/IDL/objects/v1"
#define BASE_NS "http://opensrf.org/spec/IDL/base/v1"
-xmlDocPtr idlDoc = NULL; // parse and store the IDL here
+static xmlDocPtr idlDoc = NULL; // parse and store the IDL here
/* parse and store the IDL here */
-osrfHash* idlHash;
+static osrfHash* idlHash;
-osrfHash* oilsIDL() { return idlHash; }
-osrfHash* oilsIDLInit( char* idl_filename ) {
+osrfHash* oilsIDL(void) { return idlHash; }
+osrfHash* oilsIDLInit( const char* idl_filename ) {
if (idlHash) return idlHash;
@@ -294,7 +294,7 @@
return idlHash;
}
-osrfHash* oilsIDLFindPath( char* path, ... ) {
+osrfHash* oilsIDLFindPath( const char* path, ... ) {
if(!path || strlen(path) < 1) return NULL;
osrfHash* obj = idlHash;
@@ -316,13 +316,13 @@
return obj;
}
-int oilsIDL_classIsFieldmapper ( char* classname ) {
+int oilsIDL_classIsFieldmapper ( const char* classname ) {
if (!classname) return 0;
if(oilsIDLFindPath( "/%s", classname )) return 1;
return 0;
}
-int oilsIDL_ntop (char* classname, char* fieldname) {
+int oilsIDL_ntop (const char* classname, const char* fieldname) {
osrfHash* _pos = NULL;
if (!oilsIDL_classIsFieldmapper(classname)) return -1;
@@ -331,7 +331,7 @@
return -1;
}
-char * oilsIDL_pton (char* classname, int pos) {
+char * oilsIDL_pton (const char* classname, int pos) {
char* ret = NULL;
osrfHash* f = NULL;
osrfHash* fields = NULL;
Modified: trunk/Open-ILS/src/c-apps/openils/oils_idl.h
===================================================================
--- trunk/Open-ILS/src/c-apps/openils/oils_idl.h 2007-11-20 13:04:18 UTC (rev 8094)
+++ trunk/Open-ILS/src/c-apps/openils/oils_idl.h 2007-11-20 13:13:20 UTC (rev 8095)
@@ -5,9 +5,9 @@
#ifndef OILS_IDL_API
#define OILS_IDL_API
-osrfHash* oilsIDLInit( char* );
-osrfHash* oilsIDL();
-osrfHash* oilsIDLFindPath( char*, ... );
+osrfHash* oilsIDLInit( const char* );
+osrfHash* oilsIDL(void);
+osrfHash* oilsIDLFindPath( const char*, ... );
/* The oilsIDL hash looks like this:
@@ -44,8 +44,8 @@
*/
-int oilsIDL_classIsFieldmapper(char*);
-char * oilsIDL_pton(char *, int);
-int oilsIDL_ntop(char *, char *);
+int oilsIDL_classIsFieldmapper(const char*);
+char * oilsIDL_pton(const char *, int);
+int oilsIDL_ntop(const char *, const char *);
#endif
More information about the open-ils-commits
mailing list