1. It receives a pointer to osrfStringArray. That pointer
is now a pointer to const.
2. It returns a character pointer. That pointer is now a
pointer to const.
I have already examined all existing calls to this function,
and modified them where necessary.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1782
9efc2488-bf62-4759-914b-
345cdb29e865
void osrfStringArrayAdd( osrfStringArray*, const char* str );
-char* osrfStringArrayGetString( osrfStringArray* arr, int index );
+const char* osrfStringArrayGetString( const osrfStringArray* arr, int index );
int osrfStringArrayContains(
const osrfStringArray* arr, const char* string );
@param index A zero-based index into the array
@return A pointer to the string stored at the specified position. if it exists;
or else NULL.
-
- The calling code should treat the returned pointer as if it were const. Some day,
- maybe it will be.
*/
-char* osrfStringArrayGetString( osrfStringArray* arr, int index ) {
+const char* osrfStringArrayGetString( const osrfStringArray* arr, int index ) {
if(!arr) return NULL;
return OSRF_LIST_GET_INDEX(&arr->list, index);
}