memcpy(e, element, array->elem_size);
}
+void
+ARR_RemoveElement(ARR_Instance array, unsigned int index)
+{
+ void *e, *l;
+
+ e = ARR_GetElement(array, index);
+ l = ARR_GetElement(array, array->used - 1);
+
+ if (e < l)
+ memmove(e, (char *)e + array->elem_size, (char *)l - (char *)e);
+ array->used--;
+
+ realloc_array(array, array->used);
+}
+
void
ARR_SetSize(ARR_Instance array, unsigned int size)
{
/* Add a new element to the end of the array */
extern void ARR_AppendElement(ARR_Instance array, void *element);
+/* Remove element with given index */
+extern void ARR_RemoveElement(ARR_Instance array, unsigned int index);
+
/* Set the size of the array */
extern void ARR_SetSize(ARR_Instance array, unsigned int size);