From c06dbbabd1498d614d4db88bb4205e2afcd6dab8 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 8 Feb 2006 15:25:34 +0000 Subject: - fixed alot of bugs in child_proposal - near to working state ;-) --- Source/charon/utils/linked_list.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'Source/charon/utils/linked_list.h') diff --git a/Source/charon/utils/linked_list.h b/Source/charon/utils/linked_list.h index 113d64260..8647f064d 100644 --- a/Source/charon/utils/linked_list.h +++ b/Source/charon/utils/linked_list.h @@ -64,6 +64,22 @@ struct linked_list_t { * @return new iterator_t object */ iterator_t * (*create_iterator) (linked_list_t *linked_list, bool forward); + + /** + * @brief Call a function with list element as argument. + * + * This method accepts a function, which will be called for + * each list element once. The function must accept the list + * element as the first argument. Handy for destruction of + * list elements. + * + * @todo Additional vararg which are passed to the + * function would be nice... + * + * @param linked_list calling object + * @param func function to call + */ + void (*call_on_items) (linked_list_t *linked_list, void(*func)(void*)); /** * @brief Inserts a new item at the beginning of the list. @@ -77,7 +93,7 @@ struct linked_list_t { * @brief Removes the first item in the list and returns its value. * * @param linked_list calling object - * @param[out] item returned value of first item + * @param[out] item returned value of first item, or NULL * @return * - SUCCESS * - NOT_FOUND, if list is empty @@ -143,7 +159,7 @@ struct linked_list_t { * @brief Removes the last item in the list and returns its value. * * @param linked_list calling object - * @param[out] item item returned value of last item + * @param[out] item returned value of last item, or NULL * @return * - SUCCESS * - NOT_FOUND if list is empty @@ -154,7 +170,7 @@ struct linked_list_t { * @brief Returns the value of the last list item without removing it. * * @param linked_list calling object - * @param[out] item item returned value of last item + * @param[out] item returned value of last item * @return * - SUCCESS * - NOT_FOUND if list is empty -- cgit v1.2.3