Add a clear function for the vector.

This commit is contained in:
2017-06-11 21:08:39 -07:00
parent 20507f73bb
commit b1a7c21caa
3 changed files with 30 additions and 5 deletions

View File

@@ -88,5 +88,11 @@ int vec_foreach(vec* vec, void* data, compare_func compare, foreach_func foreach
* @return pointer to the value, or, if the index is out of bounds (or there is nothing there) NULL.
*/
void* vec_index(vec* vec, int index);
/**
* Clears the vector, removing all elements from it
* but not resizing it down.
* @param vec the vector to clear.
*/
void vec_clear(vec* vec);
#endif