libds/include/vec.h

26 lines
420 B
C

#ifndef LIBDS_VEC_HEADER
#define LIBDS_VEC_HEADER
#define LIBDS_VEC_CAPACITY 4
#include "libds.h"
struct vec_s {
void* data;
int capacity;
int size;
};
typedef struct vec_s vec;
libds_result vec_init(vec*);
void vec_free(vec*);
libds_result vec_add(vec*, void*);
void vec_remove(vec*, void*);
void* vec_find(vec*, void*, compare_func);
int vec_foreach(vec*, void*, compare_func, foreach_func, ...);
#endif