Lines Matching full:list

14  *    notice, this list of conditions and the following disclaimer.
16 * notice, this list of conditions and the following disclaimer in the
52 Lst_Done(List *list) in Lst_Done() argument
56 for (ln = list->first; ln != NULL; ln = next) { in Lst_Done()
63 Lst_DoneFree(List *list) in Lst_DoneFree() argument
67 for (ln = list->first; ln != NULL; ln = next) { in Lst_DoneFree()
76 Lst_InsertBefore(List *list, ListNode *ln, void *datum) in Lst_InsertBefore() argument
88 if (ln == list->first) in Lst_InsertBefore()
89 list->first = newNode; in Lst_InsertBefore()
92 /* Add a piece of data at the start of the given list. */
94 Lst_Prepend(List *list, void *datum) in Lst_Prepend() argument
100 ln = LstNodeNew(NULL, list->first, datum); in Lst_Prepend()
102 if (list->first == NULL) { in Lst_Prepend()
103 list->first = ln; in Lst_Prepend()
104 list->last = ln; in Lst_Prepend()
106 list->first->prev = ln; in Lst_Prepend()
107 list->first = ln; in Lst_Prepend()
111 /* Add a piece of data at the end of the given list. */
113 Lst_Append(List *list, void *datum) in Lst_Append() argument
119 ln = LstNodeNew(list->last, NULL, datum); in Lst_Append()
121 if (list->last == NULL) { in Lst_Append()
122 list->first = ln; in Lst_Append()
123 list->last = ln; in Lst_Append()
125 list->last->next = ln; in Lst_Append()
126 list->last = ln; in Lst_Append()
131 * Remove the given node from the given list.
135 Lst_Remove(List *list, ListNode *ln) in Lst_Remove() argument
143 /* unlink it from the list */ in Lst_Remove()
144 if (list->first == ln) in Lst_Remove()
145 list->first = ln->next; in Lst_Remove()
146 if (list->last == ln) in Lst_Remove()
147 list->last = ln->prev; in Lst_Remove()
163 * Having NULL values in a list is unusual though.
174 * Time complexity: O(length(list))
177 Lst_FindDatum(List *list, const void *datum) in Lst_FindDatum() argument
183 for (ln = list->first; ln != NULL; ln = ln->next) in Lst_FindDatum()
192 * The source list becomes indeterminate.
195 Lst_MoveAll(List *dst, List *src) in Lst_MoveAll()
214 Lst_PrependAll(List *dst, List *src) in Lst_PrependAll()
224 Lst_AppendAll(List *dst, List *src) in Lst_AppendAll()
232 /* Remove and return the datum at the head of the given list. */
234 Lst_Dequeue(List *list) in Lst_Dequeue() argument
236 void *datum = list->first->datum; in Lst_Dequeue()
237 Lst_Remove(list, list->first); in Lst_Dequeue()
238 assert(datum != NULL); /* since NULL would mean end of the list */ in Lst_Dequeue()