Lines Matching refs:datum
40 LstNodeNew(ListNode *prev, ListNode *next, void *datum)
46 ln->datum = datum;
69 free(ln->datum);
74 /* Insert a new node with the datum before the given node. */
76 Lst_InsertBefore(List *list, ListNode *ln, void *datum)
80 assert(datum != NULL);
82 newNode = LstNodeNew(ln->prev, ln, datum);
94 Lst_Prepend(List *list, void *datum)
98 assert(datum != NULL);
100 ln = LstNodeNew(NULL, list->first, datum);
113 Lst_Append(List *list, void *datum)
117 assert(datum != NULL);
119 ln = LstNodeNew(list->last, NULL, datum);
132 * The datum stored in the node must be freed by the caller, if necessary.
152 /* Replace the datum in the given node with the new datum. */
154 LstNode_Set(ListNode *ln, void *datum)
156 assert(datum != NULL);
158 ln->datum = datum;
162 * Replace the datum in the given node with NULL.
168 ln->datum = NULL;
172 * Return the first node that contains the given datum, or NULL.
177 Lst_FindDatum(List *list, const void *datum)
181 assert(datum != NULL);
184 if (ln->datum == datum)
219 Lst_Prepend(dst, ln->datum);
229 Lst_Append(dst, ln->datum);
232 /* Remove and return the datum at the head of the given list. */
236 void *datum = list->first->datum;
238 assert(datum != NULL); /* since NULL would mean end of the list */
239 return datum;