diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-07-03 00:40:50 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-07-04 22:57:41 -0400 |
commit | 4832ab4b43a2e9fb72b1814b32421de1dba1edcb (patch) | |
tree | 208864a5405ee24f882451ba79499f1edba6aa88 /collections/vector/vector.c | |
parent | aeee67bdda0e0f8834cbd3f65da99e3c79f69f65 (diff) |
Add function to get capacity of a vector
Diffstat (limited to 'collections/vector/vector.c')
-rw-r--r-- | collections/vector/vector.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/collections/vector/vector.c b/collections/vector/vector.c index 23e5c47..b8f83de 100644 --- a/collections/vector/vector.c +++ b/collections/vector/vector.c @@ -63,6 +63,16 @@ vec *root; return root->end; } +int vec_capacity(root) +vec *root; +{ + if (!root) { + return -1; + } + + return root->limit; +} + void vec_resize(root) vec *root; { |