#ifndef NQ_VECTOR_H #define NQ_VECTOR_H #include struct vector { size_t alloc, count, elemsize, arrayoff; }; void *vector_init(size_t alloc, size_t elemsize, size_t arrayoff); void *vector_append(struct vector **vp); void vector_sort(struct vector *v, int (*cmp)(const void *, const void *)); void *vector_search(struct vector *v, const void *key, int (*cmp)(const void *, const void *)); #endif