+#include <stdlib.h>
#include <string.h>
/* common */
/* Check the index */
PRECONDITION (Index < C->Count);
- /* Return the element */
+ /* Return the element */
return C->Items[Index];
}
+void CollSort (Collection* C, int (*Compare) (const void*, const void*))
+/* Sort the collection using the given compare function.
+ * BEWARE: The function uses qsort internally, so the Compare function does
+ * actually get pointers to the object pointers, not just object pointers!
+ */
+{
+ /* Use qsort */
+ qsort (C->Items, C->Count, sizeof (void*), Compare);
+}
+
+
* just the pointer will et replaced.
*/
+void CollSort (Collection* C, int (*Compare) (const void*, const void*));
+/* Sort the collection using the given compare function.
+ * BEWARE: The function uses qsort internally, so the Compare function does
+ * actually get pointers to the object pointers, not just object pointers!
+ */
+
/* End of exprlist.h */