Cthulhu  0.2.10
Cthulhu compiler collection
vector.h File Reference
#include <ctu_std_api.h>
#include "core/analyze.h"
#include <stddef.h>
Include dependency graph for vector.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef typedefCT_BEGIN_API struct arena_t arena_t
 

Functions

CT_STD_API void vector_delete (STA_RELEASE vector_t *vector)
 destroy a vector More...
 
CT_NODISCARD CT_STD_API vector_tvector_new (size_t size, arena_t *arena)
 create a new vector with an initial capacity More...
 
CT_NODISCARD CT_STD_API vector_tvector_of (size_t len, arena_t *arena)
 create a new vector with a specified length More...
 
CT_NODISCARD CT_STD_API vector_tvector_init (void *value, arena_t *arena)
 create a new vector with a single initial value More...
 
CT_NODISCARD CT_STD_API vector_tvector_clone (vector_t *vector)
 clone a vector More...
 
CT_STD_API void vector_push (vector_t **vector, void *value)
 push a value onto the end of a vector More...
 
CT_STD_API void vector_drop (vector_t *vector)
 pop a value from the end of a vector More...
 
CT_STD_API void vector_set (vector_t *vector, size_t index, void *value)
 set a value in a vector More...
 
CT_NODISCARD CT_PUREFN CT_STD_API void * vector_get (const vector_t *vector, size_t index)
 get a value from a vector More...
 
CT_NODISCARD CT_PUREFN CT_STD_API void * vector_tail (const vector_t *vector)
 get the last element of a vector More...
 
CT_NODISCARD CT_PUREFN CT_STD_API size_t vector_len (const vector_t *vector)
 get the length of a vector More...
 
CT_STD_API void vector_append (vector_t **vector, const vector_t *other)
 append the contents of one vector to another this copies the contents of other into vector More...
 
CT_PUREFN CT_STD_API size_t vector_find (vector_t *vector, const void *element)
 find an element in a vector searches via pointer equality More...
 
CT_STD_API void vector_reset (vector_t *vec)
 reset the contents of a vector More...
 
CT_STD_API void ** vector_data (vector_t *vec)
 get the data of a vector More...
 

Variables

CT_STD_API vector_t gEmptyVector
 a global empty vector used to avoid allocating alot of empty vectors More...
 
CT_STD_API const vector_t kEmptyVector
 a global empty vector used to avoid allocating alot of empty vectors More...
 

Typedef Documentation

◆ arena_t

typedef typedefCT_BEGIN_API struct arena_t arena_t

Definition at line 11 of file vector.h.