Lines Matching refs:head

13 	struct dllist *head = NULL, *l4, *l3, *l2, *l1;
22 DLLIST_PREPEND(&head, l4);
23 test_assert(head == l4);
25 DLLIST_PREPEND(&head, l3);
26 test_assert(head == l3);
29 DLLIST_PREPEND(&head, l2);
30 DLLIST_PREPEND(&head, l1);
32 DLLIST_REMOVE(&head, l2);
34 test_assert(head == l1);
38 /* remove from head */
39 DLLIST_REMOVE(&head, l1);
41 test_assert(head == l3);
45 DLLIST_PREPEND(&head, l1);
46 DLLIST_REMOVE(&head, l4);
48 test_assert(head == l1);
52 DLLIST_REMOVE(&head, &empty);
53 test_assert(head == l1);
57 DLLIST_REMOVE(&head, l1);
58 DLLIST_REMOVE(&head, l3);
60 test_assert(head == NULL);
66 struct dllist *head = NULL, *tail = NULL, *l4, *l3, *l2, *l1;
76 DLLIST2_PREPEND(&head, &tail, l3);
77 test_assert(head == l3 && tail == l3);
80 DLLIST2_REMOVE(&head, &tail, l3);
81 test_assert(head == NULL && tail == NULL);
84 DLLIST2_APPEND(&head, &tail, l3);
85 test_assert(head == l3 && tail == l3);
88 DLLIST2_PREPEND(&head, &tail, l2);
89 test_assert(head == l2 && tail == l3);
93 DLLIST2_APPEND(&head, &tail, l4);
94 test_assert(head == l2 && tail == l4);
98 DLLIST2_PREPEND(&head, &tail, l1);
101 DLLIST2_REMOVE(&head, &tail, l2);
103 test_assert(head == l1 && tail == l4);
107 /* remove from head */
108 DLLIST2_REMOVE(&head, &tail, l1);
110 test_assert(head == l3 && tail == l4);
114 DLLIST2_PREPEND(&head, &tail, l1);
115 DLLIST2_REMOVE(&head, &tail, l4);
117 test_assert(head == l1 && tail == l3);
121 DLLIST2_REMOVE(&head, &tail, &empty);
122 test_assert(head == l1);
123 test_assert(head == l1 && tail == l3);
127 DLLIST2_REMOVE(&head, &tail, l1);
128 DLLIST2_REMOVE(&head, &tail, l3);
130 test_assert(head == NULL && tail == NULL);