diff options
Diffstat (limited to 'collections')
-rw-r--r-- | collections/double_ended_queue.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/collections/double_ended_queue.c b/collections/double_ended_queue.c index dac22b6..967a716 100644 --- a/collections/double_ended_queue.c +++ b/collections/double_ended_queue.c @@ -88,6 +88,20 @@ void *item; *(root->end++) = item; } +void deq_push_front(root, item) +deq *root; +void *item; +{ + if (!root) { + return; + } + if (root->end == root->base + root->limit) { + deq_resize(root); + } + + *(root->end++) = item; +} + void* deq_pop_front(root) deq *root; { |