commit 4fa3b087be5d4ca311cf2b6e936bd3148da215af
parent e11ec1354ead0cc954095dc7c7e75120be2447ea
Author: sin <sin@2f30.org>
Date: Tue, 8 Apr 2014 09:44:44 +0100
Add vector_len() function
Diffstat:
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;
+}