/* iterate through the list using a list entry, with safety against removal */ #define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field) \ for ((cursor) = LIST_ENTRY((list)->next, type, field), \ (cursor2) = LIST_ENTRY((cursor)->field.next, type, field); \ &(cursor)->field != (list); \ (cursor) = (cursor2), \ (cursor2) = LIST_ENTRY((cursor)->field.next, type, field))
https://stockroom.wandering.shop/media_attachments/files/113/675/257/474/916/336/original/cc10e7246875455f.png