Exchanges elements x and y of da. Both x and y must be non-negative and less than the length of da.
Sets the size of da to be newlen. newlen must be non-negative. If da shrinks, the elements deleted are no longer accessible. If da grows, the elements created are not initialised. Returns 0 if the function succeeded, or -1 if there was insufficient memory.
Copies the memory referenced by new into a new element at the end of da. Returns the index of the element added, or -1 if there was insufficient memory.
Inserts a new element at position index in da, and copies the memory referenced by new into that element. index must be non-negative and no greater than the length of da. Returns 0 if the function succeeded, or -1 if there was insufficient memory.
Deletes the element at position index in da. index must be non-negative and less than the length of da. The deleted element is no longer accessible.
It is also possible to delete more than one element at once. This requires a `pruning' function.
int (*) (void *
obj, void *
args)
The type of a function pointer used to determine whether to delete objects in a darray. It is passed a reference to the contents of an element in obj, as well as a pointer to user-supplied arguments in args. It should return zero iff the element should not be deleted. Note that if the elements of a darray were dynamically allocated, it is probably a good idea to make the pruning function free this dynamically allocated memory.
Deletes any objects in da for which pruner is true. prune_args is passed as the last argument to pruner.
Concatenates copies of the elements of src onto the end of dest. src and dest must have the same object size. The caller is responsible for freeing the elements of src if necessary. Returns 0 if the function succeeded, or -1 if there was insufficient memory.
Inserts copies of the elements of src into dest, starting at element index. src and dest must have the same object size. index must be non-negative and no greater than the length of dest. The caller is responsible for freeing the elements of src if necessary. Returns 0 if the function succeeded, or -1 if there was insufficient memory.