Added two convenience functions: list_add_item(), list_remove_item().

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2566 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2003-01-26 23:30:53 +00:00
parent 7f1f508e13
commit 878c4156af
+22
View File
@@ -134,6 +134,28 @@ list_get_prev_item(struct list *list, void *item)
}
/** Adds an item to the end of the list.
* Similar to list_add_link_to_tail() but works on the item, not the link.
*/
void
list_add_item(struct list *list, void *item)
{
list_add_link_to_tail(list, GET_LINK(list, item));
}
/** Removes an item from the list.
* Similar to list_remove_link() but works on the item, not the link.
*/
void
list_remove_item(struct list *list, void *item)
{
list_remove_link(GET_LINK(list, item));
}
/** Removes the first item in the list and returns it.
* Returns NULL if the list is empty.
*/