Lines Matching defs:list
34 // Adds the specified node to the start of the list
36 // Returns: pointer to the start of the list
39 dlist_add_as_first(DL_NODE *list, void *data)
44 return (list);
50 node->next = list;
51 if (list)
52 list->prev = node;
60 // Adds the specified node to the end of the list
62 // Returns: pointer to the start of the list
65 dlist_add_as_last(DL_NODE *list, void *data) {
69 return (list);
76 if (! list) {
80 DL_NODE *temp = dlist_get_last(list);
84 return (list);
92 dlist_find(DL_NODE *list, void *data)
94 DL_NODE *node = list;
105 // Returns the last node in the list or NULL if list is empty
108 dlist_get_first(DL_NODE *list) {
109 DL_NODE *temp = list;
111 if (! list)
122 // Returns the last node in the list or NULL if list is empty
125 dlist_get_last(DL_NODE *list) {
126 DL_NODE *temp = list;
128 if (! list)
140 dlist_length(DL_NODE *list) {
141 DL_NODE *temp = list;
177 dlist_purge(DL_NODE *list) {
180 if (! list)
183 node = list->next;
184 free(list);
185 list = node;
186 } while (list);
191 // Attempts to remove the specified node from the list. The caller is
196 dlist_remove_node(DL_NODE *list, DL_NODE *node) {
197 DL_NODE *temp = list;
199 if (! list || ! node)
201 // special case: removing head of the list
203 if (list == node) {
204 temp = list->next;
208 free(list);
212 // we have no guarantee that the node is in the list
213 // so search through the list to find it
228 return (list);