reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
vector.h File Reference
#include <stddef.h>
#include <stdlib.h>

Go to the source code of this file.

Data Structures

struct  vector_t
 A vector (resizing array) data type. More...

Typedefs

typedef struct vector_t vector_t
 A vector (resizing array) data type.

Functions

void ** vector_at (vector_t *v, size_t idx)
 Return a pointer to where the vector element at 'idx' is stored.
void vector_free (vector_t *v)
 Free the memory held by the given vector, invalidating it.
vector_t vector_new (size_t initial_capacity)
 Allocate and initialize a new vector.
void * vector_pop (vector_t *v)
 Remove and return some pointer that is contained in the given vector, or return NULL if the given vector is empty.
void vector_push (vector_t *v, void *element)
 Add the given element to the vector.
void vector_pushall (vector_t *v, void **array, size_t size)
 Add all elements of the given array to the vector.
size_t vector_size (vector_t *v)
 Return the size of the vector.
void vector_vote (vector_t *v)
 Vote on whether this vector should be given less memory.