dynarray: Add pa_dynarray_remove_by_data()

This commit is contained in:
Tanu Kaskinen 2015-01-07 16:56:49 +02:00 committed by David Henningsson
parent 9efe77c8e5
commit 7d3879c07f
2 changed files with 25 additions and 0 deletions

View file

@ -51,6 +51,11 @@ void *pa_dynarray_last(pa_dynarray *array);
/* Returns -PA_ERR_NOENTITY if i is out of bounds, and zero otherwise. */
int pa_dynarray_remove_by_index(pa_dynarray *array, unsigned i);
/* Returns -PA_ERR_NOENTITY if p is not found in the array, and zero
* otherwise. If the array contains multiple occurrencies of p, only one of
* them is removed (and it's unspecified which one). */
int pa_dynarray_remove_by_data(pa_dynarray *array, void *p);
/* Returns the removed item, or NULL if the array is empty. */
void *pa_dynarray_steal_last(pa_dynarray *array);