23 lines
409 B
C
23 lines
409 B
C
#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
|