aboutsummaryrefslogtreecommitdiffhomepage
path: root/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'list.c')
-rw-r--r--list.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/list.c b/list.c
index 1a4aa3a..8487200 100644
--- a/list.c
+++ b/list.c
@@ -40,6 +40,24 @@ enet_list_remove (ENetListIterator position)
return position;
}
+ENetListIterator
+enet_list_move (ENetListIterator position, void * dataFirst, void * dataLast)
+{
+ ENetListIterator first = (ENetListIterator) dataFirst,
+ last = (ENetListIterator) dataLast;
+
+ first -> previous -> next = last -> next;
+ last -> next -> previous = first -> previous;
+
+ first -> previous = position -> previous;
+ last -> next = position;
+
+ first -> previous -> next = first;
+ position -> previous = last;
+
+ return first;
+}
+
size_t
enet_list_size (ENetList * list)
{