blob: 6fba081d67606139dd166bb64dc98017a98935cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#ifndef NQ_VECTOR_H
#define NQ_VECTOR_H
#include <stddef.h>
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
|