diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-06-10 18:09:48 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-06-10 18:09:48 -0400 |
commit | 6dce1b32a4e19c875131cdbb441cca0ca23f73f5 (patch) | |
tree | 96e642b1a81c3074731afa791066155f9e247f7c | |
parent | b38bcd56356973a50797630f8366d6701dd7c988 (diff) |
Add capacity function to double ended queue.
-rw-r--r-- | collections/double_ended_queue.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/collections/double_ended_queue.c b/collections/double_ended_queue.c index 232fb44..7857c3a 100644 --- a/collections/double_ended_queue.c +++ b/collections/double_ended_queue.c @@ -71,6 +71,16 @@ deq *root; return (root->limit - root->beg) + (root->end); } +int deq_capacity(root) +deq *root; +{ + if (!root) { + return -1; + } else { + return root->limit; + } +} + void deq_resize(root) deq *root; { |