aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2005-11-08 12:37:31 +0000
committerMartin Willi <martin@strongswan.org>2005-11-08 12:37:31 +0000
commit623fec54c8d50a9510c5f6e8915af751fcf22cbf (patch)
tree91d5f636812e35d6ada16c7ffb51209f69275228
parent8491b29826d8235679c6bfab585feb8edf24a6a7 (diff)
downloadstrongswan-623fec54c8d50a9510c5f6e8915af751fcf22cbf.tar.bz2
strongswan-623fec54c8d50a9510c5f6e8915af751fcf22cbf.tar.xz
- element destructor => private
-rw-r--r--Source/charon/linked_list.c24
-rw-r--r--Source/charon/linked_list.h8
2 files changed, 16 insertions, 16 deletions
diff --git a/Source/charon/linked_list.c b/Source/charon/linked_list.c
index c784b9950..4e7e0fd03 100644
--- a/Source/charon/linked_list.c
+++ b/Source/charon/linked_list.c
@@ -42,6 +42,14 @@ struct private_linked_list_element_s{
linked_list_element_t public;
/**
+ * @brief Destroys a linked_list_element object
+ *
+ * @param linked_list_element_t calling object
+ * @returns SUCCESS if succeeded, FAILED otherwise
+ */
+ status_t (*destroy) (private_linked_list_element_t *this);
+
+ /**
* previous list element
* NULL if first element in list
*/
@@ -78,7 +86,7 @@ linked_list_element_t *linked_list_element_create(void *value)
return NULL;
}
- this->public.destroy = (status_t (*) (linked_list_element_t *this) ) linked_list_element_destroy;
+ this->destroy = linked_list_element_destroy;
this->previous=NULL;
this->next=NULL;
@@ -270,7 +278,7 @@ static status_t insert_first(private_linked_list_t *this, void *item)
if ((this->first == NULL) || (this->last == NULL))
{
/* should never happen */
- element->public.destroy(&(element->public));
+ element->destroy(element);
return FAILED;
}
private_linked_list_element_t *old_first_element = this->first;
@@ -312,7 +320,7 @@ static status_t remove_first(private_linked_list_t *this, void **item)
this->count--;
- return (element->public.destroy(&(element->public)));
+ return (element->destroy(element));
}
/**
@@ -359,7 +367,7 @@ static status_t insert_last(private_linked_list_t *this, void *item)
if ((this->first == NULL) || (this->last == NULL))
{
/* should never happen */
- element->public.destroy(&(element->public));
+ element->destroy(element);
return FAILED;
}
private_linked_list_element_t *old_last_element = this->last;
@@ -401,7 +409,7 @@ static status_t remove_last(private_linked_list_t *this, void **item)
this->count--;
- return (element->public.destroy(&(element->public)));
+ return (element->destroy(element));
}
/**
@@ -445,7 +453,7 @@ static status_t insert_before(private_linked_list_t *this, private_linked_list_e
{
if (this->first != next_element)
{
- element->public.destroy(&(element->public));
+ element->destroy(element);
return FAILED;
}
@@ -487,7 +495,7 @@ static status_t insert_after(private_linked_list_t *this, private_linked_list_el
{
if (this->last != previous_element)
{
- element->public.destroy(&(element->public));
+ element->destroy(element);
return FAILED;
}
@@ -542,7 +550,7 @@ static status_t linked_list_remove(private_linked_list_t *this, private_linked_l
}
this->count--;
- element->public.destroy(&(element->public));
+ element->destroy(element);
return SUCCESS;
}
diff --git a/Source/charon/linked_list.h b/Source/charon/linked_list.h
index 9240da120..038bf40da 100644
--- a/Source/charon/linked_list.h
+++ b/Source/charon/linked_list.h
@@ -42,14 +42,6 @@ struct linked_list_element_s {
* value of a list item
*/
void *value;
-
- /**
- * @brief Destroys a linked_list_element object
- *
- * @param linked_list_element_t calling object
- * @returns SUCCESS if succeeded, FAILED otherwise
- */
- status_t (*destroy) (linked_list_element_t *this);
};
/**