aboutsummaryrefslogtreecommitdiff
path: root/lib/llist.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-09-09 04:26:03 -0500
committerRob Landley <rob@landley.net>2013-09-09 04:26:03 -0500
commit5f57bccc41c8893914121b00e16a96dd16282486 (patch)
tree740fe030a8ffd4f238cc0b86f35af8e8db227aac /lib/llist.c
parent9d4cd46b82b4e5d05c26dc4fa40ef20174ca0355 (diff)
downloadtoybox-5f57bccc41c8893914121b00e16a96dd16282486.tar.gz
Redo tail closer to the original design. Add more tests for large data sets. (Still no -f support yet.)
Diffstat (limited to 'lib/llist.c')
-rw-r--r--lib/llist.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/llist.c b/lib/llist.c
index 7b41fd08..596da40f 100644
--- a/lib/llist.c
+++ b/lib/llist.c
@@ -33,6 +33,16 @@ void *llist_pop(void *list)
return (void *)next;
}
+void *dlist_pop(void *list)
+{
+ struct double_list **pdlist = (struct double_list **)list, *dlist = *pdlist;
+
+ dlist->next->prev = dlist->prev;
+ dlist->prev->next = *pdlist = dlist->next;
+
+ return dlist;
+}
+
void dlist_add_nomalloc(struct double_list **list, struct double_list *new)
{
if (*list) {