diff options
Diffstat (limited to 'collections/double_ended_queue.c')
-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 e737d28..232fb44 100644 --- a/collections/double_ended_queue.c +++ b/collections/double_ended_queue.c @@ -101,6 +101,16 @@ deq *root; root->base = tmp; } +void deq_set(root, index, item) +deq *root; +int index; +void *item; +{ + if (!root || !DEQ_IN_BOUNDS(root, index)) + return; + root->base[(root->beg + index) % root->limit] = item; +} + void* deq_index(root, index) deq *root; int index; |