linked-list: Add method to compare two lists of objects for equality

This commit is contained in:
Tobias Brunner
2016-03-08 10:21:57 +01:00
parent 229cdf6bc8
commit 348b0ffbc6
3 changed files with 166 additions and 2 deletions
+22 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 Tobias Brunner
* Copyright (C) 2007-2015 Tobias Brunner
* Copyright (C) 2005-2008 Martin Willi
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
@@ -217,6 +217,27 @@ struct linked_list_t {
*/
linked_list_t *(*clone_offset) (linked_list_t *this, size_t offset);
/**
* Compare two lists and their objects for equality using the given equals
* method.
*
* @param other list to compare
* @param offset offset of the objects equals method
* @return TRUE if lists and objects are equal, FALSE otherwise
*/
bool (*equals_offset) (linked_list_t *this, linked_list_t *other,
size_t offset);
/**
* Compare two lists and their objects for equality using the given function.
*
* @param other list to compare
* @param function function to compare the objects
* @return TRUE if lists and objects are equal, FALSE otherwise
*/
bool (*equals_function) (linked_list_t *this, linked_list_t *other,
bool (*)(void*,void*));
/**
* Destroys a linked_list object.
*/