Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
ListItem * ln_prev_p
A pointer to the previous ListItem.
Definition: linked_list.h:45
void(* ll_free_node_fn_p)(ListItem *node_p)
Callback function to use when freeing a ListItem.
Definition: linked_list.h:68
void SetLinkedListFreeNodeFunction(LinkedList *const list_p, void(*free_node_fn)(ListItem *const node_p))
Set the function used to free ListsNodes when the LinkedList is freed.
ListItem * ll_head_p
A pointer to the first ListItem on this list.
Definition: linked_list.h:59
void LinkedListRemove(LinkedList *const list_p, ListItem *const node_p)
Remove a ListItem from a LinkedList.
void MoveListContents(LinkedList *const src_list_p, LinkedList *const dest_list_p)
Move the contents of one list to another.
void LinkedListInsert(LinkedList *const list_p, ListItem *const prev_node_p, ListItem *const node_to_insert_p)
Insert a node into a list after a given node.
void LinkedListPrioritisedInsert(LinkedList *const list_p, ListItem *const node_p, int(*compare_nodes_fn)(const void *v1_p, const void *v2_p))
Insert a node into a list using the given sorting algorithm to determine the node's position on the l...
void InitListItem(ListItem *const item_p)
Initialise a ListItem.
ListItem * ll_tail_p
A pointer to the last ListItem on this list.
Definition: linked_list.h:62
void LinkedListAddTail(LinkedList *const list_p, ListItem *const node_p)
Add a ListItem to the end of a LinkedList.
void LinkedListAddHead(LinkedList *const list_p, ListItem *const node_p)
Add a ListItem to the start of a LinkedList.
void ClearLinkedList(LinkedList *const list_p)
Empty a LinkedList by freeing all of its ListItems.
ListItem * ln_next_p
A pointer to the next ListItem.
Definition: linked_list.h:46
LinkedList * SplitList(LinkedList *const list_p, const uint32 split_list_head_index)
Cut a list into two lists at the given index.
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
ListItem * LinkedListRemTail(LinkedList *const list_p)
Remove the last ListItem from a LinkedList.
uint32 ll_size
The number of ListItems on this list.
Definition: linked_list.h:65
ListItem * LinkedListRemHead(LinkedList *const list_p)
Remove the first ListItem from a LinkedList.
ListItem * LinkedListBinarySearch(const LinkedList *const list_p, const ListItem *const node_p, int(*compare_nodes_fn)(const void *v1_p, const void *v2_p), int *const index_p)
Search a sorted list using the given sorting algorithm for a given node.
void FreeLinkedList(LinkedList *const list_p)
Free a LinkedList.
LinkedList * AllocateLinkedList(void(*free_node_fn_p)(ListItem *const node_p))
Create a new LinkedList.
#define GRASSROOTS_UTIL_API
Definition: grassroots_util_library.h:47
void InitLinkedList(LinkedList *const list_p)
Initialise/clear a LinkedList to be empty.
bool LinkedListSort(LinkedList *const list_p, int(*compare_nodes_fn)(const void *v1_p, const void *v2_p))
Sort a LinkedList.
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43