libds/include/vec.h

28 lines
449 B
C
Raw Normal View History

#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, ...);
void* vec_index(vec*, int);
#endif