Functions | |
void | list_add (LIST_NODE **ptr_list, LIST_NODE *ptr_node) |
void | list_cat (LIST_NODE **ptr_dst, LIST_NODE **ptr_src) |
LIST_NODE * | list_remove (LIST_NODE **ptr_list) |
int | list_remove_node (LIST_NODE **ptr_list, LIST_NODE *ptr_remove) |
LIST_NODE * | list_get_head (LIST_NODE **ptr_list) |
LIST_NODE * | list_get_next (LIST_NODE *ptr_list) |
void | list_clean (LIST_NODE *ptr_list, void free(void *ptr)) |
LIST_NODE * | list_replicate (LIST_NODE *ptr_srcList, int size, void *alloc(UINT32 size), void free(void *ptr)) |
void list_add | ( | LIST_NODE ** | ptr_list, | |
LIST_NODE * | ptr_node | |||
) |
Description
The function is called to add a node to the list.
[in] | ptr_list | This is the list to which the node is to be added. |
[in] | ptr_node | This is the node which is to be added. |
Not | Applicable |
void list_cat | ( | LIST_NODE ** | ptr_dst, | |
LIST_NODE ** | ptr_src | |||
) |
Description
The function is called to concatenate the src list to the end of the destination list.
[in] | ptr_dst | This is the head of the destination list. |
[in] | ptr_src | This is the head of the source list. |
Not | Applicable |
void list_clean | ( | LIST_NODE * | ptr_list, | |
void | free(void *ptr) | |||
) |
Description
The function is used to clean a list which has been replicated.
[in] | ptr_list | This is the pointer to list which has been replicated and now needs to be cleaned up. |
[in] | free | This is the memory cleanup API which is invoked to clean the nodes in the list. |
Not | Applicable. |
LIST_NODE* list_get_head | ( | LIST_NODE ** | ptr_list | ) |
Description
The function is used to get the head of the specific list
[in] | ptr_list | This is the pointer to the list. |
Head | of the list (could be NULL if the list is empty) |
LIST_NODE* list_get_next | ( | LIST_NODE * | ptr_list | ) |
Description
The function is used to get the next element in the list.
[in] | ptr_list | This is the pointer to the node in the list. |
Next | element in the list. (could be NULL if this is the last element) |
LIST_NODE* list_remove | ( | LIST_NODE ** | ptr_list | ) |
Description
The function is called to remove the head node from the list.
[in] | ptr_list | This is the pointer to the list from where nodes will be removed. |
Pointer | to the head of the list. |
int list_remove_node | ( | LIST_NODE ** | ptr_list, | |
LIST_NODE * | ptr_remove | |||
) |
Description
The function is called to remove the specified node from the list.
[in] | ptr_list | This is the pointer to the list from where node will be removed. |
[in] | ptr_remove | This is the node which is to be removed. |
Success | - 0 | |
Error | - -1 |
LIST_NODE* list_replicate | ( | LIST_NODE * | ptr_srcList, | |
int | size, | |||
void * | alloc(UINT32 size), | |||
void | free(void *ptr) | |||
) |
Description
The function is used to replicate a list. Replicating a list implies that each node in the source list is copied into the destination node and added to a destination list. This API involves memory allocation and callees are responsible for cleaning up the memory.
[in] | ptr_srcList | This is the pointer to source list which needs to be replicated. |
[in] | size | Size of the Node which is to be copied. |
[in] | alloc | Memory Allocation API which is to be used. |
[in] | free | Memory cleanup API which is to be used. |
Pointer | to the head of the 'new' replicated list. |