|
libcmutils 0.6.5
Multi-platform C99 utility library
|
A doubly linked list type. More...
Data Fields | |
| void(* | AddFront )(CMUTIL_List *list, void *data) |
| Add an item to the front of the list. | |
| void(* | AddTail )(CMUTIL_List *list, void *data) |
| Add an item to the tail of the list. | |
| void *(* | GetFront )(const CMUTIL_List *list) |
| Get the item at the front of the list. | |
| void *(* | GetTail )(const CMUTIL_List *list) |
| Get the item at the tail of the list. | |
| void *(* | RemoveFront )(CMUTIL_List *list) |
| Remove and return the item at the front of the list. | |
| void *(* | RemoveTail )(CMUTIL_List *list) |
| Remove and return the item at the tail of the list. | |
| void *(* | Remove )(CMUTIL_List *list, void *data) |
| Remove a specific item from the list. | |
| size_t(* | GetSize )(const CMUTIL_List *list) |
| Get the size of the list. | |
| CMUTIL_Iterator *(* | Iterator )(const CMUTIL_List *list) |
| Get an iterator for the list. | |
| void(* | Destroy )(CMUTIL_List *list) |
| Destroy the list and free its resources. | |
| void(* | MoveAll )(CMUTIL_List *dst, CMUTIL_List *src) |
| Move all items from one list to another. | |
A doubly linked list type.
| void(* CMUTIL_List::AddFront) (CMUTIL_List *list, void *data) |
Add an item to the front of the list.
This function inserts a new item at the beginning of the list. Ownership of the data is transferred to the list.
| list | The list to which the item will be added. |
| data | The data to be added to the front of the list. |
| void(* CMUTIL_List::AddTail) (CMUTIL_List *list, void *data) |
Add an item to the tail of the list.
This function appends a new item at the end of the list. Ownership of the data is transferred to the list.
| list | The list to which the item will be added. |
| data | The data to be added to the tail of the list. |
| void *(* CMUTIL_List::GetFront) (const CMUTIL_List *list) |
Get the item at the front of the list.
This function retrieves the data at the front of the list without removing it. Ownership of the data remains with the list.
| list | The list from which the item will be retrieved. |
| void *(* CMUTIL_List::GetTail) (const CMUTIL_List *list) |
Get the item at the tail of the list.
This function retrieves the data at the end of the list without removing it. Ownership of the data remains with the list.
| list | The list from which the item will be retrieved. |
| void *(* CMUTIL_List::RemoveFront) (CMUTIL_List *list) |
Remove and return the item at the front of the list.
This function removes the item at the beginning of the list and returns its data. Ownership of the data is transferred to the caller.
| list | The list from which the item will be removed. |
| void *(* CMUTIL_List::RemoveTail) (CMUTIL_List *list) |
Remove and return the item at the tail of the list.
This function removes the item at the end of the list and returns its data. Ownership of the data is transferred to the caller.
| list | The list from which the item will be removed. |
| void *(* CMUTIL_List::Remove) (CMUTIL_List *list, void *data) |
Remove a specific item from the list.
This function searches for the specified data in the list, removes it if found, and returns the data. Ownership of the data is transferred to the caller.
| list | The list from which the item will be removed. |
| data | The data to be removed from the list. |
| size_t(* CMUTIL_List::GetSize) (const CMUTIL_List *list) |
Get the size of the list.
This function returns the number of items currently in the list.
| list | The list whose size will be retrieved. |
| CMUTIL_Iterator *(* CMUTIL_List::Iterator) (const CMUTIL_List *list) |
Get an iterator for the list.
This function returns an iterator that can be used to traverse the items in the list. The caller is responsible for destroying the iterator after use.
| list | The list for which the iterator will be created. |
| void(* CMUTIL_List::Destroy) (CMUTIL_List *list) |
Destroy the list and free its resources.
This function frees all resources associated with the list. If the list was created with a freecb function, it will be called for each item in the list to free any additional memory.
| list | The list to be destroyed. |
| void(* CMUTIL_List::MoveAll) (CMUTIL_List *dst, CMUTIL_List *src) |
Move all items from one list to another.
This function moves all items from the source list to the destination list. The source list will be empty after the operation.
| dst | The destination list to which items will be moved. |
| src | The source list from which items will be moved. |