Lines Matching defs:List
14 * notice, this list of conditions and the following disclaimer.
16 * notice, this list of conditions and the following disclaimer in the
49 * notice, this list of conditions and the following disclaimer.
51 * notice, this list of conditions and the following disclaimer in the
85 /* A doubly-linked list of pointers. */
86 typedef struct List List;
87 /* A single node in the doubly-linked list. */
91 ListNode *prev; /* previous node in list, or NULL */
92 ListNode *next; /* next node in list, or NULL */
96 struct List {
101 /* Free the list nodes. */
102 void Lst_Done(List *);
103 /* Free the list nodes, as well as each node's datum. */
104 void Lst_DoneFree(List *);
108 /* Initialize a list, without memory allocation. */
110 Lst_Init(List *list)
112 list->first = NULL;
113 list->last = NULL;
116 /* Get information about a list */
119 Lst_IsEmpty(List *list)
121 return list->first == NULL;
125 ListNode *Lst_FindDatum(List *, const void *) MAKE_ATTR_USE;
127 /* Modify a list */
130 void Lst_InsertBefore(List *, ListNode *, void *);
131 /* Add a datum at the head of the list. */
132 void Lst_Prepend(List *, void *);
133 /* Add a datum at the tail of the list. */
134 void Lst_Append(List *, void *);
135 /* Remove the node from the list. */
136 void Lst_Remove(List *, ListNode *);
137 void Lst_PrependAll(List *, List *);
138 void Lst_AppendAll(List *, List *);
139 void Lst_MoveAll(List *, List *);
145 /* Set the value of the node to NULL. Having NULL in a list is unusual. */
148 /* Using the list as a queue */
152 Lst_Enqueue(List *list, void *datum)
154 Lst_Append(list, datum);
158 void *Lst_Dequeue(List *) MAKE_ATTR_USE;