32 #define CREATE_LINK_LIST_HEADER(list) static LINK_LIST_HEADER list = {NULL, &list, &list} 101 #endif // _STBLLIST_H void STB_LLAddBlockToEnd(LINK_LIST_HEADER *hdr, LINK_LIST_PTR_BLK *new_blk)
Adds the block identified by the new_blk pointer to the end of the linked list identified by the list...
LINK_LIST_PTR_BLK * STB_LLGetPrevBlock(LINK_LIST_PTR_BLK *blk)
Returns a pointer to the previous block in the linked list, or NULL if at the start of the list...
LINK_LIST_PTR_BLK * STB_LLGetBlock(LINK_LIST_HEADER *hdr, U16BIT num)
Returns a pointer to the n-th block in the list.
U16BIT STB_LLGetNumBlocks(LINK_LIST_HEADER *hdr)
Counts and returns the number of blocks in a linked list.
LINK_LIST_PTR_BLK * STB_LLGetLastBlock(LINK_LIST_HEADER *hdr)
Returns a pointer to the last block in the linked list, identified by hdr.
void STB_LLRemoveBlock(LINK_LIST_PTR_BLK *blk)
Removes the block identified by the blk pointer from its linked list.
LINK_LIST_PTR_BLK * STB_LLGetNextBlock(LINK_LIST_PTR_BLK *blk)
Returns a pointer to the next block in the linked list, or NULL if at the end of the list...
LINK_LIST_PTR_BLK * STB_LLGetFirstBlock(LINK_LIST_HEADER *hdr)
Returns a pointer to the first block in the linked list, identified by hdr.
BOOLEAN STB_LLCheckBlockInList(LINK_LIST_HEADER *hdr, LINK_LIST_PTR_BLK *blk)
Checks if the supplied pointer is to a block in the specified list.
System Wide Global Technical Data Type Definitions.
void STB_LLAddBlockBefore(LINK_LIST_PTR_BLK *blk, LINK_LIST_PTR_BLK *new_blk)
Adds the block identified by the new_blk pointer to the linked list before the block identified by th...
void STB_LLAddBlockAfter(LINK_LIST_PTR_BLK *blk, LINK_LIST_PTR_BLK *new_blk)
Adds the block identified by the new_blk pointer to the linked list after the block identified by the...
void STB_LLInitialiseHeader(LINK_LIST_HEADER *hdr)
Initialise the header variables of the linked list.
void STB_LLAddBlockToStart(LINK_LIST_HEADER *hdr, LINK_LIST_PTR_BLK *new_blk)
Adds the block identified by the new_blk pointer to the start of the linked list identified by the li...
BOOLEAN STB_LLSort(LINK_LIST_HEADER *ll_hdr, S16BIT(*cmp_func)(LINK_LIST_PTR_BLK **, LINK_LIST_PTR_BLK **))
Sorts the blocks of a link list object in ascending or descending order NOTE: The order in which the ...