This macro returns a pointer to the last node in a list. If the list is empty, the macro returns a pointer to the head (beginning-of-list) anchor. To determine if the return value is an actual node rather than the head anchor, call the IsNodeB() procedure.
Example 1: Example 15-3 Use of LastNode in reverse list traversal
for (n = LastNode(list); IsNodeB(list, n); n = PrevNode( n ))
{ . . . };
Arguments
l
A pointer to the list structure to be examined.
Return Value
The macro returns a pointer to last node in the list or, if the list is empty, a pointer to the head (beginning-of-list) anchor.