struct list_node_t* prev;
} list_node_t;
-/** A singly linked list */
+/** A doubly linked list */
typedef struct list_t
{
/** Pointer to the first element in the list */
*/
bool list_empty(list_t* list);
-/**
+/** !!this function is unnecessary now that list is doubly linked.
* @brief Find the node before the given one in the specified list.
*
* @param list The list to search thru
* @param node The node to search for
*
* @return Pointer to the node before the given node or
- * NULL if given node is NULL, not present, or is the head of list
+ * NULL if given node is NULL, is the head of list
*/
list_node_t* list_prev(list_t* list, list_node_t* node);
* This function loops through the linked list and returns the index in the list
* that matches the specified node. Returns -1 if the node is not found.
* Note: since NULL is implicitly at the end of every list, calling this
- * with NULL for the node is essentially equivalent to list_size
+ * with NULL for the node is equivalent to list_size
*
* @param list The list to search thru
* @param node The node to look for
*
* @param list The list to operate on.
* @param node The node after which the item should be inserted.
+ * if node is NULL, will insert at the beginning of the list
* @param contents The contents of the new node.
*
* @return Pointer to the newly inserted node
*
* This function differs from the above list_delete in that it is given a
* pointer to a node to be deleted instead of an index.
- * //TODO: verify node->next should be set to NULL following successful deletion
- * //TODO: verify node->next should not be touched if node not present in list
- * //TODO: verify node should not be freed following deletion
*
* @param list The list to operate on.
* @param node A pointer to the node to delete.