]> git.mdlowis.com Git - projs/libcds.git/commitdiff
fix documentation
authora bellenir <a@bellenir.com>
Thu, 21 Aug 2014 09:17:25 +0000 (09:17 +0000)
committera bellenir <a@bellenir.com>
Thu, 21 Aug 2014 09:17:25 +0000 (09:17 +0000)
source/list/list.h

index 3821c4780b953fd95ad02d1af8c6cb3034e93a17..87b9f61518b580f61c76b3c1dfe3c51b5681b2b7 100644 (file)
@@ -19,7 +19,7 @@ typedef struct list_node_t
     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 */
@@ -83,14 +83,14 @@ size_t list_size(list_t* 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);
 
@@ -113,7 +113,7 @@ list_node_t* list_at(list_t* list, size_t index);
  * 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
@@ -192,6 +192,7 @@ list_node_t* list_insert( list_t* list, size_t index, void* contents);
  *
  * @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
@@ -217,9 +218,6 @@ list_node_t* list_delete(list_t* list, size_t index);
  *
  * 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.