vec/include/vec.h

23 lines
409 B
C
Raw Permalink Normal View History

2024-11-15 22:52:59 +00:00
#ifndef VEC_INCLUDED
#define VEC_INCLUDED
struct Vec {
void **items;
int cap;
int len;
};
typedef struct Vec Vec;
#define VEC_INIT_SZ 1
void vec_init(Vec *v);
int vec_realloc(Vec *v,int cap);
void vec_free(Vec *v);
int vec_set(Vec *v,int index, void *item);
void *vec_read(Vec *v,int index);
int vec_push(Vec *v, void *item);
void *vec_pop(Vec *v);
void *vec_delete(Vec *v, int index);
#endif