diff options
author | Jan Hutter <jhutter@hsr.ch> | 2005-12-06 14:50:56 +0000 |
---|---|---|
committer | Jan Hutter <jhutter@hsr.ch> | 2005-12-06 14:50:56 +0000 |
commit | d794bcdb08bb6d03f554902579a129071e73be46 (patch) | |
tree | 028ab0f2d35ae16eadded47c31173aad1d3f89e1 /Source/charon/utils/linked_list.c | |
parent | c3dc864eaa5cebae57be1b0e9339f2e7ebdbfe15 (diff) | |
download | strongswan-d794bcdb08bb6d03f554902579a129071e73be46.tar.bz2 strongswan-d794bcdb08bb6d03f554902579a129071e73be46.tar.xz |
- code cleaned up
Diffstat (limited to 'Source/charon/utils/linked_list.c')
-rw-r--r-- | Source/charon/utils/linked_list.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/charon/utils/linked_list.c b/Source/charon/utils/linked_list.c index b6d4c348c..69e0ffc12 100644 --- a/Source/charon/utils/linked_list.c +++ b/Source/charon/utils/linked_list.c @@ -27,35 +27,39 @@ #include <utils/allocator.h> + typedef struct linked_list_element_t linked_list_element_t; /** - * @brief Element of the linked_list. + * @brief Element in a linked list. * - * This element holds a pointer to the value of the list item itself. + * This element holds a pointer to the value it represents. */ struct linked_list_element_t { + /** * Value of a list item. */ void *value; /** - * previous list element - * NULL if first element in list + * Previous list element. + * + * NULL if first element in list. */ linked_list_element_t *previous; /** - * next list element - * NULL if last element in list + * Next list element. + * + * NULL if last element in list. */ linked_list_element_t *next; /** * Destroys a linked_list_element object. * - * @param linked_list_element_t calling object + * @param linked_list_element_t calling object */ void (*destroy) (linked_list_element_t *this); }; @@ -73,8 +77,8 @@ static void linked_list_element_destroy(linked_list_element_t *this) * * @warning Only the pointer to the value is stored. * - * @param[in] value value of item to be set - * @return linked_list_element_t object + * @param[in] value value of item to be set + * @return linked_list_element_t object */ linked_list_element_t *linked_list_element_create(void *value) @@ -92,8 +96,9 @@ linked_list_element_t *linked_list_element_create(void *value) typedef struct private_linked_list_t private_linked_list_t; + /** - * Private variables and functions of linked list. + * Private data of a linked_list_t object. * */ struct private_linked_list_t { @@ -582,7 +587,6 @@ static status_t get_at_position (private_linked_list_t *this,size_t position, vo return status; } - /** * Implementation of linked_list_t.get_last. */ @@ -628,7 +632,6 @@ static void linked_list_destroy(private_linked_list_t *this) { void * value; /* Remove all list items before destroying list */ - while (this->public.remove_first(&(this->public),&value) != NOT_FOUND) { /* values are not destroyed so memory leaks are possible @@ -638,7 +641,7 @@ static void linked_list_destroy(private_linked_list_t *this) } /* - * Described in header + * Described in header. */ linked_list_t *linked_list_create() { |