libds

simple data structures library and utility functions
git clone git://git.2f30.org/libds.git
Log | Files | Refs | LICENSE

commit 4fa3b087be5d4ca311cf2b6e936bd3148da215af
parent e11ec1354ead0cc954095dc7c7e75120be2447ea
Author: sin <sin@2f30.org>
Date:   Tue Apr  8 09:44:44 +0100

Add vector_len() function

Diffstat:
ds.h | 1+
vector.c | 6++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/ds.h b/ds.h @@ -8,5 +8,6 @@ struct vector *vector_init(void); void vector_free(struct vector *); size_t vector_add(struct vector *, void *); void *vector_get(struct vector *, size_t); +size_t vector_len(struct vector *); #endif diff --git a/vector.c b/vector.c @@ -106,3 +106,9 @@ vector_get(struct vector *vector, size_t i) } return NULL; } + +size_t +vector_len(struct vector *vector) +{ + return vector->ne; +}