Use ptr_first(any_panel) to find the first panel. Then use the C_LINK.next pointer to walk along the linked list of panels until the last (next == NULL).