- Append a new node to the list that points to data.
-*/
-list_append(list_t *list, void *data)
+/* Head/tail lookup */
+
+void *list_get_head(list_t *list)
+{
+ if(list->head)
+ return list->head->data;
+ else
+ return NULL;
+}
+
+void *list_get_tail(list_t *list)
+{
+ if(list->tail)
+ return list->tail->data;
+ else
+ return NULL;
+}
+
+/* Fast list deletion */
+
+void list_delete_list(list_t *list)
+{
+ list_node_t *node, *next;
+
+ for(node = list->head; node; node = next) {
+ next = node->next;
+ list_free_node(list, node);
+ }
+
+ list_free(list);
+}
+
+/* Traversing */
+
+void list_foreach_node(list_t *list, list_action_node_t action)
+{
+ list_node_t *node, *next;
+
+ for(node = list->head; node; node = next) {
+ next = node->next;
+ action(node);
+ }
+}
+
+void list_foreach(list_t *list, list_action_t action)