From 47ebb2db46c7d901042c7a6f6c62111225c389cc Mon Sep 17 00:00:00 2001 From: a bellenir Date: Thu, 21 Aug 2014 09:17:25 +0000 Subject: [PATCH] fix documentation --- source/list/list.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source/list/list.h b/source/list/list.h index 3821c47..87b9f61 100644 --- a/source/list/list.h +++ b/source/list/list.h @@ -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. -- 2.54.0