C utils
- points to start of vector.
- size of each element in vector.
- count of elements present in vector
Creates a new vector with elements of size size_t vec_size
size_t vec_size - sizeof type of elements
vec struct with void* st set to NULL
Returns element at index in vector
struct vec* vec - the vector to perform operation on
size_t index - the index of the element to retrieve
void* to the element inside the vector
- Pushes element at the end of vector.
- If not enough space allocated allocates
VECTOR_STEP * vec->sizeoftmore bits usingrealloc().
struct vec* vec - the vector to perform operation on
void* el - pointer to an element to be pushed at the end of vector
- Copies element at end of vector into
void* dest. - Deallocates memory in steps of
VECTOR_STEPelements.
struct vec* vec - the vector to perform operation on
void* dest - location in which to copy the result of the pop
- Frees allocated memory at
vec->st
struct vec* vec - the vector to perform operation on
- Check if vector is empty
struct vec* vec - the vector to perform operation on
bool - Whether ot not the vector has any elements in it