[Opensrf-commits] r1523 - in trunk: include/opensrf src/libopensrf
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Dec 5 21:28:55 EST 2008
Author: miker
Date: 2008-12-05 21:28:54 -0500 (Fri, 05 Dec 2008)
New Revision: 1523
Modified:
trunk/include/opensrf/string_array.h
trunk/src/libopensrf/string_array.c
Log:
Patch from Scott McKellar:
These patches eliminate several deprecated identifiers in favor of their
camel case equivalents. All these identifiers have already been
eliminated from elsewhere in the source tree:
string_array ==> osrfStringArray
init_string_array ==> osrfNewStringArray
string_array_add ==> osrfStringArrayAdd
string_array_get_string ==> osrfStringArrayGetString
string_array_destroy ==> osrfStringArrayFree
With these patches I complete my pet project of eliminating redundant and
deprecated identifiers (unless of course I discover others that I hadn't
noticed before).
Modified: trunk/include/opensrf/string_array.h
===================================================================
--- trunk/include/opensrf/string_array.h 2008-12-06 02:24:53 UTC (rev 1522)
+++ trunk/include/opensrf/string_array.h 2008-12-06 02:28:54 UTC (rev 1523)
@@ -17,23 +17,17 @@
osrfList* list;
int size;
};
-typedef struct string_array_struct string_array;
typedef struct string_array_struct osrfStringArray;
-osrfStringArray* init_string_array(int size);
osrfStringArray* osrfNewStringArray(int size);
-void string_array_add(osrfStringArray*, char* string);
-void osrfStringArrayAdd(osrfStringArray*, char* string);
+void osrfStringArrayAdd(osrfStringArray*, char* str);
-char* string_array_get_string(osrfStringArray* arr, int index);
char* osrfStringArrayGetString(osrfStringArray* arr, int index);
/* returns true if this array contains the given string */
int osrfStringArrayContains( osrfStringArray* arr, char* string );
-
-void string_array_destroy(osrfStringArray*);
void osrfStringArrayFree(osrfStringArray*);
/* total size of all included strings */
Modified: trunk/src/libopensrf/string_array.c
===================================================================
--- trunk/src/libopensrf/string_array.c 2008-12-06 02:24:53 UTC (rev 1522)
+++ trunk/src/libopensrf/string_array.c 2008-12-06 02:28:54 UTC (rev 1523)
@@ -1,15 +1,11 @@
#include <opensrf/string_array.h>
osrfStringArray* osrfNewStringArray(int size) {
- return init_string_array(size);
-}
-
-string_array* init_string_array(int size) {
if(size > STRING_ARRAY_MAX_SIZE)
- osrfLogError( OSRF_LOG_MARK, "init_string_array size is too large");
+ osrfLogError( OSRF_LOG_MARK, "osrfNewStringArray size is too large");
- string_array* arr;
- OSRF_MALLOC( arr, sizeof(string_array));
+ osrfStringArray* arr;
+ OSRF_MALLOC( arr, sizeof(osrfStringArray));
arr->list = osrfNewListSize(size);
osrfListSetDefaultFree(arr->list);
arr->size = 0;
@@ -17,14 +13,10 @@
}
-void osrfStringArrayAdd(osrfStringArray* arr, char* string) {
- string_array_add(arr, string);
-}
-
-void string_array_add(string_array* arr, char* str) {
+void osrfStringArrayAdd(osrfStringArray* arr, char* str) {
if(arr == NULL || str == NULL ) return;
if( arr->size > STRING_ARRAY_MAX_SIZE )
- osrfLogError( OSRF_LOG_MARK, "string_array_add size is too large");
+ osrfLogError( OSRF_LOG_MARK, "osrfStringArrayAdd size is too large");
osrfListPush(arr->list, strdup(str));
arr->size = arr->list->size;
}
@@ -34,21 +26,10 @@
return OSRF_LIST_GET_INDEX(arr->list, index);
}
-char* string_array_get_string(string_array* arr, int index) {
- if(!arr) return NULL;
- return OSRF_LIST_GET_INDEX(arr->list, index);
-}
-
-
void osrfStringArrayFree(osrfStringArray* arr) {
OSRF_STRING_ARRAY_FREE(arr);
}
-void string_array_destroy(string_array* arr) {
- OSRF_STRING_ARRAY_FREE(arr);
-}
-
-
int osrfStringArrayContains( osrfStringArray* arr, char* string ) {
if(!(arr && string)) return 0;
int i;
More information about the opensrf-commits
mailing list