diff options
Diffstat (limited to 'src/vec.c')
| -rw-r--r-- | src/vec.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -7,13 +7,18 @@ struct vec vec_create(size_t ns) { return (struct vec) { - .n = 0, - .s = 1, - .ns = ns, - .buf = malloc(ns), + .n = 0, + .s = 1, + .ns = ns, + .buf = malloc(ns), }; } +void vec_reset(struct vec *v) +{ + v->n = 0; +} + size_t vec_len(struct vec *v) { return v->n; |
