void osrfListClear( osrfList* list );
+void osrfListSwap( osrfList* one, osrfList* two );
+
void* osrfListRemove( osrfList* list, unsigned int position );
void* osrfListExtract( osrfList* list, unsigned int position );
}
/**
+ @brief Exchange the contents of two osrfLists.
+ @param one Pointer to the first osrfList.
+ @param two Pointer to the second osrfList.
+
+ After the call, the first list contains what had been the contents of the second,
+ and vice versa. This swap also works if the two parameters point to the same
+ list; i.e. there is no net effect.
+
+ If either parameter is NULL, nothing happens.
+*/
+void osrfListSwap( osrfList* one, osrfList* two ) {
+ if( one && two ) {
+ osrfList temp = *one;
+ *one = *two;
+ *two = temp;
+ }
+}
+
+/**
@brief Remove the pointer from a specified position.
@param list A pointer to the osrfList.
@param position A zero-based index identifying the pointer to be removed.
}
/**
+ @brief Render an osrfStringArray empty.
+ @param arr Pointer to the osrfStringArray to be emptied.
+*/
+void osrfStringArrayClear( osrfStringArray* arr ) {
+ if( arr ) {
+ osrfListClear( &arr->list );
+ arr->size = 0;
+ }
+}
+
+/**
+ @brief Exchange the contents of two osrfStringArrays.
+ @param one Pointer to the first osrfStringArray.
+ @param two Pointer to the second osrfStringArray.
+
+ After the swap, the first osrfStringArray contains what had been the contents of the
+ second, and vice versa. The swap also works if both parameters point to the same
+ osrfStringArray; i.e. there is no net change.
+
+ If either parameter is NULL, nothing happens.
+*/
+void osrfStringArraySwap( osrfStringArray* one, osrfStringArray* two ) {
+ if( one && two ) {
+ osrfListSwap( &one->list, &two->list );
+ int temp = one->size;
+ one->size = two->size;
+ two->size = temp;
+ }
+}
+
+/**
@brief Free an osrfStringArray, and all the strings inside it.
@param arr Pointer to the osrfStringArray to be freed.
*/