struct tagTest
{
ListEntry mListEntry;
uint32 mMember1;
SemysAnyReference mReference;
} Test;
ListEntry list1 = C_SEMYS_LIST_NULL, list2 = C_SEMYS_LIST_NULL, *le = 0;
Test test1;
/* List initialization */
ListInit(&list1);
ListInit(&list2);
/* Item initialization */
test1.mReference.mpRef = &test1;
/* Insert items */
ListPushBack(&list1, &test1.mListEntry);
ListPushBack(&list2, &test1.mReference.mListEntry);
/* Iterate (forward) through list */
le = list2.mpNext;
while (le != &list2)
{
Test *pTest = (Test *)(((SemysAnyReference *)ListGetNext(&le))->mpRef);
/* Remove entry */
ListRemoveEntry(&pTest->mReference.mListEntry);
ListRemoveEntry(&pTest->mListEntry);
}
|