voidlinked_list_Insert ( LinkedListRef**list, void*item );Insert a new Item to the LinkedList
void*linked_list_Remove ( LinkedListRef**list, void*item );Remove an item from the LinkedList
- paramlist - Reference to the LinkedList
- paramitem - Reference to the item to be removed
- returnsvoid* - Reference to the recently removed item, NULL if item is not found
- @warning Freeing the allocated memory of the returned pointer is the developer's responsibility.
voidlinked_list_Iterate ( LinkedListRef**list, IterateMethodcallbackMethod, void*userData );Iterate all items in the LinkedList
- paramlist - Reference to the LinkedList
- paramcallbackMethod - A callback function which is called for each item
- paramuserData - A pointer which is sent to the callback method.
void*linked_list_Search ( LinkedListRef**list, SearchMethodtestMethod, void*userData );Search for an item in the LinkedList
- paramlist - Reference to the LinkedList
- paramtestMethod - A callback function which is called for each item as a comparison test.
- paramuserData - A pointer which is sent to the callback method.
- returnsvoid* Reference to the item found as a result of the search, NULL if item not found.
voidlinked_list_Drop ( LinkedListRef**list, FreeMethodfreeCallback );Free the complete Linked List and the data it contains.
- paramlist - Reference to the LinkedList.
- paramfreeCallback - Callback Method called for each item removed from linked list.
- @warning Developer should free the memory of that item in this callback.
struct__linked_list_item_ref {
void*data;
struct__linked_list_item_ref*next;
};
typedefstruct__linked_list_item_refLinkedListRef;typedefbool (*SearchMethod) (void*listItem, void*userData);Callback Method template for search operation in a LinkedList
- paramlistItem - A test item
- paramuserData - A pointer as given to
linked_list_Search - returnsboolean - true if comparison successful, false otherwise
typedefvoid (*IterateMethod)(intindex, void*listItem, void*userData);Callback Method for each item in the iteration of the linked list
- paramindex - item index
- paramlistItem - An item from the linked list
- paramuserData - A pointer as given to
linked_list_Iterate
typedefvoid (*FreeMethod)(void*listItem);Callback Method for each item in the iteration of the linked list
- paramlistItem - Pointer to the item to be freed.