#ifndef VECTOR_H #define VECTOR_H typedef struct vector_t vector_t; typedef void (*item_handler)(void *); typedef int (*item_compare)(const void *, const void *); /* * Create a vector: * a: size of the items * c: destroy function * d: show function */ vector_t *vector_new(int, item_handler); void vector_destroy(void *); void vector_sort(vector_t *, item_compare); void vector_add(vector_t *, void *); void vector_delete(vector_t *, int); void vector_flush(vector_t *); void vector_show(vector_t *); void *vector_item(vector_t *, int); void *vector_back(vector_t *); void *vector_pop(vector_t *); int vector_empty(vector_t *); int vector_elems(vector_t *); #endif /* VECTOR_H */